<br><font size=2 face="sans-serif">+1 from me.</font>
<br>
<br><tt><font size=2>libvirt-cim-bounces@redhat.com wrote on 2008-07-02
04:39:25:<br>
<br>
> # HG changeset patch<br>
> # User Kaitlin Rupert <karupert@us.ibm.com><br>
> # Date 1214942997 25200<br>
> # Node ID da0aebe9e441c2a0020fad9d063c489026eee2b2<br>
> # Parent  0c3bd5f782c4776719799ad5c74226c95e70092e<br>
> [TEST] #2 A few migration related fixes.<br>
> <br>
> Fixes:<br>
>  -Remove destroy_and_undefine_domain() call from <br>
> migrate_guest_to_host().  This call takes the domain name as
a <br>
> parameter, but migrate_guest_to_host() doesn't take the domain name
<br>
> So calling destroy_and_undefine_domain() resulted in an error.<br>
>  -Add a hack to get_typed_class() so it supports Virt_MigrationJob
<br>
> (which doesn't fit the typical <virt>_<basename> pattern.<br>
> <br>
> Updates from 1 to 2:<br>
>   -Improve error catching / reporting in start_guest_get_ref()<br>
> <br>
> Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com><br>
> <br>
> diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-<br>
> cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py<br>
> --- a/suites/libvirt-<br>
> cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py  
<br>
> Fri Jun 27 09:57:11 2008 +0800<br>
> +++ b/suites/libvirt-<br>
> cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py  
<br>
> Tue Jul 01 13:09:57 2008 -0700<br>
> @@ -42,19 +42,26 @@<br>
>  def start_guest_get_ref(ip, guest_name):<br>
>      try:<br>
>          xmlfile = testxml(guest_name)  
<br>
> -        define_test_domain(xmlfile, ip)<br>
> +        ret = define_test_domain(xmlfile, ip)<br>
> +        if not ret:<br>
> +            return FAIL, None<br>
>  <br>
> -        start_test_domain(guest_name, ip)<br>
> +        ret = start_test_domain(guest_name, ip)<br>
> +        if not ret:<br>
> +            return FAIL, None<br>
> +<br>
>          time.sleep(10)<br>
>      except Exception:<br>
>          logger.error("Error creating
domain %s" % guest_name)<br>
> -        destroy_and_undefine_domain(guest_name,
options.ip)<br>
>          return FAIL, None<br>
>  <br>
>      classname = 'Xen_ComputerSystem'<br>
>      cs_ref = CIMInstanceName(classname, keybindings
= {<br>
>                    
                     'Name':guest_name,<br>
>                    
                     'CreationClassName':classname})<br>
> +<br>
> +    if cs_ref is None:<br>
> +        return FAIL, None<br>
>  <br>
>      return PASS, cs_ref<br>
>  <br>
> @@ -80,6 +87,7 @@<br>
>  <br>
>      status, cs_ref = start_guest_get_ref(options.ip,
dom_name)<br>
>      if status != PASS:<br>
> +        destroy_and_undefine_domain(guest_name,
options.ip)<br>
>          return FAIL<br>
>  <br>
>      guest_name = cs_ref['Name']<br>
> @@ -90,10 +98,10 @@<br>
>          return FAIL<br>
>  <br>
>      status, ret = migrate_guest_to_host(service, cs_ref,
target_ip)<br>
> -<br>
>      if status == FAIL:<br>
>          logger.error("MigrateVirtualSystemToHost:
unexpected list length %s"<br>
>                    
  % len(ret))<br>
> +        destroy_and_undefine_domain(dom_name,
options.ip)<br>
>          return status <br>
>      elif len(ret) == 2:<br>
>          id = ret[1]['Job'].keybindings['InstanceID']<br>
> @@ -102,7 +110,7 @@<br>
>                    
               guest_name, local_migrate)<br>
>  <br>
>  <br>
> -    destroy_and_undefine_domain(dom_name, options.ip)  
<br>
> +    destroy_and_undefine_domain(dom_name, options.ip)<br>
>  <br>
>      return status<br>
>  <br>
> diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-<br>
> cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py<br>
> --- a/suites/libvirt-<br>
> cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py
  <br>
> Fri Jun 27 09:57:11 2008 +0800<br>
> +++ b/suites/libvirt-<br>
> cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py
  <br>
> Tue Jul 01 13:09:57 2008 -0700<br>
> @@ -145,12 +145,11 @@<br>
>  <br>
>          logger.info("Migrating guest
with the following options:")<br>
>          logger.info("%s" % item)<br>
> -        status, ret = migrate_guest_to_host(service,
cs_ref, target_ip,<br>
> -                    
                     
 item)<br>
> -<br>
> +        status, ret = migrate_guest_to_host(service,
cs_ref, target_ip, item)<br>
>          if status == FAIL:<br>
>              logger.error("MigrateVirtualSystemToHost:
unexpected <br>
> list length %s"<br>
>                    
      % len(ret))<br>
> +            destroy_and_undefine_domain(dom_name,
options.ip)   <br>
>              return status <br>
>          elif len(ret) == 2:<br>
>              id = ret[1]['Job'].keybindings['InstanceID']<br>
> diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-<br>
> cim/lib/XenKvmLib/classes.py<br>
> --- a/suites/libvirt-cim/lib/XenKvmLib/classes.py   Fri Jun 27
09:<br>
> 57:11 2008 +0800<br>
> +++ b/suites/libvirt-cim/lib/XenKvmLib/classes.py   Tue Jul 01
13:<br>
> 09:57 2008 -0700<br>
> @@ -23,7 +23,8 @@<br>
>  <br>
>  def get_typed_class(virt, basename):<br>
>      if virt not in virt_types:<br>
> -        raise ValueError('Invalid class type')<br>
> +        if virt != "Virt" and basename
!= "MigrationJob":<br>
> +            raise ValueError('Invalid
class type')<br>
>  <br>
>      if basename == None or basename == '':<br>
>          raise ValueError('Invalide class
base name')<br>
> diff -r 0c3bd5f782c4 -r da0aebe9e441 suites/libvirt-<br>
> cim/lib/XenKvmLib/vsmigrations.py<br>
> --- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py   Fri
Jun 27 <br>
> 09:57:11 2008 +0800<br>
> +++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py   Tue
Jul 01 <br>
> 13:09:57 2008 -0700<br>
> @@ -95,10 +95,10 @@<br>
>      except Exception, details:<br>
>          logger.error("Error invoke
method 'MigrateVirtualSystemToHost\'.")<br>
>          logger.error("%s", details)<br>
> +        return FAIL, ret<br>
>  <br>
>      if len(ret) == 0:<br>
>          logger.error("MigrateVirtualSystemToHost
returns an empty list")<br>
> -        destroy_and_undefine_domain(test_dom,
ip)<br>
>          return FAIL, ret<br>
>  <br>
>      return PASS, ret<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> https://www.redhat.com/mailman/listinfo/libvirt-cim<br>
</font></tt>