mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Block IO safety patch for live migration. Xend checks that VBDs are destroyed before unpausing the domain.
This commit is contained in:
1 parent
34784d695b
commit
458052b5ec
3 files changed
+21
-3
No files matched your search
@@ -161,10 +161,12 @@ def restore(xd, fd):
|
||||
if handler.store_mfn is None or handler.console_mfn is None:
|
||||
raise XendError('Could not read store/console MFN')
|
||||
|
||||
#Block until src closes connection
|
||||
os.read(fd, 1)
|
||||
dominfo.unpause()
|
||||
|
||||
|
||||
dominfo.completeRestore(handler.store_mfn, handler.console_mfn)
|
||||
|
||||
|
||||
return dominfo
|
||||
except:
|
||||
dominfo.destroy()
|
||||
|
||||
@@ -431,7 +431,8 @@ class XendDomain:
|
||||
sock.send("receive\n")
|
||||
sock.recv(80)
|
||||
XendCheckpoint.save(sock.fileno(), dominfo, True, live, dst)
|
||||
|
||||
dominfo.testDeviceComplete()
|
||||
sock.close()
|
||||
|
||||
def domain_save(self, domid, dst):
|
||||
"""Start saving a domain to file.
|
||||
|
||||
@@ -1494,6 +1494,21 @@ class XendDomainInfo:
|
||||
if rc != 0:
|
||||
raise XendError("Device of type '%s' refuses migration." % n)
|
||||
|
||||
def testDeviceComplete(self):
|
||||
""" For Block IO migration safety we must ensure that
|
||||
the device has shutdown correctly, i.e. all blocks are
|
||||
flushed to disk
|
||||
"""
|
||||
while True:
|
||||
test = 0
|
||||
for i in self.getDeviceController('vbd').deviceIDs():
|
||||
test = 1
|
||||
log.info("Dev %s still active, looping...", i)
|
||||
time.sleep(0.1)
|
||||
|
||||
if test == 0:
|
||||
break
|
||||
|
||||
def migrateDevices(self, network, dst, step, domName=''):
|
||||
"""Notify the devices about migration
|
||||
"""
|
||||
|
||||