<html><body>
<p>+1 <br>
<br>
Looks good, Tests passed.<br>
Except for this message - <tt>msg = "Failed to create graphics is string";</tt><br>
But I don't think we should  redo the patch just to fix this message.<br>
<br>
Regards,<br>
Sharad Mishra<br>
Open Virtualization<br>
Linux Technology Center<br>
IBM<br>
<br>
<tt>libvirt-cim-bounces@redhat.com wrote on 05/18/2011 01:33:29 PM:<br>
<br>
> Chip Vincent <cvincent@linux.vnet.ibm.com> </tt><br>
<tt>> Sent by: libvirt-cim-bounces@redhat.com<br>
> </tt><br>
<tt>> 05/18/2011 01:33 PM</tt><br>
<tt>> <br>
> Please respond to<br>
> List for discussion and development of libvirt CIM <libvirt-cim@redhat.com></tt><br>
<tt>> <br>
> To</tt><br>
<tt>> <br>
> libvirt-cim@redhat.com</tt><br>
<tt>> <br>
> cc</tt><br>
<tt>> <br>
> Subject</tt><br>
<tt>> <br>
> [Libvirt-cim] [PATCH] Fix for VirtualSystemManagementService/<br>
> 13_refconfig_additional_devs.py</tt><br>
<tt>> <br>
> # HG changeset patch<br>
> # User Chip Vincent <cvincent@us.ibm.com><br>
> # Date 1305746372 14400<br>
> # Node ID 7432d45a1fae6ef499f53a36e24b66df29bcf7f9<br>
> # Parent  90f8c9f2388e0563baa311c84024ca41a61e1890<br>
> Fix for VirtualSystemManagementService/13_refconfig_additional_devs.py<br>
> <br>
> The cimtest case was failing because libvirt-cim improperly <br>
> processed graphics devices present in the ReferenceClass parameter <br>
> in DefineSystem. Rather than overrdiing them, it was appending them.<br>
> With this patch, the test case now passes and the debug log shows <br>
> the following correct messages.<br>
> <br>
> Virt_VirtualSystemManagementService.c(1184): graphics = vnc<br>
> Virt_VirtualSystemManagementService.c(1326): Overriding device vnc <br>
> from refconf<br>
> <br>
> Signed-off-by: Chip Vincent <cvincent@us.ibm.com><br>
> <br>
> diff --git a/src/Virt_VirtualSystemManagementService.c b/src/<br>
> Virt_VirtualSystemManagementService.c<br>
> --- a/src/Virt_VirtualSystemManagementService.c<br>
> +++ b/src/Virt_VirtualSystemManagementService.c<br>
> @@ -1162,17 +1162,26 @@<br>
>                           msg = "GraphicsRASD field Address not valid";<br>
>                           goto out;<br>
>                  }<br>
> -       } else { <br>
> +        } else { <br>
>                  CU_DEBUG("Unsupported graphics type %s", <br>
>                          dev->dev.graphics.type);<br>
>                  msg = "Unsupported graphics type";<br>
>                  goto out;<br>
> -       }<br>
> -<br>
> -        CU_DEBUG("graphics = %s:%s:%s", <br>
> -                dev->dev.graphics.type,<br>
> -                dev->dev.graphics.host,<br>
> -                dev->dev.graphics.port);<br>
> +        }<br>
> +<br>
> +        free(dev->id);<br>
> +        if (STREQC(dev->dev.graphics.type, "vnc"))<br>
> +                ret = asprintf(&dev->id, "%s", dev->dev.graphics.type);<br>
> +        else<br>
> +                ret = asprintf(&dev->id, "%s:%s",<br>
> +                               dev->dev.graphics.type, <br>
> dev->dev.graphics.port);<br>
> +<br>
> +        if (ret == -1) {<br>
> +                msg = "Failed to create graphics is string";<br>
> +                goto out;<br>
> +        }<br>
> +<br>
> +        CU_DEBUG("graphics = %s", dev->id);<br>
>  <br>
>   out:<br>
>          return msg;<br>
> @@ -1313,9 +1322,6 @@<br>
>                                 "DiskResourceAllocationSettingData <br>
> in a single "<br>
>                                 "guest";<br>
>  <br>
> -                if (dev->type == CIM_RES_TYPE_GRAPHICS)<br>
> -                        continue;<br>
> -<br>
>                  if (STREQC(ptr->id, dev->id)) {<br>
>                          CU_DEBUG("Overriding device %s from <br>
> refconf", ptr->id);<br>
>                          cleanup_virt_device(ptr);<br>
> @@ -1425,7 +1431,7 @@<br>
>                                                         &domain->dev_net_ct);<br>
>                  } else if (type == CIM_RES_TYPE_GRAPHICS) {<br>
>                          struct virt_device dev;<br>
> -                        int ncount = count + domain->dev_graphics_ct;<br>
> +                        int gcount = count + domain->dev_graphics_ct;<br>
>  <br>
>                          memset(&dev, 0, sizeof(dev));<br>
>                          msg = rasd_to_vdev(inst,<br>
> @@ -1435,7 +1441,7 @@<br>
>                          if (msg == NULL)<br>
>                                  msg = add_device_nodup(&dev,<br>
>                                                  domain->dev_graphics,<br>
> -                                                ncount,<br>
> +                                                gcount,<br>
>                                                  &domain->dev_graphics_ct);<br>
>                  } else if (type == CIM_RES_TYPE_INPUT) {<br>
>                          domain->dev_input_ct = 1;<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-cim">https://www.redhat.com/mailman/listinfo/libvirt-cim</a><br>
</tt></body></html>