Fw: [Fwd: [Libvirt-cim] [PATCH] [TEST] A few migration related fixes]

----- Forwarded by Guo Lian Yun/China/IBM on 2008-07-01 10:29 ----- Guo Lian Yun/China/IBM 2008-07-01 10:24 To Kaitlin Rupert <kaitlin@linux.vnet.ibm.com> cc Subject Re: [Fwd: [Libvirt-cim] [PATCH] [TEST] A few migration related fixes] Kaitlin Rupert <kaitlin@linux.vnet.ibm.com> wrote on 2008-07-01 00:05:03:
Can I get a review of this patch?
Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
----- Message from Kaitlin Rupert <kaitlin@linux.vnet.ibm.com> on Wed, 25 Jun 2008 14:18:23 -0700 -----
To:
libvirt-cim@redhat.com
Subject:
[Libvirt-cim] [PATCH] [TEST] A few migration related fixes
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1214423985 25200 # Node ID ef376bdad2e186904b15cda1afd230d8056e8015 # Parent 5c90c9a2fd567d7cf592932db189afbc8a4756f8 [TEST] A few migration related fixes.
Fixes: -Remove destroy_and_undefine_domain() call from migrate_guest_to_host(). This call takes the domain name as a parameter, but migrate_guest_to_host() doesn't take the domain name So calling destroy_and_undefine_domain() resulted in an error. -Add a hack to get_typed_class() so it supports Virt_MigrationJob (which doesn't fit the typical <virt>_<basename> pattern.
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt- cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py --- a/suites/libvirt- cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Thu Jun 19 10:35:59 2008 -0700 +++ b/suites/libvirt- cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Wed Jun 25 12:59:45 2008 -0700 @@ -90,10 +90,10 @@ return FAIL
status, ret = migrate_guest_to_host(service, cs_ref, target_ip) - if status == FAIL: logger.error("MigrateVirtualSystemToHost: unexpected list length %s" % len(ret)) + destroy_and_undefine_domain(dom_name, options.ip) return status elif len(ret) == 2: id = ret[1]['Job'].keybindings['InstanceID'] @@ -102,7 +102,7 @@ guest_name, local_migrate)
- destroy_and_undefine_domain(dom_name, options.ip) + destroy_and_undefine_domain(dom_name, options.ip)
return status
diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt- cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py --- a/suites/libvirt- cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Thu Jun 19 10:35:59 2008 -0700 +++ b/suites/libvirt- cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Wed Jun 25 12:59:45 2008 -0700 @@ -145,12 +145,11 @@
logger.info("Migrating guest with the following options:") logger.info("%s" % item) - status, ret = migrate_guest_to_host(service, cs_ref, target_ip, - item) - + status, ret = migrate_guest_to_host(service, cs_ref, target_ip, item) if status == FAIL: logger.error("MigrateVirtualSystemToHost: unexpected list length %s" % len(ret)) + destroy_and_undefine_domain(dom_name, options.ip) return status elif len(ret) == 2: id = ret[1]['Job'].keybindings['InstanceID'] diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt- cim/lib/XenKvmLib/classes.py --- a/suites/libvirt-cim/lib/XenKvmLib/classes.py Thu Jun 19 10: 35:59 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py Wed Jun 25 12: 59:45 2008 -0700 @@ -23,7 +23,8 @@
def get_typed_class(virt, basename): if virt not in virt_types: - raise ValueError('Invalid class type') + if virt != "Virt" and basename != "MigrationJob": + raise ValueError('Invalid class type')
if basename == None or basename == '': raise ValueError('Invalide class base name') diff -r 5c90c9a2fd56 -r ef376bdad2e1 suites/libvirt- cim/lib/XenKvmLib/vsmigrations.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Thu Jun 19 10:35:59 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Wed Jun 25 12:59:45 2008 -0700 @@ -95,10 +95,10 @@ except Exception, details: logger.error("Error invoke method 'MigrateVirtualSystemToHost\'.") logger.error("%s", details) + return FAIL, ret
if len(ret) == 0: logger.error("MigrateVirtualSystemToHost returns an empty
Do you think we should also to call destroy_and_undefine_domain() below based on your patch? status, cs_ref = start_guest_get_ref(options.ip, dom_name) if status != PASS: + destroy_and_undefine_domain(dom_name, options.ip) return FAIL list")
- destroy_and_undefine_domain(test_dom, ip) return FAIL, ret
return PASS, ret
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

- destroy_and_undefine_domain(dom_name, options.ip) + destroy_and_undefine_domain(dom_name, options.ip)
return status
Do you think we should also to call destroy_and_undefine_domain() below based on your patch?
status, cs_ref = start_guest_get_ref(options.ip, dom_name) if status != PASS: + destroy_and_undefine_domain(dom_name, options.ip) return FAIL
start_guest_get_ref() calls destroy_and_undefine_domain() if an exception is encountered. This is also the only place the FAIL status is set in start_guest_get_ref(). However, the error checking in start_guest_get_ref() could be improved, so I'll resend. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
participants (2)
-
Guo Lian Yun
-
Kaitlin Rupert