test failed.
Please work with originator and resubmit the updated patch.


Sharad Mishra
Open Virtualization
Linux Technology Center
IBM

libvirt-cim-bounces@redhat.com wrote on 05/05/2011 06:25:36 PM:

> Chip Vincent <cvincent@linux.vnet.ibm.com>

> Sent by: libvirt-cim-bounces@redhat.com
>

> 05/05/2011 06:25 PM
>
> Please respond to
> List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>

>
> To

>
> libvirt-cim@redhat.com

>
> cc

>
> Subject

>
> [Libvirt-cim] [PATCH] (#2) Fix UUID in migration job lifecycle indications

>
> # HG changeset patch
> # User Chip Vincent <cvincent@us.ibm.com>
> # Date 1304034351 14400
> # Node ID 2f8763c53407a186968adf1edc9a2f2a1adbc00e
> # Parent  8b428df21c360d1eaedba7157b0dfd429d2db121
> (#2) Fix UUID in migration job lifecycle indications.
>
> Fixed the logic that fetches a VM UUID and adds it to the migration
> job's InstanceIdentifier property.
>
> Siged-off-by: Chip Vincent <cvincent@us.ibm.com>
>
> diff --git a/src/Virt_VSMigrationService.c b/src/Virt_VSMigrationService.c
> --- a/src/Virt_VSMigrationService.c
> +++ b/src/Virt_VSMigrationService.c
> @@ -812,15 +812,20 @@
>          CMPIInstance *ind = NULL;
>          CMPIInstance *prev_inst = NULL;
>          const char *pfx = NULL;
> +        virConnectPtr conn = NULL;
>          virDomainPtr dom = NULL;
>          char uuid[VIR_UUID_STRING_BUFLEN];
>          CMPIDateTime *timestamp = NULL;
>          
> +        conn = connect_by_classname(_BROKER, job->ref_cn, s);
> +        if(conn == NULL)
> +                goto out;
> +
>          ind_name = ind_type_to_name(ind_type);
>  
>          CU_DEBUG("Creating indication.");
>  
> -        pfx = pfx_from_conn(job->conn);
> +        pfx = pfx_from_conn(conn);
>  
>          ind = get_typed_instance(broker,
>                                   pfx,
> @@ -832,13 +837,15 @@
>                  goto out;
>          }
>          
> -        dom = virDomainLookupByName(job->conn, job->domain);
> -        if(dom == NULL) {
> -                CU_DEBUG("Failed to connect to domain %s", job->domain);
> +        timestamp = CMNewDateTime(broker, s);
> +        CMSetProperty(ind, "IndicationTime",
> +                (CMPIValue *)&timestamp, CMPI_dateTime);
> +        
> +        dom = virDomainLookupByName(conn, job->domain);
> +        if (dom == NULL)
>                  goto out;
> -        }
>  
> -        if(virDomainGetUUIDString(dom, uuid) != 0) {
> +        if (virDomainGetUUIDString(dom, uuid) != 0) {
>                  CU_DEBUG("Failed to get UUID from domain name");
>                  goto out;
>          }
> @@ -846,10 +853,6 @@
>          CMSetProperty(ind, "IndicationIdentifier",
>                  (CMPIValue *)uuid, CMPI_chars);
>  
> -        timestamp = CMNewDateTime(broker, s);
> -        CMSetProperty(ind, "IndicationTime",
> -                (CMPIValue *)&timestamp, CMPI_dateTime);
> -
>          if (ind_type == MIG_MODIFIED) {
>                  /* Need to copy job inst before attaching as
> PreviousInstance
>                     because otherwise the changes we are about to make to job
> @@ -867,6 +870,7 @@
>  
>   out:
>          virDomainFree(dom);
> +        virConnectClose(conn);
>          return ind;
>  }
>  
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim