mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
bitkeeper revision 1.1159.1.42 (411b8205n-7QEGvjIUl4GfoBiiNpcw)
Destroy domain earlier in migration to allow migration to localhost.
This commit is contained in:
1 parent
dfc4d9ab9e
commit
556703ea34
4 files changed
+64
-16
No files matched your search
@@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
import traceback
|
||||
|
||||
import errno
|
||||
import sys
|
||||
import socket
|
||||
@@ -156,6 +158,19 @@ class XfrdInfo:
|
||||
print 'xfr_progress>', val
|
||||
return None
|
||||
|
||||
def xfr_vm_destroy(self, xfrd, val):
|
||||
print 'xfr_vm_destroy>', val
|
||||
try:
|
||||
vmid = sxp.child0(val)
|
||||
val = self.xd.domain_destroy(vmid)
|
||||
if vmid in self.paused:
|
||||
del self.paused[vmid]
|
||||
if vmid in self.suspended:
|
||||
del self.suspended[vmid]
|
||||
except:
|
||||
val = errno.EINVAL
|
||||
return ['xfr.err', val]
|
||||
|
||||
def xfr_vm_pause(self, xfrd, val):
|
||||
print 'xfr_vm_pause>', val
|
||||
try:
|
||||
@@ -221,7 +236,9 @@ class XfrdInfo:
|
||||
d.addErrback(cberr)
|
||||
d.setTimeout(self.timeout)
|
||||
return d
|
||||
except:
|
||||
except Exception, err:
|
||||
print 'xfr_vm_suspend> Exception', err
|
||||
traceback.print_exc()
|
||||
val = errno.EINVAL
|
||||
return ['xfr.err', val]
|
||||
|
||||
@@ -401,8 +418,6 @@ class XendMigrate:
|
||||
@param port: destination port
|
||||
@return: deferred
|
||||
"""
|
||||
if host in ['localhost', '127.0.0.1']:
|
||||
raise XendError('cannot migrate to localhost')
|
||||
# Check dom for existence, not migrating already.
|
||||
# Subscribe to migrate notifications (for updating).
|
||||
xid = self.nextid()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
import struct
|
||||
import types
|
||||
|
||||
from xen.lowlevel import xu
|
||||
|
||||
@@ -230,19 +231,22 @@ def unpackMsg(ty, msg):
|
||||
@rtype: dict
|
||||
"""
|
||||
args = msg.get_payload()
|
||||
mac = [0, 0, 0, 0, 0, 0]
|
||||
macs = []
|
||||
for (k, v) in args.items():
|
||||
if k.startswith('mac['):
|
||||
macs += k
|
||||
i = int(k[4:5])
|
||||
mac[i] = v
|
||||
else:
|
||||
pass
|
||||
if macs:
|
||||
args['mac'] = mac
|
||||
for k in macs:
|
||||
del args[k]
|
||||
if isinstance(args, types.StringType):
|
||||
args = { 'value': args }
|
||||
else:
|
||||
mac = [0, 0, 0, 0, 0, 0]
|
||||
macs = []
|
||||
for (k, v) in args.items():
|
||||
if k.startswith('mac['):
|
||||
macs += k
|
||||
i = int(k[4:5])
|
||||
mac[i] = v
|
||||
else:
|
||||
pass
|
||||
if macs:
|
||||
args['mac'] = mac
|
||||
for k in macs:
|
||||
del args[k]
|
||||
if DEBUG:
|
||||
msgid = msg.get_header()['id']
|
||||
print '<unpackMsg', msgid, ty, args
|
||||
|
||||