<html><body>
<p>Yes, You need to build both, libcmpiutil and libvirt-cim. <br>
<br>
Regards<br>
Sharad Mishra<br>
<br>
<br>
<tt>libvirt-cim-bounces@redhat.com wrote on 12/10/2010 04:55:00 PM:<br>
<br>
> Chip Vincent <cvincent@linux.vnet.ibm.com> </tt><br>
<tt>> Sent by: libvirt-cim-bounces@redhat.com<br>
> </tt><br>
<tt>> 12/10/2010 04:55 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>
> List for discussion and development of libvirt CIM <libvirt-cim@redhat.com></tt><br>
<tt>> <br>
> cc</tt><br>
<tt>> <br>
> Subject</tt><br>
<tt>> <br>
> Re: [Libvirt-cim] [PATCH] Patch to allow cdrom media change</tt><br>
<tt>> <br>
> It just occurred to me that we'll also need to update the libcmpiutil <br>
> version libvirt-cim depends on to properly build. Any problems with that?<br>
> <br>
> Chip<br>
> <br>
> Sharad Mishra wrote:<br>
> > # HG changeset patch<br>
> > # User Sharad Mishra <snmishra@us.ibm.com><br>
> > # Date 1291839626 28800<br>
> > # Node ID b52f1a92d324cb63a942e56ea99c6984c043e2a8<br>
> > # Parent  e82f482d4bd2eae19970f9b9a42caecaf46ebeab<br>
> > Patch to allow cdrom media change.<br>
> ><br>
> > This  patch allows VMs with  cdrom to change media from one iso to another.<br>
> > This  is equivalent to virsh command "virsh attach-disk <vm> <path<br>
> to iso file> hdc --type cdrom --mode readonly<br>
> > --driver file"<br>
> ><br>
> > Signed-off-by: Sharad Mishra <snmishra@us.ibm.com><br>
> ><br>
> > diff -r e82f482d4bd2 -r b52f1a92d324 libxkutil/device_parsing.c<br>
> > --- a/libxkutil/device_parsing.c   Tue Nov 30 13:33:45 2010 -0500<br>
> > +++ b/libxkutil/device_parsing.c   Wed Dec 08 12:20:26 2010 -0800<br>
> > @@ -1179,6 +1179,28 @@<br>
> ><br>
> >  }<br>
> ><br>
> > +static int change_disk(virDomainPtr dom,<br>
> > +                       struct virt_device *dev)<br>
> > +{<br>
> > +       <br>
> > +        char *xml = NULL;<br>
> > +        int ret = 0;<br>
> > +<br>
> > +        xml = device_to_xml(dev);<br>
> > +<br>
> > +        CU_DEBUG("New XML is %s", xml);<br>
> > +        <br>
> > +        if (virDomainAttachDevice(dom, xml) != 0) {<br>
> > +                goto out;<br>
> > +        }<br>
> > +<br>
> > +        ret = 1;<br>
> > + out:<br>
> > +        free(xml);<br>
> > +<br>
> > +        return ret;<br>
> > +}<br>
> > +<br>
> >  static int change_memory(virDomainPtr dom,<br>
> >                           struct virt_device *dev)<br>
> >  {<br>
> > @@ -1246,8 +1268,10 @@<br>
> >  {<br>
> >          if (dev->type == CIM_RES_TYPE_MEM)<br>
> >                  return change_memory(dom, dev);<br>
> > -        else if (dev->type == CIM_RES_TYPE_PROC)<br>
> > +        if (dev->type == CIM_RES_TYPE_PROC)<br>
> >                  return change_vcpus(dom, dev);<br>
> > +        if (dev->type == CIM_RES_TYPE_DISK)<br>
> > +                return change_disk(dom, dev) ;<br>
> ><br>
> >          CU_DEBUG("Unhandled device type %i", dev->type);<br>
> ><br>
> > diff -r e82f482d4bd2 -r b52f1a92d324 src/<br>
> Virt_VirtualSystemManagementService.c<br>
> > --- a/src/Virt_VirtualSystemManagementService.c   Tue Nov 30 13:<br>
> 33:45 2010 -0500<br>
> > +++ b/src/Virt_VirtualSystemManagementService.c   Wed Dec 08 12:<br>
> 20:26 2010 -0800<br>
> > @@ -836,6 +836,7 @@<br>
> >          const char *val = NULL;<br>
> >          uint16_t type;<br>
> ><br>
> > +        CU_DEBUG("Enter disk_rasd_to_vdev");<br>
> >          if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK)<br>
> >                  return "Missing `VirtualDevice' property";<br>
> ><br>
> > @@ -863,6 +864,8 @@<br>
> >                  dev->dev.disk.device = strdup("floppy");<br>
> >          else<br>
> >                  return "Invalid value for EmulatedType";<br>
> > +        <br>
> > +        CU_DEBUG("device type is %s", dev->dev.disk.device);<br>
> ><br>
> >          free(dev->dev.disk.bus_type);<br>
> >          if (cu_get_str_prop(inst, "BusType", &val) != CMPI_RC_OK) <br>
> > @@ -1411,6 +1414,7 @@<br>
> >          virConnectPtr conn = NULL;<br>
> >          virDomainPtr dom = NULL;<br>
> ><br>
> > +        CU_DEBUG("Enter update_dominfo");<br>
> >          if (dominfo->dev_vcpu_ct != 1) {<br>
> >                  /* Right now, we only have extra info for processors */<br>
> >                  CU_DEBUG("Domain has no vcpu devices!");<br>
> > @@ -1444,10 +1448,12 @@<br>
> >          infostore_set_u64(ctx, "limit", dev->dev.vcpu.limit);<br>
> ><br>
> >          dev = dominfo->dev_graphics;<br>
> > -        if (dev->dev.graphics.passwd != NULL)<br>
> > -                infostore_set_bool(ctx, "has_vnc_passwd", true);<br>
> > -        else<br>
> > -                infostore_set_bool(ctx, "has_vnc_passwd", false);<br>
> > +        if(dev != NULL){<br>
> > +                if (dev->dev.graphics.passwd != NULL)<br>
> > +                        infostore_set_bool(ctx, "has_vnc_passwd", true);<br>
> > +                else<br>
> > +                        infostore_set_bool(ctx, "has_vnc_passwd", false);<br>
> > +        }<br>
> ><br>
> >   out:<br>
> >          infostore_close(ctx);<br>
> > @@ -2068,6 +2074,7 @@<br>
> >          virDomainPtr dom;<br>
> >          int (*func)(virDomainPtr, struct virt_device *);<br>
> ><br>
> > +        CU_DEBUG("Enter _resource_dynamic");<br>
> >          if (action == RESOURCE_ADD)<br>
> >                  func = attach_device;<br>
> >          else if (action == RESOURCE_DEL)<br>
> > @@ -2292,6 +2299,7 @@<br>
> >          int i;<br>
> >          const char *msg = NULL;<br>
> ><br>
> > +        CU_DEBUG("Enter resource_mod");<br>
> >          if (devid == NULL) {<br>
> >                  cu_statusf(_BROKER, &s,<br>
> >                             CMPI_RC_ERR_INVALID_PARAMETER,<br>
> > @@ -2361,8 +2369,10 @@<br>
> >          const char *indication;<br>
> >          CMPIObjectPath *op;<br>
> >          struct inst_list list;<br>
> > -        CMPIInstance  *prev_inst = NULL;<br>
> > +        CMPIInstance *prev_inst = NULL;<br>
> > +        CMPIInstance *orig_inst = NULL;<br>
> ><br>
> > +        CU_DEBUG("Enter _update_resources_for");<br>
> >          inst_list_init(&list);<br>
> >          if (!get_dominfo(dom, &dominfo)) {<br>
> >                  virt_set_status(_BROKER, &s,<br>
> > @@ -2406,14 +2416,23 @@<br>
> >                                       dummy_name,<br>
> >                                       type,<br>
> >                                       NULL,<br>
> > -                                     &prev_inst);<br>
> > +                                     &orig_inst);<br>
> >                  free(dummy_name);<br>
> ><br>
> >                  if (s.rc != CMPI_RC_OK) {<br>
> >                          CU_DEBUG("Failed to get Previous Instance");<br>
> >                          goto out;<br>
> >                  }<br>
> > -        }<br>
> > +<br>
> > +                s = cu_merge_instances(rasd, orig_inst);<br>
> > +                if (s.rc != CMPI_RC_OK) {<br>
> > +                        CU_DEBUG("Failed to merge Instances");<br>
> > +                        goto out;<br>
> > +                }<br>
> > +                prev_inst = orig_inst;<br>
> > +                rasd = orig_inst;<br>
> > +        <br>
> > +        } <br>
> ><br>
> >          s = func(dominfo, rasd, type, devid, NAMESPACE(ref));<br>
> >          if (s.rc != CMPI_RC_OK) {<br>
> > @@ -2487,6 +2506,7 @@<br>
> >          int count;<br>
> >          uint32_t rc = CIM_SVPC_RETURN_FAILED;<br>
> ><br>
> > +        CU_DEBUG("Enter _update_resource_settings");<br>
> >          conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);<br>
> >          if (conn == NULL) {<br>
> >                  cu_statusf(_BROKER, &s,<br>
> > @@ -2731,6 +2751,7 @@<br>
> >          CMPIArray *res = NULL;<br>
> >          struct inst_list list;<br>
> ><br>
> > +        CU_DEBUG("Enter mod_resource_settings");<br>
> >          inst_list_init(&list);<br>
> ><br>
> >          if (cu_get_array_arg(argsin, "ResourceSettings", &arr) !=<br>
> CMPI_RC_OK) {<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>
> >   <br>
> <br>
> <br>
> -- <br>
> Chip Vincent<br>
> Open Virtualization, Linux Technology Center<br>
> IBM Systems & Technology Group<br>
> phone: 919-254-4482, T/L 444-4482<br>
> email: cvincent@us.ibm.com<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>
> <br>
</tt></body></html>