
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1247604765 25200 # Node ID a3ff36c310b2729052991032cf6c8f5cee85e838 # Parent 05d74ccb64b9ca5b313d8ccb5a89138f1dfc1aea [TEST] Remove stale XenFV guest if migration fails in VSMS/02 Sometimes xend gets hung doing a local migration of XenFV guests. The guest will show up in "xm list" as "migrating-guest_name". The problem with this is that libvirt sees the guest as "guest_name", so libvirt is unable to undefine the guest. In this case, we need to do an xm destroy to remove the guest. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 05d74ccb64b9 -r a3ff36c310b2 suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Tue Jul 14 10:15:37 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Tue Jul 14 13:52:45 2009 -0700 @@ -34,6 +34,7 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE from XenKvmLib.const import do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL +from XenKvmLib.xm_virt_util import xm_destroy sup_types = ['Xen', 'XenFV'] @@ -182,7 +183,11 @@ if local_migrate == 0 and cxml is not None: cxml.destroy(options.ip) - cxml.undefine(options.ip) + rc = cxml.undefine(options.ip) + if rc == 1: + #Problem migrating guest locally, forcefully remove guest + xen_guest_name = "migrating-%s" % guest_name + xm_destroy(options.ip, xen_guest_name) except Exception, details: logger.error("Exception details: %s", details) diff -r 05d74ccb64b9 -r a3ff36c310b2 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Jul 14 10:15:37 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Jul 14 13:52:45 2009 -0700 @@ -38,6 +38,13 @@ return out +def xm_destroy(ip, domid): + + cmd = "xm destroy %s" % domid + + rc, out = utils.run_remote(ip, cmd) + return rc + def list_guests_on_bridge(ip, bridge): """Returns a list of domU names that have vifs in the specified bridge.