Skip to contentSkip to conversation

fix a HVM save/restore race condition after r15639

PATCH New Zhai, Edwin 1 participant 1 message Aug 13, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix a HVM save/restore race condition after r15639

Tim,

The qemu save command sending is moved from saveInputHandler to refreshShutdown(too late) in r15639, so higher possibility that control panel read a not ready qemu state file especially for live migration.

If reading happened before qemu create this file, a python missing file exception would occur. If before qemu put the record length in the file header as the last step, dest machine would try to restore a zero length qemu file to lead state lost in each device.

Attached patch can fix it, pls. have a look.

Thanks,

Signature · 2 lines
best rgds,
edwin
tools/python/xen/xend/XendCheckpoint.py +3 -0
diff -r 045b0034effd tools/python/xen/xend/XendCheckpoint.py
@@ -98,6 +98,9 @@ def save(fd, dominfo, network, live, dst
                 log.info("Domain %d suspended.", dominfo.getDomid())
                 dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP3,
                                        domain_name)
+                if hvm:
+                    dominfo.image.saveDeviceModel()
+
                 tochild.write("done\n")
                 tochild.flush()
                 log.debug('Written done')
tools/python/xen/xend/XendDomainInfo.py +0 -2
diff -r 045b0034effd tools/python/xen/xend/XendDomainInfo.py
@@ -1184,8 +1184,6 @@ class XendDomainInfo:
                     self._clearRestart()
 
                     if reason == 'suspend':
-                        if self._stateGet() != DOM_STATE_SUSPENDED:
-                            self.image.saveDeviceModel()
                         self._stateSet(DOM_STATE_SUSPENDED)
                         # Don't destroy the domain.  XendCheckpoint will do
                         # this once it has finished.  However, stop watching

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