766768c9d2
opensuse13.img for SLE-Server virtinst-detect-suse-distros.patch - bnc#881549 - virt-manager/xen: Error changing VM configuration: 'NoneType' object has no attribute 'split' virtinst-xenbus-disk-index-fix.patch - Upstream bug fix 538edb3b-manpage-fix-incorrect-description.patch - Upstream bug fixes 536677aa-better-handling-of-keyboard-input-type.patch 5385d602-lxc-no-default-disk.patch 53869170-virt-install-add-events-support.patch 538a11dc-raise-error-if-populating-summary-page-fails.patch 538a3609-virtconv-fix-use-of-relative-OVF-file.patch 538a3ba9-diskbackend-start-pool-if-not-running.patch 538ca3f3-use-correct-dictionary-keys-for-old-pool-net-polling.patch 538d00a4-xen-keyboard-cant-be-removed.patch 538e2f74-fix-pool-create-call.patch - Dropped 531e0a82-reverse-keyboard-grab-commit.patch. Fixed instead with this patch. 538a6862-vnc-dont-force-keyboard-grab-before-widget-is-realized.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=182
76 lines
2.9 KiB
Diff
76 lines
2.9 KiB
Diff
Subject: pollhelpers: Use correct dictionary keys for old pool/net polling (bz 1099827)
|
|
From: Cole Robinson crobinso@redhat.com Mon Jun 2 12:17:21 2014 -0400
|
|
Date: Mon Jun 2 12:18:59 2014 -0400:
|
|
Git: d3e9af832899088a17aeb44441e8316177f563ae
|
|
|
|
We were inadvertently using the object name rather than UUID when libvirt
|
|
didn't support new style polling APIs.
|
|
|
|
Index: virt-manager-1.0.1/virtinst/pollhelpers.py
|
|
===================================================================
|
|
--- virt-manager-1.0.1.orig/virtinst/pollhelpers.py
|
|
+++ virt-manager-1.0.1/virtinst/pollhelpers.py
|
|
@@ -52,7 +52,8 @@ def _new_poll_helper(origmap, typename,
|
|
|
|
def _old_poll_helper(origmap, typename,
|
|
active_list, inactive_list,
|
|
- lookup_func, build_func):
|
|
+ lookup_func, build_func,
|
|
+ key_is_uuid=False):
|
|
"""
|
|
Helper routine for old style split API libvirt polling.
|
|
@origmap: Pre-existing mapping of objects, with key->obj mapping.
|
|
@@ -64,6 +65,8 @@ def _old_poll_helper(origmap, typename,
|
|
@lookup_func: Function to get an object handle for the passed name
|
|
@build_func: Function that builds a new object class. It is passed
|
|
args of (raw libvirt object, key (usually UUID))
|
|
+ @key_is_uuid: If True, we use the object UUID as the returned dictionary
|
|
+ keys
|
|
"""
|
|
current = {}
|
|
new = {}
|
|
@@ -79,8 +82,10 @@ def _old_poll_helper(origmap, typename,
|
|
except Exception, e:
|
|
logging.debug("Unable to list inactive %ss: %s", typename, e)
|
|
|
|
- def check_obj(key):
|
|
- if key not in origmap:
|
|
+ def check_obj(name):
|
|
+ obj = None
|
|
+ key = name
|
|
+ if key not in origmap or key_is_uuid:
|
|
try:
|
|
obj = lookup_func(key)
|
|
except Exception, e:
|
|
@@ -88,6 +93,10 @@ def _old_poll_helper(origmap, typename,
|
|
typename, key, e)
|
|
return
|
|
|
|
+ if key_is_uuid:
|
|
+ key = obj.UUIDString()
|
|
+
|
|
+ if key not in origmap:
|
|
# Object is brand new this period
|
|
current[key] = build_func(obj, key)
|
|
new[key] = current[key]
|
|
@@ -120,7 +129,8 @@ def fetch_nets(backend, origmap, build_f
|
|
|
|
return _old_poll_helper(origmap, name,
|
|
active_list, inactive_list,
|
|
- lookup_func, build_func)
|
|
+ lookup_func, build_func,
|
|
+ key_is_uuid=True)
|
|
|
|
|
|
def fetch_pools(backend, origmap, build_func):
|
|
@@ -138,7 +148,8 @@ def fetch_pools(backend, origmap, build_
|
|
|
|
return _old_poll_helper(origmap, name,
|
|
active_list, inactive_list,
|
|
- lookup_func, build_func)
|
|
+ lookup_func, build_func,
|
|
+ key_is_uuid=True)
|
|
|
|
|
|
def fetch_volumes(backend, pool, origmap, build_func):
|