Skip to contentSkip to conversation

xend: Make _setCPUAffinity() errors nonfatal on domain resume

PATCH New Jiri Denemark 1 participant 1 message Nov 20, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xend: Make _setCPUAffinity() errors nonfatal on domain resume

Hi,

this patch allows domains to be resumed on different number of CPUs. After c/s 18764, a domain cannot be resumed when _setCPUAffinity() fails, which happens when affinity should be set to a non-existent CPU. This patch makes _setCPUAffinity() errors nonfatal.

tools/python/xen/xend/XendDomainInfo.py +8 -1
diff -r 98d48f7680db tools/python/xen/xend/XendDomainInfo.py
@@ -479,7 +479,14 @@ class XendDomainInfo:
         if state in (DOM_STATE_SUSPENDED, DOM_STATE_HALTED):
             try:
                 self._constructDomain()
-                self._setCPUAffinity()
+
+                try:
+                    self._setCPUAffinity()
+                except:
+                    # usually a CPU we want to set affinity to does not exist
+                    # we just ignore it so that the domain can still be restored
+                    log.warn("Cannot restore CPU affinity")
+
                 self._storeVmDetails()
                 self._createChannels()
                 self._createDevices()

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel