# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1239254376 25200
# Node ID 2f260c9f4cc7f914038f5eef12deb7c72e1cacf8
# Parent 6027a48279e6daff21453a30b3749a0b79218c8a
[TEST] Adding check_mig_support() to vsmigration.py [Rebased Patch].
This check is used to verify if local migration is triggered for KVM.
Tested for Xen/KVM with current sources and rpm.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 6027a48279e6 -r 2f260c9f4cc7 suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Tue Apr 07 06:29:37 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Apr 08 22:19:36 2009 -0700
@@ -23,6 +23,7 @@
import random
from time import sleep
+from socket import gethostbyaddr
from VirtLib import utils
from pywbem import WBEMConnection, CIMInstanceName
from CimTest.CimExt import CIMMethodClass, CIMClassMOF
@@ -90,6 +91,16 @@
class KVM_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
pass
+def check_mig_support(virt, options):
+ s_sysname = gethostbyaddr(options.ip)[0]
+ t_sysname = gethostbyaddr(options.t_url)[0]
+ if virt == 'KVM' and (t_sysname == s_sysname or t_sysname in s_sysname):
+ logger.info("Libvirt does not support local migration for KVM")
+ return SKIP, s_sysname, t_sysname
+
+ return PASS, s_sysname, t_sysname
+
+
def get_msd(virt, mtype='live', mpriority=0):
if mtype == "live":
mtype = CIM_MIGRATE_LIVE
Show replies by date