From cvincent at linux.vnet.ibm.com Wed Dec 8 18:32:17 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Wed, 08 Dec 2010 13:32:17 -0500 Subject: [Libvirt-cim] [PATCH] Add domain UUID and timestamp ComputerSystem and MigrationJob indications Message-ID: <4CFFCF31.10700@linux.vnet.ibm.com> # HG changeset patch # User Chip Vincent # Date 1291832982 18000 # Node ID 00c3b5396d9cd7c4396b8b72fdb09257a0328116 # Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab Add domain UUID and timestamp to ComputerSystem and MigrationJob Indications This patch allows clients to better correlate indications by domain and enables sequencing using the indication datetime. Signed-off-by: Chip Vincent diff -r e82f482d4bd2 -r 00c3b5396d9c src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Tue Nov 30 13:33:45 2010 -0500 +++ b/src/Virt_ComputerSystemIndication.c Wed Dec 08 13:29:42 2010 -0500 @@ -232,6 +232,8 @@ CMPIObjectPath *affected_op; CMPIObjectPath *ind_op; CMPIInstance *ind; + CMPIData uuid; + CMPIDateTime *timestamp; CMPIStatus s; bool ret = true; @@ -278,7 +280,15 @@ } CMSetNameSpace(affected_op, args->ns); - if (ind_type == CS_MODIFIED) { + uuid = CMGetProperty(affected_inst, "UUID", &s); + CMSetProperty(ind, "IndicationIdentifier", + (CMPIValue *)&uuid, CMPI_string); + + timestamp = CMNewDateTime(broker, &s); + CMSetProperty(ind, "IndicationTime", + (CMPIValue *)timestamp, CMPI_dateTime); + + if (ind_type == CS_MODIFIED) { CMSetProperty(ind, "PreviousInstance", (CMPIValue *)&prev_inst, CMPI_instance); } diff -r e82f482d4bd2 -r 00c3b5396d9c src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Nov 30 13:33:45 2010 -0500 +++ b/src/Virt_VSMigrationService.c Wed Dec 08 13:29:42 2010 -0500 @@ -811,8 +811,11 @@ CMPIInstance *ind = NULL; CMPIInstance *prev_inst = NULL; const char *pfx = NULL; - - ind_name = ind_type_to_name(ind_type); + virDomainPtr dom = NULL; + char uuid[VIR_UUID_STRING_BUFLEN]; + CMPIDateTime *timestamp = NULL; + + ind_name = ind_type_to_name(ind_type); CU_DEBUG("Creating indication."); @@ -827,6 +830,24 @@ job->ref_ns, pfx, ind_name); goto out; } + + dom = virDomainLookupByName(job->conn, job->domain); + if(dom == NULL) { + CU_DEBUG("Failed to connect to domain %s", job->domain); + goto out; + } + + if(virDomainGetUUIDString(dom, uuid) != 0) { + CU_DEBUG("Failed to get UUID from domain name"); + goto out; + } + + 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 @@ -844,6 +865,7 @@ } out: + virDomainFree(dom); return ind; } -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From snmishra at us.ibm.com Wed Dec 8 20:56:55 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 08 Dec 2010 20:56:55 -0000 Subject: [Libvirt-cim] [PATCH] Add method to merge RASDs Message-ID: <531f151df659f030fe4f.1291841815@elm3b217.beaverton.ibm.com> # HG changeset patch # User Sharad Mishra # Date 1291841067 28800 # Node ID 531f151df659f030fe4fab1f6663572af356935f # Parent f967d9432f317685981a5b8552f049a9b644a33f Add method to merge RASDs. This method will take two RASDs, src and dest, and merge the two into dest. Signed-off-by: Sharad Mishra diff -r f967d9432f31 -r 531f151df659 instance_util.c --- a/instance_util.c Wed Oct 06 09:31:05 2010 -0700 +++ b/instance_util.c Wed Dec 08 12:44:27 2010 -0800 @@ -253,6 +253,46 @@ return dest; } + +CMPIStatus cu_merge_instances(CMPIInstance *src, + CMPIInstance *dest) +{ + + int i; + int prop_count; + CMPIData data; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + CU_DEBUG("Merging instances"); + prop_count = CMGetPropertyCount(src, &s); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Could not get property count for merge"); + goto out; + } + + CU_DEBUG("Property count is %d", prop_count); + for (i = 0; i < prop_count; i++) { + CMPIString *prop; + const char *prop_name; + + data = CMGetPropertyAt(src, i, &prop, &s); + if (s.rc != CMPI_RC_OK) { + goto out; + } + + prop_name = CMGetCharPtr(prop); + + if(data.state == 0 ) { + CU_DEBUG("setting prop %s", prop_name); + CMSetProperty(dest, prop_name, + &(data.value), data.type); + } + } + + out: + return s; +} + const char *cu_classname_from_inst(CMPIInstance *inst) { const char *ret = NULL; diff -r f967d9432f31 -r 531f151df659 libcmpiutil.h --- a/libcmpiutil.h Wed Oct 06 09:31:05 2010 -0700 +++ b/libcmpiutil.h Wed Dec 08 12:44:27 2010 -0800 @@ -167,6 +167,17 @@ uint16_t *target); /** + * Merge src and dest instances to dest. + * + * @param src Source instance + * @param dest Destination instance + * @returns {CMPI_RC_OK, NULL} if success, CMPI_RC ERR_FAILED and + * error message otherwise + */ +CMPIStatus cu_merge_instances(CMPIInstance *src, + CMPIInstance *dest); + +/** * Create a copy of an instance * * @param src Source instance From snmishra at us.ibm.com Wed Dec 8 20:57:35 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 08 Dec 2010 20:57:35 -0000 Subject: [Libvirt-cim] [PATCH] Patch to allow cdrom media change Message-ID: # HG changeset patch # User Sharad Mishra # Date 1291839626 28800 # Node ID b52f1a92d324cb63a942e56ea99c6984c043e2a8 # Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab Patch to allow cdrom media change. This patch allows VMs with cdrom to change media from one iso to another. This is equivalent to virsh command "virsh attach-disk hdc --type cdrom --mode readonly --driver file" Signed-off-by: Sharad Mishra diff -r e82f482d4bd2 -r b52f1a92d324 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Tue Nov 30 13:33:45 2010 -0500 +++ b/libxkutil/device_parsing.c Wed Dec 08 12:20:26 2010 -0800 @@ -1179,6 +1179,28 @@ } +static int change_disk(virDomainPtr dom, + struct virt_device *dev) +{ + + char *xml = NULL; + int ret = 0; + + xml = device_to_xml(dev); + + CU_DEBUG("New XML is %s", xml); + + if (virDomainAttachDevice(dom, xml) != 0) { + goto out; + } + + ret = 1; + out: + free(xml); + + return ret; +} + static int change_memory(virDomainPtr dom, struct virt_device *dev) { @@ -1246,8 +1268,10 @@ { if (dev->type == CIM_RES_TYPE_MEM) return change_memory(dom, dev); - else if (dev->type == CIM_RES_TYPE_PROC) + if (dev->type == CIM_RES_TYPE_PROC) return change_vcpus(dom, dev); + if (dev->type == CIM_RES_TYPE_DISK) + return change_disk(dom, dev) ; CU_DEBUG("Unhandled device type %i", dev->type); diff -r e82f482d4bd2 -r b52f1a92d324 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Tue Nov 30 13:33:45 2010 -0500 +++ b/src/Virt_VirtualSystemManagementService.c Wed Dec 08 12:20:26 2010 -0800 @@ -836,6 +836,7 @@ const char *val = NULL; uint16_t type; + CU_DEBUG("Enter disk_rasd_to_vdev"); if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK) return "Missing `VirtualDevice' property"; @@ -863,6 +864,8 @@ dev->dev.disk.device = strdup("floppy"); else return "Invalid value for EmulatedType"; + + CU_DEBUG("device type is %s", dev->dev.disk.device); free(dev->dev.disk.bus_type); if (cu_get_str_prop(inst, "BusType", &val) != CMPI_RC_OK) @@ -1411,6 +1414,7 @@ virConnectPtr conn = NULL; virDomainPtr dom = NULL; + CU_DEBUG("Enter update_dominfo"); if (dominfo->dev_vcpu_ct != 1) { /* Right now, we only have extra info for processors */ CU_DEBUG("Domain has no vcpu devices!"); @@ -1444,10 +1448,12 @@ infostore_set_u64(ctx, "limit", dev->dev.vcpu.limit); dev = dominfo->dev_graphics; - if (dev->dev.graphics.passwd != NULL) - infostore_set_bool(ctx, "has_vnc_passwd", true); - else - infostore_set_bool(ctx, "has_vnc_passwd", false); + if(dev != NULL){ + if (dev->dev.graphics.passwd != NULL) + infostore_set_bool(ctx, "has_vnc_passwd", true); + else + infostore_set_bool(ctx, "has_vnc_passwd", false); + } out: infostore_close(ctx); @@ -2068,6 +2074,7 @@ virDomainPtr dom; int (*func)(virDomainPtr, struct virt_device *); + CU_DEBUG("Enter _resource_dynamic"); if (action == RESOURCE_ADD) func = attach_device; else if (action == RESOURCE_DEL) @@ -2292,6 +2299,7 @@ int i; const char *msg = NULL; + CU_DEBUG("Enter resource_mod"); if (devid == NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_INVALID_PARAMETER, @@ -2361,8 +2369,10 @@ const char *indication; CMPIObjectPath *op; struct inst_list list; - CMPIInstance *prev_inst = NULL; + CMPIInstance *prev_inst = NULL; + CMPIInstance *orig_inst = NULL; + CU_DEBUG("Enter _update_resources_for"); inst_list_init(&list); if (!get_dominfo(dom, &dominfo)) { virt_set_status(_BROKER, &s, @@ -2406,14 +2416,23 @@ dummy_name, type, NULL, - &prev_inst); + &orig_inst); free(dummy_name); if (s.rc != CMPI_RC_OK) { CU_DEBUG("Failed to get Previous Instance"); goto out; } - } + + s = cu_merge_instances(rasd, orig_inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Failed to merge Instances"); + goto out; + } + prev_inst = orig_inst; + rasd = orig_inst; + + } s = func(dominfo, rasd, type, devid, NAMESPACE(ref)); if (s.rc != CMPI_RC_OK) { @@ -2487,6 +2506,7 @@ int count; uint32_t rc = CIM_SVPC_RETURN_FAILED; + CU_DEBUG("Enter _update_resource_settings"); conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) { cu_statusf(_BROKER, &s, @@ -2731,6 +2751,7 @@ CMPIArray *res = NULL; struct inst_list list; + CU_DEBUG("Enter mod_resource_settings"); inst_list_init(&list); if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) { From snmishra at us.ibm.com Wed Dec 8 21:18:23 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 8 Dec 2010 13:18:23 -0800 Subject: [Libvirt-cim] [PATCH] Add domain UUID and timestamp ComputerSystem and MigrationJob indications In-Reply-To: <4CFFCF31.10700@linux.vnet.ibm.com> References: <4CFFCF31.10700@linux.vnet.ibm.com> Message-ID: Looks good. Just correct indentation. Use spaces instead of tabs. Thanks Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 12/08/2010 10:32:17 AM: > Chip Vincent > Sent by: libvirt-cim-bounces at redhat.com > > 12/08/2010 10:32 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > List for discussion and development of libvirt CIM > > cc > > Subject > > [Libvirt-cim] [PATCH] Add domain UUID and timestamp ComputerSystem > and MigrationJob indications > > # HG changeset patch > # User Chip Vincent > # Date 1291832982 18000 > # Node ID 00c3b5396d9cd7c4396b8b72fdb09257a0328116 > # Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab > Add domain UUID and timestamp to ComputerSystem and MigrationJob Indications > > This patch allows clients to better correlate indications by domain and > enables > sequencing using the indication datetime. > > Signed-off-by: Chip Vincent > > diff -r e82f482d4bd2 -r 00c3b5396d9c src/Virt_ComputerSystemIndication.c > --- a/src/Virt_ComputerSystemIndication.c Tue Nov 30 13:33:45 2010 > -0500 > +++ b/src/Virt_ComputerSystemIndication.c Wed Dec 08 13:29:42 2010 > -0500 > @@ -232,6 +232,8 @@ > CMPIObjectPath *affected_op; > CMPIObjectPath *ind_op; > CMPIInstance *ind; > + CMPIData uuid; > + CMPIDateTime *timestamp; > CMPIStatus s; > bool ret = true; > > @@ -278,7 +280,15 @@ > } > CMSetNameSpace(affected_op, args->ns); > > - if (ind_type == CS_MODIFIED) { > + uuid = CMGetProperty(affected_inst, "UUID", &s); > + CMSetProperty(ind, "IndicationIdentifier", > + (CMPIValue *)&uuid, CMPI_string); > + > + timestamp = CMNewDateTime(broker, &s); > + CMSetProperty(ind, "IndicationTime", > + (CMPIValue *)timestamp, CMPI_dateTime); > + > + if (ind_type == CS_MODIFIED) { > CMSetProperty(ind, "PreviousInstance", > (CMPIValue *)&prev_inst, CMPI_instance); > } > diff -r e82f482d4bd2 -r 00c3b5396d9c src/Virt_VSMigrationService.c > --- a/src/Virt_VSMigrationService.c Tue Nov 30 13:33:45 2010 -0500 > +++ b/src/Virt_VSMigrationService.c Wed Dec 08 13:29:42 2010 -0500 > @@ -811,8 +811,11 @@ > CMPIInstance *ind = NULL; > CMPIInstance *prev_inst = NULL; > const char *pfx = NULL; > - > - ind_name = ind_type_to_name(ind_type); > + virDomainPtr dom = NULL; > + char uuid[VIR_UUID_STRING_BUFLEN]; > + CMPIDateTime *timestamp = NULL; > + > + ind_name = ind_type_to_name(ind_type); > > CU_DEBUG("Creating indication."); > > @@ -827,6 +830,24 @@ > job->ref_ns, pfx, ind_name); > goto out; > } > + > + dom = virDomainLookupByName(job->conn, job->domain); > + if(dom == NULL) { > + CU_DEBUG("Failed to connect to domain %s", job->domain); > + goto out; > + } > + > + if(virDomainGetUUIDString(dom, uuid) != 0) { > + CU_DEBUG("Failed to get UUID from domain name"); > + goto out; > + } > + > + 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 > @@ -844,6 +865,7 @@ > } > > out: > + virDomainFree(dom); > return ind; > } > > > -- > Chip Vincent > Open Virtualization, Linux Technology Center > IBM Systems & Technology Group > phone: 919-254-4482, T/L 444-4482 > email: cvincent at us.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvincent at linux.vnet.ibm.com Sat Dec 11 00:37:23 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Fri, 10 Dec 2010 19:37:23 -0500 Subject: [Libvirt-cim] [PATCH] Add domain UUID and timestamp ComputerSystem and MigrationJob indications In-Reply-To: References: <4CFFCF31.10700@linux.vnet.ibm.com> Message-ID: <4D02C7C3.7030908@linux.vnet.ibm.com> Thanks. I neglected to update my .vimrc file on the new system. Fixed and pushed. Sharad Mishra wrote: > > Looks good. Just correct indentation. Use spaces instead of tabs. > > Thanks > Sharad Mishra > Open Virtualization > Linux Technology Center > IBM > > libvirt-cim-bounces at redhat.com wrote on 12/08/2010 10:32:17 AM: > > > Chip Vincent > > Sent by: libvirt-cim-bounces at redhat.com > > > > 12/08/2010 10:32 AM > > > > Please respond to > > List for discussion and development of libvirt CIM > > > > > To > > > > List for discussion and development of libvirt CIM > > > > > cc > > > > Subject > > > > [Libvirt-cim] [PATCH] Add domain UUID and timestamp ComputerSystem > > and MigrationJob indications > > > > # HG changeset patch > > # User Chip Vincent > > # Date 1291832982 18000 > > # Node ID 00c3b5396d9cd7c4396b8b72fdb09257a0328116 > > # Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab > > Add domain UUID and timestamp to ComputerSystem and MigrationJob > Indications > > > > This patch allows clients to better correlate indications by domain and > > enables > > sequencing using the indication datetime. > > > > Signed-off-by: Chip Vincent > > > > diff -r e82f482d4bd2 -r 00c3b5396d9c src/Virt_ComputerSystemIndication.c > > --- a/src/Virt_ComputerSystemIndication.c Tue Nov 30 13:33:45 > 2010 > > -0500 > > +++ b/src/Virt_ComputerSystemIndication.c Wed Dec 08 13:29:42 > 2010 > > -0500 > > @@ -232,6 +232,8 @@ > > CMPIObjectPath *affected_op; > > CMPIObjectPath *ind_op; > > CMPIInstance *ind; > > + CMPIData uuid; > > + CMPIDateTime *timestamp; > > CMPIStatus s; > > bool ret = true; > > > > @@ -278,7 +280,15 @@ > > } > > CMSetNameSpace(affected_op, args->ns); > > > > - if (ind_type == CS_MODIFIED) { > > + uuid = CMGetProperty(affected_inst, "UUID", &s); > > + CMSetProperty(ind, "IndicationIdentifier", > > + (CMPIValue *)&uuid, CMPI_string); > > + > > + timestamp = CMNewDateTime(broker, &s); > > + CMSetProperty(ind, "IndicationTime", > > + (CMPIValue *)timestamp, CMPI_dateTime); > > + > > + if (ind_type == CS_MODIFIED) { > > CMSetProperty(ind, "PreviousInstance", > > (CMPIValue *)&prev_inst, CMPI_instance); > > } > > diff -r e82f482d4bd2 -r 00c3b5396d9c src/Virt_VSMigrationService.c > > --- a/src/Virt_VSMigrationService.c Tue Nov 30 13:33:45 2010 -0500 > > +++ b/src/Virt_VSMigrationService.c Wed Dec 08 13:29:42 2010 -0500 > > @@ -811,8 +811,11 @@ > > CMPIInstance *ind = NULL; > > CMPIInstance *prev_inst = NULL; > > const char *pfx = NULL; > > - > > - ind_name = ind_type_to_name(ind_type); > > + virDomainPtr dom = NULL; > > + char uuid[VIR_UUID_STRING_BUFLEN]; > > + CMPIDateTime *timestamp = NULL; > > + > > + ind_name = ind_type_to_name(ind_type); > > > > CU_DEBUG("Creating indication."); > > > > @@ -827,6 +830,24 @@ > > job->ref_ns, pfx, ind_name); > > goto out; > > } > > + > > + dom = virDomainLookupByName(job->conn, job->domain); > > + if(dom == NULL) { > > + CU_DEBUG("Failed to connect to domain %s", job->domain); > > + goto out; > > + } > > + > > + if(virDomainGetUUIDString(dom, uuid) != 0) { > > + CU_DEBUG("Failed to get UUID from domain name"); > > + goto out; > > + } > > + > > + 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 > > @@ -844,6 +865,7 @@ > > } > > > > out: > > + virDomainFree(dom); > > return ind; > > } > > > > > > -- > > Chip Vincent > > Open Virtualization, Linux Technology Center > > IBM Systems & Technology Group > > phone: 919-254-4482, T/L 444-4482 > > email: cvincent at us.ibm.com > > > > _______________________________________________ > > Libvirt-cim mailing list > > Libvirt-cim at redhat.com > > https://www.redhat.com/mailman/listinfo/libvirt-cim > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From cvincent at linux.vnet.ibm.com Sat Dec 11 00:42:36 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Fri, 10 Dec 2010 19:42:36 -0500 Subject: [Libvirt-cim] [PATCH] Patch to allow cdrom media change In-Reply-To: References: Message-ID: <4D02C8FC.5070707@linux.vnet.ibm.com> +1. Sharad Mishra wrote: > # HG changeset patch > # User Sharad Mishra > # Date 1291839626 28800 > # Node ID b52f1a92d324cb63a942e56ea99c6984c043e2a8 > # Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab > Patch to allow cdrom media change. > > This patch allows VMs with cdrom to change media from one iso to another. > This is equivalent to virsh command "virsh attach-disk hdc --type cdrom --mode readonly > --driver file" > > Signed-off-by: Sharad Mishra > > diff -r e82f482d4bd2 -r b52f1a92d324 libxkutil/device_parsing.c > --- a/libxkutil/device_parsing.c Tue Nov 30 13:33:45 2010 -0500 > +++ b/libxkutil/device_parsing.c Wed Dec 08 12:20:26 2010 -0800 > @@ -1179,6 +1179,28 @@ > > } > > +static int change_disk(virDomainPtr dom, > + struct virt_device *dev) > +{ > + > + char *xml = NULL; > + int ret = 0; > + > + xml = device_to_xml(dev); > + > + CU_DEBUG("New XML is %s", xml); > + > + if (virDomainAttachDevice(dom, xml) != 0) { > + goto out; > + } > + > + ret = 1; > + out: > + free(xml); > + > + return ret; > +} > + > static int change_memory(virDomainPtr dom, > struct virt_device *dev) > { > @@ -1246,8 +1268,10 @@ > { > if (dev->type == CIM_RES_TYPE_MEM) > return change_memory(dom, dev); > - else if (dev->type == CIM_RES_TYPE_PROC) > + if (dev->type == CIM_RES_TYPE_PROC) > return change_vcpus(dom, dev); > + if (dev->type == CIM_RES_TYPE_DISK) > + return change_disk(dom, dev) ; > > CU_DEBUG("Unhandled device type %i", dev->type); > > diff -r e82f482d4bd2 -r b52f1a92d324 src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Tue Nov 30 13:33:45 2010 -0500 > +++ b/src/Virt_VirtualSystemManagementService.c Wed Dec 08 12:20:26 2010 -0800 > @@ -836,6 +836,7 @@ > const char *val = NULL; > uint16_t type; > > + CU_DEBUG("Enter disk_rasd_to_vdev"); > if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK) > return "Missing `VirtualDevice' property"; > > @@ -863,6 +864,8 @@ > dev->dev.disk.device = strdup("floppy"); > else > return "Invalid value for EmulatedType"; > + > + CU_DEBUG("device type is %s", dev->dev.disk.device); > > free(dev->dev.disk.bus_type); > if (cu_get_str_prop(inst, "BusType", &val) != CMPI_RC_OK) > @@ -1411,6 +1414,7 @@ > virConnectPtr conn = NULL; > virDomainPtr dom = NULL; > > + CU_DEBUG("Enter update_dominfo"); > if (dominfo->dev_vcpu_ct != 1) { > /* Right now, we only have extra info for processors */ > CU_DEBUG("Domain has no vcpu devices!"); > @@ -1444,10 +1448,12 @@ > infostore_set_u64(ctx, "limit", dev->dev.vcpu.limit); > > dev = dominfo->dev_graphics; > - if (dev->dev.graphics.passwd != NULL) > - infostore_set_bool(ctx, "has_vnc_passwd", true); > - else > - infostore_set_bool(ctx, "has_vnc_passwd", false); > + if(dev != NULL){ > + if (dev->dev.graphics.passwd != NULL) > + infostore_set_bool(ctx, "has_vnc_passwd", true); > + else > + infostore_set_bool(ctx, "has_vnc_passwd", false); > + } > > out: > infostore_close(ctx); > @@ -2068,6 +2074,7 @@ > virDomainPtr dom; > int (*func)(virDomainPtr, struct virt_device *); > > + CU_DEBUG("Enter _resource_dynamic"); > if (action == RESOURCE_ADD) > func = attach_device; > else if (action == RESOURCE_DEL) > @@ -2292,6 +2299,7 @@ > int i; > const char *msg = NULL; > > + CU_DEBUG("Enter resource_mod"); > if (devid == NULL) { > cu_statusf(_BROKER, &s, > CMPI_RC_ERR_INVALID_PARAMETER, > @@ -2361,8 +2369,10 @@ > const char *indication; > CMPIObjectPath *op; > struct inst_list list; > - CMPIInstance *prev_inst = NULL; > + CMPIInstance *prev_inst = NULL; > + CMPIInstance *orig_inst = NULL; > > + CU_DEBUG("Enter _update_resources_for"); > inst_list_init(&list); > if (!get_dominfo(dom, &dominfo)) { > virt_set_status(_BROKER, &s, > @@ -2406,14 +2416,23 @@ > dummy_name, > type, > NULL, > - &prev_inst); > + &orig_inst); > free(dummy_name); > > if (s.rc != CMPI_RC_OK) { > CU_DEBUG("Failed to get Previous Instance"); > goto out; > } > - } > + > + s = cu_merge_instances(rasd, orig_inst); > + if (s.rc != CMPI_RC_OK) { > + CU_DEBUG("Failed to merge Instances"); > + goto out; > + } > + prev_inst = orig_inst; > + rasd = orig_inst; > + > + } > > s = func(dominfo, rasd, type, devid, NAMESPACE(ref)); > if (s.rc != CMPI_RC_OK) { > @@ -2487,6 +2506,7 @@ > int count; > uint32_t rc = CIM_SVPC_RETURN_FAILED; > > + CU_DEBUG("Enter _update_resource_settings"); > conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > if (conn == NULL) { > cu_statusf(_BROKER, &s, > @@ -2731,6 +2751,7 @@ > CMPIArray *res = NULL; > struct inst_list list; > > + CU_DEBUG("Enter mod_resource_settings"); > inst_list_init(&list); > > if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) { > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From cvincent at linux.vnet.ibm.com Sat Dec 11 00:48:39 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Fri, 10 Dec 2010 19:48:39 -0500 Subject: [Libvirt-cim] [PATCH] Add method to merge RASDs In-Reply-To: <531f151df659f030fe4f.1291841815@elm3b217.beaverton.ibm.com> References: <531f151df659f030fe4f.1291841815@elm3b217.beaverton.ibm.com> Message-ID: <4D02CA67.4080106@linux.vnet.ibm.com> +1 and pushed. Sharad Mishra wrote: > # HG changeset patch > # User Sharad Mishra > # Date 1291841067 28800 > # Node ID 531f151df659f030fe4fab1f6663572af356935f > # Parent f967d9432f317685981a5b8552f049a9b644a33f > Add method to merge RASDs. > > This method will take two RASDs, src and dest, and merge the two into dest. > > Signed-off-by: Sharad Mishra > > diff -r f967d9432f31 -r 531f151df659 instance_util.c > --- a/instance_util.c Wed Oct 06 09:31:05 2010 -0700 > +++ b/instance_util.c Wed Dec 08 12:44:27 2010 -0800 > @@ -253,6 +253,46 @@ > return dest; > } > > + > +CMPIStatus cu_merge_instances(CMPIInstance *src, > + CMPIInstance *dest) > +{ > + > + int i; > + int prop_count; > + CMPIData data; > + CMPIStatus s = {CMPI_RC_OK, NULL}; > + > + CU_DEBUG("Merging instances"); > + prop_count = CMGetPropertyCount(src, &s); > + if (s.rc != CMPI_RC_OK) { > + CU_DEBUG("Could not get property count for merge"); > + goto out; > + } > + > + CU_DEBUG("Property count is %d", prop_count); > + for (i = 0; i < prop_count; i++) { > + CMPIString *prop; > + const char *prop_name; > + > + data = CMGetPropertyAt(src, i, &prop, &s); > + if (s.rc != CMPI_RC_OK) { > + goto out; > + } > + > + prop_name = CMGetCharPtr(prop); > + > + if(data.state == 0 ) { > + CU_DEBUG("setting prop %s", prop_name); > + CMSetProperty(dest, prop_name, > + &(data.value), data.type); > + } > + } > + > + out: > + return s; > +} > + > const char *cu_classname_from_inst(CMPIInstance *inst) > { > const char *ret = NULL; > diff -r f967d9432f31 -r 531f151df659 libcmpiutil.h > --- a/libcmpiutil.h Wed Oct 06 09:31:05 2010 -0700 > +++ b/libcmpiutil.h Wed Dec 08 12:44:27 2010 -0800 > @@ -167,6 +167,17 @@ > uint16_t *target); > > /** > + * Merge src and dest instances to dest. > + * > + * @param src Source instance > + * @param dest Destination instance > + * @returns {CMPI_RC_OK, NULL} if success, CMPI_RC ERR_FAILED and > + * error message otherwise > + */ > +CMPIStatus cu_merge_instances(CMPIInstance *src, > + CMPIInstance *dest); > + > +/** > * Create a copy of an instance > * > * @param src Source instance > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From cvincent at linux.vnet.ibm.com Sat Dec 11 00:55:00 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Fri, 10 Dec 2010 19:55:00 -0500 Subject: [Libvirt-cim] [PATCH] Patch to allow cdrom media change In-Reply-To: References: Message-ID: <4D02CBE4.4070406@linux.vnet.ibm.com> It just occurred to me that we'll also need to update the libcmpiutil version libvirt-cim depends on to properly build. Any problems with that? Chip Sharad Mishra wrote: > # HG changeset patch > # User Sharad Mishra > # Date 1291839626 28800 > # Node ID b52f1a92d324cb63a942e56ea99c6984c043e2a8 > # Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab > Patch to allow cdrom media change. > > This patch allows VMs with cdrom to change media from one iso to another. > This is equivalent to virsh command "virsh attach-disk hdc --type cdrom --mode readonly > --driver file" > > Signed-off-by: Sharad Mishra > > diff -r e82f482d4bd2 -r b52f1a92d324 libxkutil/device_parsing.c > --- a/libxkutil/device_parsing.c Tue Nov 30 13:33:45 2010 -0500 > +++ b/libxkutil/device_parsing.c Wed Dec 08 12:20:26 2010 -0800 > @@ -1179,6 +1179,28 @@ > > } > > +static int change_disk(virDomainPtr dom, > + struct virt_device *dev) > +{ > + > + char *xml = NULL; > + int ret = 0; > + > + xml = device_to_xml(dev); > + > + CU_DEBUG("New XML is %s", xml); > + > + if (virDomainAttachDevice(dom, xml) != 0) { > + goto out; > + } > + > + ret = 1; > + out: > + free(xml); > + > + return ret; > +} > + > static int change_memory(virDomainPtr dom, > struct virt_device *dev) > { > @@ -1246,8 +1268,10 @@ > { > if (dev->type == CIM_RES_TYPE_MEM) > return change_memory(dom, dev); > - else if (dev->type == CIM_RES_TYPE_PROC) > + if (dev->type == CIM_RES_TYPE_PROC) > return change_vcpus(dom, dev); > + if (dev->type == CIM_RES_TYPE_DISK) > + return change_disk(dom, dev) ; > > CU_DEBUG("Unhandled device type %i", dev->type); > > diff -r e82f482d4bd2 -r b52f1a92d324 src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Tue Nov 30 13:33:45 2010 -0500 > +++ b/src/Virt_VirtualSystemManagementService.c Wed Dec 08 12:20:26 2010 -0800 > @@ -836,6 +836,7 @@ > const char *val = NULL; > uint16_t type; > > + CU_DEBUG("Enter disk_rasd_to_vdev"); > if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK) > return "Missing `VirtualDevice' property"; > > @@ -863,6 +864,8 @@ > dev->dev.disk.device = strdup("floppy"); > else > return "Invalid value for EmulatedType"; > + > + CU_DEBUG("device type is %s", dev->dev.disk.device); > > free(dev->dev.disk.bus_type); > if (cu_get_str_prop(inst, "BusType", &val) != CMPI_RC_OK) > @@ -1411,6 +1414,7 @@ > virConnectPtr conn = NULL; > virDomainPtr dom = NULL; > > + CU_DEBUG("Enter update_dominfo"); > if (dominfo->dev_vcpu_ct != 1) { > /* Right now, we only have extra info for processors */ > CU_DEBUG("Domain has no vcpu devices!"); > @@ -1444,10 +1448,12 @@ > infostore_set_u64(ctx, "limit", dev->dev.vcpu.limit); > > dev = dominfo->dev_graphics; > - if (dev->dev.graphics.passwd != NULL) > - infostore_set_bool(ctx, "has_vnc_passwd", true); > - else > - infostore_set_bool(ctx, "has_vnc_passwd", false); > + if(dev != NULL){ > + if (dev->dev.graphics.passwd != NULL) > + infostore_set_bool(ctx, "has_vnc_passwd", true); > + else > + infostore_set_bool(ctx, "has_vnc_passwd", false); > + } > > out: > infostore_close(ctx); > @@ -2068,6 +2074,7 @@ > virDomainPtr dom; > int (*func)(virDomainPtr, struct virt_device *); > > + CU_DEBUG("Enter _resource_dynamic"); > if (action == RESOURCE_ADD) > func = attach_device; > else if (action == RESOURCE_DEL) > @@ -2292,6 +2299,7 @@ > int i; > const char *msg = NULL; > > + CU_DEBUG("Enter resource_mod"); > if (devid == NULL) { > cu_statusf(_BROKER, &s, > CMPI_RC_ERR_INVALID_PARAMETER, > @@ -2361,8 +2369,10 @@ > const char *indication; > CMPIObjectPath *op; > struct inst_list list; > - CMPIInstance *prev_inst = NULL; > + CMPIInstance *prev_inst = NULL; > + CMPIInstance *orig_inst = NULL; > > + CU_DEBUG("Enter _update_resources_for"); > inst_list_init(&list); > if (!get_dominfo(dom, &dominfo)) { > virt_set_status(_BROKER, &s, > @@ -2406,14 +2416,23 @@ > dummy_name, > type, > NULL, > - &prev_inst); > + &orig_inst); > free(dummy_name); > > if (s.rc != CMPI_RC_OK) { > CU_DEBUG("Failed to get Previous Instance"); > goto out; > } > - } > + > + s = cu_merge_instances(rasd, orig_inst); > + if (s.rc != CMPI_RC_OK) { > + CU_DEBUG("Failed to merge Instances"); > + goto out; > + } > + prev_inst = orig_inst; > + rasd = orig_inst; > + > + } > > s = func(dominfo, rasd, type, devid, NAMESPACE(ref)); > if (s.rc != CMPI_RC_OK) { > @@ -2487,6 +2506,7 @@ > int count; > uint32_t rc = CIM_SVPC_RETURN_FAILED; > > + CU_DEBUG("Enter _update_resource_settings"); > conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > if (conn == NULL) { > cu_statusf(_BROKER, &s, > @@ -2731,6 +2751,7 @@ > CMPIArray *res = NULL; > struct inst_list list; > > + CU_DEBUG("Enter mod_resource_settings"); > inst_list_init(&list); > > if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) { > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From snmishra at us.ibm.com Mon Dec 13 15:56:33 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Mon, 13 Dec 2010 07:56:33 -0800 Subject: [Libvirt-cim] [PATCH] Patch to allow cdrom media change In-Reply-To: <4D02CBE4.4070406@linux.vnet.ibm.com> References: <4D02CBE4.4070406@linux.vnet.ibm.com> Message-ID: Yes, You need to build both, libcmpiutil and libvirt-cim. Regards Sharad Mishra libvirt-cim-bounces at redhat.com wrote on 12/10/2010 04:55:00 PM: > Chip Vincent > Sent by: libvirt-cim-bounces at redhat.com > > 12/10/2010 04:55 PM > > Please respond to > List for discussion and development of libvirt CIM > > To > > List for discussion and development of libvirt CIM > > cc > > Subject > > Re: [Libvirt-cim] [PATCH] Patch to allow cdrom media change > > It just occurred to me that we'll also need to update the libcmpiutil > version libvirt-cim depends on to properly build. Any problems with that? > > Chip > > Sharad Mishra wrote: > > # HG changeset patch > > # User Sharad Mishra > > # Date 1291839626 28800 > > # Node ID b52f1a92d324cb63a942e56ea99c6984c043e2a8 > > # Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab > > Patch to allow cdrom media change. > > > > This patch allows VMs with cdrom to change media from one iso to another. > > This is equivalent to virsh command "virsh attach-disk to iso file> hdc --type cdrom --mode readonly > > --driver file" > > > > Signed-off-by: Sharad Mishra > > > > diff -r e82f482d4bd2 -r b52f1a92d324 libxkutil/device_parsing.c > > --- a/libxkutil/device_parsing.c Tue Nov 30 13:33:45 2010 -0500 > > +++ b/libxkutil/device_parsing.c Wed Dec 08 12:20:26 2010 -0800 > > @@ -1179,6 +1179,28 @@ > > > > } > > > > +static int change_disk(virDomainPtr dom, > > + struct virt_device *dev) > > +{ > > + > > + char *xml = NULL; > > + int ret = 0; > > + > > + xml = device_to_xml(dev); > > + > > + CU_DEBUG("New XML is %s", xml); > > + > > + if (virDomainAttachDevice(dom, xml) != 0) { > > + goto out; > > + } > > + > > + ret = 1; > > + out: > > + free(xml); > > + > > + return ret; > > +} > > + > > static int change_memory(virDomainPtr dom, > > struct virt_device *dev) > > { > > @@ -1246,8 +1268,10 @@ > > { > > if (dev->type == CIM_RES_TYPE_MEM) > > return change_memory(dom, dev); > > - else if (dev->type == CIM_RES_TYPE_PROC) > > + if (dev->type == CIM_RES_TYPE_PROC) > > return change_vcpus(dom, dev); > > + if (dev->type == CIM_RES_TYPE_DISK) > > + return change_disk(dom, dev) ; > > > > CU_DEBUG("Unhandled device type %i", dev->type); > > > > diff -r e82f482d4bd2 -r b52f1a92d324 src/ > Virt_VirtualSystemManagementService.c > > --- a/src/Virt_VirtualSystemManagementService.c Tue Nov 30 13: > 33:45 2010 -0500 > > +++ b/src/Virt_VirtualSystemManagementService.c Wed Dec 08 12: > 20:26 2010 -0800 > > @@ -836,6 +836,7 @@ > > const char *val = NULL; > > uint16_t type; > > > > + CU_DEBUG("Enter disk_rasd_to_vdev"); > > if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK) > > return "Missing `VirtualDevice' property"; > > > > @@ -863,6 +864,8 @@ > > dev->dev.disk.device = strdup("floppy"); > > else > > return "Invalid value for EmulatedType"; > > + > > + CU_DEBUG("device type is %s", dev->dev.disk.device); > > > > free(dev->dev.disk.bus_type); > > if (cu_get_str_prop(inst, "BusType", &val) != CMPI_RC_OK) > > @@ -1411,6 +1414,7 @@ > > virConnectPtr conn = NULL; > > virDomainPtr dom = NULL; > > > > + CU_DEBUG("Enter update_dominfo"); > > if (dominfo->dev_vcpu_ct != 1) { > > /* Right now, we only have extra info for processors */ > > CU_DEBUG("Domain has no vcpu devices!"); > > @@ -1444,10 +1448,12 @@ > > infostore_set_u64(ctx, "limit", dev->dev.vcpu.limit); > > > > dev = dominfo->dev_graphics; > > - if (dev->dev.graphics.passwd != NULL) > > - infostore_set_bool(ctx, "has_vnc_passwd", true); > > - else > > - infostore_set_bool(ctx, "has_vnc_passwd", false); > > + if(dev != NULL){ > > + if (dev->dev.graphics.passwd != NULL) > > + infostore_set_bool(ctx, "has_vnc_passwd", true); > > + else > > + infostore_set_bool(ctx, "has_vnc_passwd", false); > > + } > > > > out: > > infostore_close(ctx); > > @@ -2068,6 +2074,7 @@ > > virDomainPtr dom; > > int (*func)(virDomainPtr, struct virt_device *); > > > > + CU_DEBUG("Enter _resource_dynamic"); > > if (action == RESOURCE_ADD) > > func = attach_device; > > else if (action == RESOURCE_DEL) > > @@ -2292,6 +2299,7 @@ > > int i; > > const char *msg = NULL; > > > > + CU_DEBUG("Enter resource_mod"); > > if (devid == NULL) { > > cu_statusf(_BROKER, &s, > > CMPI_RC_ERR_INVALID_PARAMETER, > > @@ -2361,8 +2369,10 @@ > > const char *indication; > > CMPIObjectPath *op; > > struct inst_list list; > > - CMPIInstance *prev_inst = NULL; > > + CMPIInstance *prev_inst = NULL; > > + CMPIInstance *orig_inst = NULL; > > > > + CU_DEBUG("Enter _update_resources_for"); > > inst_list_init(&list); > > if (!get_dominfo(dom, &dominfo)) { > > virt_set_status(_BROKER, &s, > > @@ -2406,14 +2416,23 @@ > > dummy_name, > > type, > > NULL, > > - &prev_inst); > > + &orig_inst); > > free(dummy_name); > > > > if (s.rc != CMPI_RC_OK) { > > CU_DEBUG("Failed to get Previous Instance"); > > goto out; > > } > > - } > > + > > + s = cu_merge_instances(rasd, orig_inst); > > + if (s.rc != CMPI_RC_OK) { > > + CU_DEBUG("Failed to merge Instances"); > > + goto out; > > + } > > + prev_inst = orig_inst; > > + rasd = orig_inst; > > + > > + } > > > > s = func(dominfo, rasd, type, devid, NAMESPACE(ref)); > > if (s.rc != CMPI_RC_OK) { > > @@ -2487,6 +2506,7 @@ > > int count; > > uint32_t rc = CIM_SVPC_RETURN_FAILED; > > > > + CU_DEBUG("Enter _update_resource_settings"); > > conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > > if (conn == NULL) { > > cu_statusf(_BROKER, &s, > > @@ -2731,6 +2751,7 @@ > > CMPIArray *res = NULL; > > struct inst_list list; > > > > + CU_DEBUG("Enter mod_resource_settings"); > > inst_list_init(&list); > > > > if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != > CMPI_RC_OK) { > > > > _______________________________________________ > > Libvirt-cim mailing list > > Libvirt-cim at redhat.com > > https://www.redhat.com/mailman/listinfo/libvirt-cim > > > > > -- > Chip Vincent > Open Virtualization, Linux Technology Center > IBM Systems & Technology Group > phone: 919-254-4482, T/L 444-4482 > email: cvincent at us.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvincent at linux.vnet.ibm.com Mon Dec 13 17:38:36 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Mon, 13 Dec 2010 12:38:36 -0500 Subject: [Libvirt-cim] compiling/linking under debian/ubuntu In-Reply-To: <4CEEF253.3090302@chaoslayer.de> References: <4CEEF253.3090302@chaoslayer.de> Message-ID: <4D065A1C.1080700@linux.vnet.ibm.com> If you can include some information about the distro and version you are using, I can try to reproduce and attempt to give you some pointers to resolve. Ancoron Luciferis wrote: > Hi *, > > I'm currently trying to figure out how to build and install libvirt-cim > on one of my Ubuntu boxes. > > I have all requirements met but during 'make install' I get this: > > /usr/bin/ld: cannot find -lVirt_VirtualSystemSnapshotService > collect2: ld returned 1 exit status > libtool: install: error: relink `libVirt_ComputerSystem.la' with the > above command before installing it > make[3]: *** [install-providerLTLIBRARIES] Error 1 > > > Well, the mentioned library is there: > > src/.libs/libVirt_VirtualSystemSnapshotService.a > src/.libs/libVirt_VirtualSystemSnapshotService.la > src/.libs/libVirt_VirtualSystemSnapshotService.lai > src/.libs/libVirt_VirtualSystemSnapshotService.so > src/.libs/libVirt_VirtualSystemSnapshotService.so.0 > src/.libs/libVirt_VirtualSystemSnapshotService.so.0.0.0 > > > Could someone help me with that as I'm not that familiar with the > details of shared library linking yet. > > I attached a full output of: > > make preinstall > make > sudo make install > > > Thanx in advance, > > Ancoron > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From snmishra at us.ibm.com Tue Dec 14 19:33:09 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Tue, 14 Dec 2010 11:33:09 -0800 Subject: [Libvirt-cim] dormant vs suspended operating status In-Reply-To: <4D06EC43.3000200@linux.vnet.ibm.com> References: <4D06EC43.3000200@linux.vnet.ibm.com> Message-ID: Hi, Libvirt-cim marks a VM suspended if it is either shutoff (VIR_DOMAIN_SHUTOFF) or crashed (VIR_DOMAIN_CRASHED) and a snapshot image is saved. A domain is marked dormant when it is blocked (VIR_DOMAIN_BLOCKED) or paused (VIR_DOMAIN_PAUSED). Regards, Sharad Mishra > -------- Original Message -------- > Subject: [Libvirt-cim] dormant vs suspended operating status > Date: Fri, 24 Sep 2010 16:10:35 -0500 > From: Yee Ja > Reply-To: List for discussion and development of libvirt CIM > > To: libvirt-cim at redhat.com > > > > For KVM, is there any difference between a virtual machine with an > operating status of dormant vs suspended, in terms of what functionality > is available to run against the virtual machine? It seems as if dormant > is the same as suspended, but I haven't read any documentation which > specifically indicates such.... > > Thanks > > > -- > Chip Vincent > Open Virtualization, Linux Technology Center > IBM Systems & Technology Group > phone: 919-254-4482, T/L 444-4482 > email: cvincent at us.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From snmishra at us.ibm.com Tue Dec 14 22:01:20 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Tue, 14 Dec 2010 22:01:20 -0000 Subject: [Libvirt-cim] [PATCH] Fix to support domain name with space Message-ID: <35396e5b805193c024b6.1292364080@elm3b217.beaverton.ibm.com> # HG changeset patch # User Sharad Mishra # Date 1292363991 28800 # Node ID 35396e5b805193c024b6d4f065136d7b57a0b03d # Parent 8c322e30cabbf9e62cbae06e5566fc1662ad539c Fix to support domain name with space. Libvirt-cim was failing to correctly parse domain names that had whitespace in between. For example, domain "test domain", would get parsed as just "test". Signed-off-by: Sharad Mishra diff -r 8c322e30cabb -r 35396e5b8051 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Dec 08 12:20:26 2010 -0800 +++ b/libxkutil/misc_util.c Tue Dec 14 13:59:51 2010 -0800 @@ -448,7 +448,7 @@ char *tmp_pfx = NULL; char *tmp_name = NULL; - ret = sscanf(id, "%a[^:]:%as", &tmp_pfx, &tmp_name); + ret = sscanf(id, "%a[^:]:%a[^\n]", &tmp_pfx, &tmp_name); if (ret != 2) { ret = 0; goto out; From cvincent at linux.vnet.ibm.com Wed Dec 15 16:37:27 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Wed, 15 Dec 2010 11:37:27 -0500 Subject: [Libvirt-cim] [PATCH] Fix to support domain name with space In-Reply-To: <35396e5b805193c024b6.1292364080@elm3b217.beaverton.ibm.com> References: <35396e5b805193c024b6.1292364080@elm3b217.beaverton.ibm.com> Message-ID: <4D08EEC7.7050800@linux.vnet.ibm.com> +1. Gotta love those little fixes :) Pushed. Thanks. Sharad Mishra wrote: > # HG changeset patch > # User Sharad Mishra > # Date 1292363991 28800 > # Node ID 35396e5b805193c024b6d4f065136d7b57a0b03d > # Parent 8c322e30cabbf9e62cbae06e5566fc1662ad539c > Fix to support domain name with space. > > Libvirt-cim was failing to correctly parse domain names that had whitespace in between. > For example, domain "test domain", would get parsed as just "test". > > Signed-off-by: Sharad Mishra > > diff -r 8c322e30cabb -r 35396e5b8051 libxkutil/misc_util.c > --- a/libxkutil/misc_util.c Wed Dec 08 12:20:26 2010 -0800 > +++ b/libxkutil/misc_util.c Tue Dec 14 13:59:51 2010 -0800 > @@ -448,7 +448,7 @@ > char *tmp_pfx = NULL; > char *tmp_name = NULL; > > - ret = sscanf(id, "%a[^:]:%as", &tmp_pfx, &tmp_name); > + ret = sscanf(id, "%a[^:]:%a[^\n]", &tmp_pfx, &tmp_name); > if (ret != 2) { > ret = 0; > goto out; > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From ancoron at chaoslayer.de Thu Dec 16 07:44:22 2010 From: ancoron at chaoslayer.de (Ancoron Luciferis) Date: Thu, 16 Dec 2010 08:44:22 +0100 Subject: [Libvirt-cim] compiling/linking under debian/ubuntu In-Reply-To: <4D065A1C.1080700@linux.vnet.ibm.com> References: <4CEEF253.3090302@chaoslayer.de> <4D065A1C.1080700@linux.vnet.ibm.com> Message-ID: <4D09C356.2050206@chaoslayer.de> Hi, my system is a Kubuntu 10.10 desktop running on kernel 2.6.37-rc5 (currently). - libvirt-cim directly from hg - libcmpiutil from hg Other libraries/tools directly from ubuntu: $ dpkg -l | grep cmpi ii libcmpicppimpl0 1.0.5-0ubuntu1 ii libcmpicppimpl0-dev 1.0.5-0ubuntu1 ii libcmpiosbase-common0 1.6.0-0ubuntu2 ii libcmpiosbase-common0-dev 1.6.0-0ubuntu2 ii sblim-cmpi-base 1.6.0-0ubuntu2 ii sblim-cmpi-common 1.6.0-0ubuntu2 $ dpkg -l | grep sfcb ii sfcb 1.3.8-0ubuntu1 $ dpkg -l | grep libvirt ii libvirt-bin 0.8.3-1ubuntu14 ii libvirt0 0.8.3-1ubuntu14 ii libvirtodbc0 6.1.2+dfsg1-1ubuntu4 ii munin-libvirt-plugins 0.0.6-1 ii python-libvirt 0.8.3-1ubuntu14 Hope this helps and thanx for any hints. Cheers, Ancoron On 12/13/2010 06:38 PM, Chip Vincent wrote: > If you can include some information about the distro and version you are > using, I can try to reproduce and attempt to give you some pointers to > resolve. > > Ancoron Luciferis wrote: >> Hi *, >> >> I'm currently trying to figure out how to build and install libvirt-cim >> on one of my Ubuntu boxes. >> >> I have all requirements met but during 'make install' I get this: >> >> /usr/bin/ld: cannot find -lVirt_VirtualSystemSnapshotService >> collect2: ld returned 1 exit status >> libtool: install: error: relink `libVirt_ComputerSystem.la' with the >> above command before installing it >> make[3]: *** [install-providerLTLIBRARIES] Error 1 >> >> >> Well, the mentioned library is there: >> >> src/.libs/libVirt_VirtualSystemSnapshotService.a >> src/.libs/libVirt_VirtualSystemSnapshotService.la >> src/.libs/libVirt_VirtualSystemSnapshotService.lai >> src/.libs/libVirt_VirtualSystemSnapshotService.so >> src/.libs/libVirt_VirtualSystemSnapshotService.so.0 >> src/.libs/libVirt_VirtualSystemSnapshotService.so.0.0.0 >> >> >> Could someone help me with that as I'm not that familiar with the >> details of shared library linking yet. >> >> I attached a full output of: >> >> make preinstall >> make >> sudo make install >> >> >> Thanx in advance, >> >> Ancoron >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Libvirt-cim mailing list >> Libvirt-cim at redhat.com >> https://www.redhat.com/mailman/listinfo/libvirt-cim > > From cvincent at linux.vnet.ibm.com Tue Dec 21 16:06:46 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 21 Dec 2010 11:06:46 -0500 Subject: [Libvirt-cim] [PATCH] Update indication providers to the std_indication interface change introduced in libcmpiutil f967d9432f31 Message-ID: <4D10D096.9090409@linux.vnet.ibm.com> # HG changeset patch # User Chip Vincent # Date 1292947301 18000 # Node ID 92459d48d4128e0b569eb1c0d489bc41485545c8 # Parent d7237a0fcc8a765d8a9a92bb64792837c9f33325 Update indication providers to the std_indication interface change introduced in libcmpiutil f967d9432f31. This fix is needed to build libvirt-cim with the latest libcmpiutil-devel headers. There will be a small patch coming for std_indication.h shortly to ensure 0 warnings. Signed-off-by: Chip Vincent diff -r d7237a0fcc8a -r 92459d48d412 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Tue Dec 21 11:00:57 2010 -0500 +++ b/src/Virt_ComputerSystemIndication.c Tue Dec 21 11:01:41 2010 -0500 @@ -787,12 +787,13 @@ static CMPIStatus raise_indication(const CMPIBroker *broker, const CMPIContext *ctx, + CMPIObjectPath *ref, const CMPIInstance *ind) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *prev_inst; CMPIInstance *src_inst; - CMPIObjectPath *ref = NULL; + CMPIObjectPath *_ref = NULL; struct std_indication_ctx *_ctx = NULL; struct ind_args *args = NULL; char *prefix = NULL; @@ -809,7 +810,7 @@ if (s.rc != CMPI_RC_OK || CMIsNullObject(prev_inst)) goto out; - ref = CMGetObjectPath(prev_inst, &s); + _ref = CMGetObjectPath(prev_inst, &s); if (s.rc != CMPI_RC_OK) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, @@ -819,10 +820,10 @@ /* FIXME: This is a Pegasus work around. Pegsus loses the namespace when an ObjectPath is pulled from an instance */ - if (STREQ(NAMESPACE(ref), "")) - CMSetNameSpace(ref, "root/virt"); + if (STREQ(NAMESPACE(_ref), "")) + CMSetNameSpace(_ref, "root/virt"); - s = get_domain_by_ref(broker, ref, &src_inst); + s = get_domain_by_ref(broker, _ref, &src_inst); if (s.rc != CMPI_RC_OK || CMIsNullObject(src_inst)) goto out; @@ -847,8 +848,8 @@ goto out; } - args->ns = strdup(NAMESPACE(ref)); - args->classname = strdup(CLASSNAME(ref)); + args->ns = strdup(NAMESPACE(_ref)); + args->classname = strdup(CLASSNAME(_ref)); args->_ctx = _ctx; prefix = class_prefix_name(args->classname); diff -r d7237a0fcc8a -r 92459d48d412 src/Virt_ResourceAllocationSettingDataIndication.c --- a/src/Virt_ResourceAllocationSettingDataIndication.c Tue Dec 21 11:00:57 2010 -0500 +++ b/src/Virt_ResourceAllocationSettingDataIndication.c Tue Dec 21 11:01:41 2010 -0500 @@ -68,12 +68,13 @@ static CMPIStatus raise_indication(const CMPIBroker *broker, const CMPIContext *ctx, + CMPIObjectPath *ref, const CMPIInstance *ind) { struct std_indication_ctx *_ctx = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; struct ind_args *args = NULL; - CMPIObjectPath *ref = NULL; + CMPIObjectPath *_ref = NULL; _ctx = malloc(sizeof(struct std_indication_ctx)); if (_ctx == NULL) { @@ -96,8 +97,8 @@ goto out; } - ref = CMGetObjectPath(ind, &s); - if (ref == NULL) { + _ref = CMGetObjectPath(ind, &s); + if (_ref == NULL) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Got a null object path"); @@ -108,14 +109,14 @@ when an ObjectPath is pulled from an instance */ - CMSetNameSpace(ref, "root/virt"); - args->ns = strdup(NAMESPACE(ref)); - args->classname = strdup(CLASSNAME(ref)); + CMSetNameSpace(_ref, "root/virt"); + args->ns = strdup(NAMESPACE(_ref)); + args->classname = strdup(CLASSNAME(_ref)); args->_ctx = _ctx; /* This is a workaround for Pegasus, it loses its objectpath by CMGetObjectPath. So set it back. */ - ind->ft->setObjectPath((CMPIInstance *)ind, ref); + ind->ft->setObjectPath((CMPIInstance *)ind, _ref); s = stdi_deliver(broker, ctx, args, (CMPIInstance *)ind); if (s.rc == CMPI_RC_OK) { -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From cvincent at linux.vnet.ibm.com Tue Dec 21 16:11:57 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 21 Dec 2010 11:11:57 -0500 Subject: [Libvirt-cim] [PATCH] Restore const to interface to avoid warnings Message-ID: <4D10D1CD.1050706@linux.vnet.ibm.com> # HG changeset patch # User Chip Vincent # Date 1292947743 18000 # Node ID 13fbf3dc3923457a894a063b20077e3fb586e7d3 # Parent 531f151df659f030fe4fab1f6663572af356935f Restore const to interface to avoid warnings. This change simply tweaks the interface to avoid build warnings (sadly buried in macros). Signed-off-by: Chip Vincent diff -r 531f151df659 -r 13fbf3dc3923 std_indication.h --- a/std_indication.h Wed Dec 08 12:44:27 2010 -0800 +++ b/std_indication.h Tue Dec 21 11:09:03 2010 -0500 @@ -135,7 +135,7 @@ CMPIStatus stdi_handler(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, - CMPIObjectPath *reference, + const CMPIObjectPath *reference, const char *methodname, const CMPIArgs *argsin, CMPIArgs *argsout); -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From snmishra at us.ibm.com Tue Dec 21 17:08:12 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Tue, 21 Dec 2010 09:08:12 -0800 Subject: [Libvirt-cim] [PATCH] Restore const to interface to avoid warnings In-Reply-To: <4D10D1CD.1050706@linux.vnet.ibm.com> References: <4D10D1CD.1050706@linux.vnet.ibm.com> Message-ID: +1 Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 12/21/2010 08:11:57 AM: > Chip Vincent > Sent by: libvirt-cim-bounces at redhat.com > > 12/21/10 08:11 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > List for discussion and development of libvirt CIM > > cc > > Subject > > [Libvirt-cim] [PATCH] Restore const to interface to avoid warnings > > # HG changeset patch > # User Chip Vincent > # Date 1292947743 18000 > # Node ID 13fbf3dc3923457a894a063b20077e3fb586e7d3 > # Parent 531f151df659f030fe4fab1f6663572af356935f > Restore const to interface to avoid warnings. > > This change simply tweaks the interface to avoid build warnings (sadly > buried in macros). > > Signed-off-by: Chip Vincent > > diff -r 531f151df659 -r 13fbf3dc3923 std_indication.h > --- a/std_indication.h Wed Dec 08 12:44:27 2010 -0800 > +++ b/std_indication.h Tue Dec 21 11:09:03 2010 -0500 > @@ -135,7 +135,7 @@ > CMPIStatus stdi_handler(CMPIMethodMI *self, > const CMPIContext *context, > const CMPIResult *results, > - CMPIObjectPath *reference, > + const CMPIObjectPath *reference, > const char *methodname, > const CMPIArgs *argsin, > CMPIArgs *argsout); > > -- > Chip Vincent > Open Virtualization, Linux Technology Center > IBM Systems & Technology Group > phone: 919-254-4482, T/L 444-4482 > email: cvincent at us.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From snmishra at us.ibm.com Thu Dec 23 02:38:09 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 22 Dec 2010 18:38:09 -0800 Subject: [Libvirt-cim] [PATCH] [TEST] New test to verify cdrom media change Message-ID: # HG changeset patch # User Sharad Mishra # Date 1293071821 28800 # Node ID d88da81a62f6c4cd6bfc0310f360e4d77863d9f4 # Parent dac5cb514b9a7668b7717ac07bf02b9fcdf3a78d [TEST] New test to verify cdrom media change. Libvirt-cim now allows live cdrom media change. This test checks that functionality. Signed-off-by: Sharad Mishra diff -r dac5cb514b9a -r d88da81a62f6 suites/libvirt-cim/cimtest/VirtualSystemManagementService/29_cdrom_media_change.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/29_cdrom_media_change.py Wed Dec 22 18:37:01 2010 -0800 @@ -0,0 +1,178 @@ +#!/usr/bin/python +# +# Copyright 2010 IBM Corp. +# +# Authors: +# Sharad Mishra +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Purpose: +# Verify providers support disk images with long paths / names +# +# Steps: +# 1) Define and start a guest with cdrom drive. +# 2) Modify cdrom drive to point to another source. +# 3) Verify guest is now pointing to new locations. +# + +import sys +import os +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS, SKIP +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.rasd import get_rasd_templates +from XenKvmLib.const import do_main, get_provider_version, \ + KVM_disk_path, KVM_secondary_disk_path, \ + default_pool_name +from XenKvmLib.vxml import get_class +from XenKvmLib import vxml +from XenKvmLib.common_util import parse_instance_id +from XenKvmLib.enumclass import EnumInstances +from XenKvmLib import vsms +from XenKvmLib import vsms_util +from XenKvmLib.vsms import VIRT_DISK_TYPE_CDROM + +sup_types = ['KVM'] +test_dom = 'cddom' +cdrom_rev = 1056 + +def get_rasd_list(ip, virt, addr): + drasd_cn = get_typed_class(virt, "DiskResourceAllocationSettingData") + instanceid = "DiskPool/%s" % default_pool_name + + rasds = get_rasd_templates(ip, virt, instanceid) + if len(rasds) < 1: + logger.info("No RASD templates returned for %s", pool_id) + return [] + + for rasd in rasds: + if rasd.classname != drasd_cn: + continue + if rasd['EmulatedType'] == VIRT_DISK_TYPE_CDROM and \ + "Default" in rasd['InstanceID']: + rasd['source'] = addr + rasd['Address'] = addr + break + return rasd + +def change_cdrom_media(ip, virt, rasd, addr): + status = FAIL + service = vsms.get_vsms_class(virt)(ip) + cxml = vxml.get_class(virt)(test_dom) + dasd = vsms.get_dasd_class(virt)(dev=rasd['VirtualDevice'], + source=addr, + instanceid="cddom/hdc", + name=test_dom) + + status = vsms_util.mod_disk_res(ip, service, cxml, dasd, addr) + return status + +def verify_cdrom_update(ip, virt, addr, guest_name): + inst = None + + try: + drasd_cn = get_typed_class(virt, 'DiskResourceAllocationSettingData') + enum_list = EnumInstances(ip, drasd_cn) + + if enum_list < 1: + raise Exception("No %s instances returned" % drasd_cn) + + for rasd in enum_list: + guest, dev, status = parse_instance_id(rasd.InstanceID) + if status != PASS: + raise Exception("Unable to parse InstanceID: %s" % \ + rasd.InstanceID) + + if guest == guest_name: + inst = rasd + break + + if inst is None or inst.Address != addr: + raise Exception("Expected Address to be of %s" % \ + KVM_secondary_disk_path) + + if inst.EmulatedType != VIRT_DISK_TYPE_CDROM: + raise Exception("Expected device to be of %d type" % \ + VIRT_DISK_TYPE_FLOPPY) + + except Exception, details: + logger.error(details) + return FAIL + + return PASS + + at do_main(sup_types) +def main(): + options = main.options + + status = FAIL + + curr_cim_rev, changeset = get_provider_version(options.virt, options.ip) + if curr_cim_rev < cdrom_rev: + logger.error("cdrom media change support is available in rev >= %s", cdrom_rev) + return SKIP + + cxml = get_class(options.virt)(test_dom) + + addr = KVM_disk_path + + guest_defined = False + guest_running = False + + try: + rasd = get_rasd_list(options.ip, options.virt, addr) + rasd_list = {} + rasd_list[rasd.classname] = inst_to_mof(rasd) + if len(rasd_list) < 1: + raise Exception("Unable to get template RASDs for %s" % test_dom) + + cxml.set_res_settings(rasd_list) + ret = cxml.cim_define(options.ip) + if not ret: + raise Exception("Unable to define %s" % test_dom) + + guest_defined = True + + ret = cxml.cim_start(options.ip) + if ret: + raise Exception("Unable to start %s" % test_dom) + + guest_running = True + + status = change_cdrom_media(options.ip, options.virt, rasd, KVM_secondary_disk_path) + if status != PASS: + raise Exception("Failed cdrom media change for %s" % test_dom) + + status = verify_cdrom_update(options.ip, options.virt, KVM_secondary_disk_path, test_dom) + if status != PASS: + raise Exception("Failed to verify cdrom media change for %s" % test_dom) + + except Exception, details: + logger.error(details) + status = FAIL + + if guest_running == True: + cxml.destroy(options.ip) + + if guest_defined == True: + cxml.undefine(options.ip) + + return status + +if __name__ == "__main__": + sys.exit(main()) + + diff -r dac5cb514b9a -r d88da81a62f6 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Thu Oct 07 01:06:53 2010 -0400 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Dec 22 18:37:01 2010 -0800 @@ -146,13 +146,15 @@ # classes to define RASD parameters class CIM_DiskResourceAllocationSettingData(CIMClassMOF): - def __init__(self, dev, source, name, emu_type=None): + def __init__(self, dev, source, name, instanceid=None, emu_type=None): self.ResourceType = RASD_TYPE_DISK if emu_type != None: self.EmulatedType = emu_type if dev != None: self.VirtualDevice = dev self.InstanceID = '%s/%s' % (name, dev) + if instanceid != None: + self.InstanceID = instanceid if source != None: self.Address = source From snmishra at us.ibm.com Thu Dec 23 04:40:44 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 23 Dec 2010 04:40:44 -0000 Subject: [Libvirt-cim] [PATCH] Added support for qcow2 format type Message-ID: <353104beb7b459f715f6.1293079244@elm3b217.beaverton.ibm.com> # HG changeset patch # User Sharad Mishra # Date 1293079091 28800 # Node ID 353104beb7b459f715f64bd88feb899bfce4458f # Parent 35396e5b805193c024b6d4f065136d7b57a0b03d Added support for qcow2 format type. Only 'raw' storage volume was supported by libvirt-cim. This patch adds support for qcow2. Signed-off-by: Sharad Mishra diff -r 35396e5b8051 -r 353104beb7b4 libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Tue Dec 14 13:59:51 2010 -0800 +++ b/libxkutil/pool_parsing.h Wed Dec 22 20:38:11 2010 -0800 @@ -66,7 +66,8 @@ struct storage_vol { enum {VOL_FORMAT_UNKNOWN, - VOL_FORMAT_RAW} format_type; + VOL_FORMAT_RAW, + VOL_FORMAT_QCOW2} format_type; char *vol_name; char *path; uint16_t alloc; diff -r 35396e5b8051 -r 353104beb7b4 libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Tue Dec 14 13:59:51 2010 -0800 +++ b/libxkutil/xmlgen.c Wed Dec 22 20:38:11 2010 -0800 @@ -1134,6 +1134,8 @@ switch (type) { case VOL_FORMAT_RAW: return "raw"; + case VOL_FORMAT_QCOW2: + return "qcow2"; default: CU_DEBUG("Unsupported storage volume type"); } From snmishra at us.ibm.com Fri Dec 24 19:43:52 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Fri, 24 Dec 2010 11:43:52 -0800 Subject: [Libvirt-cim] [PATCH] [TEST] Updated the test to create qcow2 storage volumes Message-ID: # HG changeset patch # User Sharad Mishra # Date 1293219718 28800 # Node ID c08c7fb1eb78c209fd6af1fc40b9858b0027061b # Parent d88da81a62f6c4cd6bfc0310f360e4d77863d9f4 [TEST] Updated the test to create qcow2 storage volumes. This test has been updated to create not just raw storage volumes, but also qcow2. Signed-off-by: Sharad Mishra diff -r d88da81a62f6 -r c08c7fb1eb78 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py Wed Dec 22 18:37:01 2010 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py Fri Dec 24 11:41:58 2010 -0800 @@ -42,6 +42,7 @@ from XenKvmLib.classes import get_typed_class, inst_to_mof from XenKvmLib.common_util import destroy_diskpool from XenKvmLib.pool import create_pool, undefine_diskpool, DIR_POOL +from pywbem.cim_types import Uint64 pool_attr = { 'Path' : _image_dir } vol_name = "cimtest-vol.img" @@ -62,7 +63,7 @@ return PASS, rasd -def get_stovol_settings(server, virt, dp_id, pool_name): +def get_stovol_settings(server, virt, dp_id, pool_name, format): status, dp_rasds = get_template_rasd_from_sdc(virt, server, dp_id) if status != PASS: logger.error("Failed to get the StorageVol RASD's") @@ -79,7 +80,8 @@ if not pool_name in dpool_rasd['PoolID']: return None - + dpool_rasd['FormatType'] = Uint64(format) + stovol_settings = inst_to_mof(dpool_rasd) return stovol_settings @@ -197,67 +199,71 @@ # vol creation, we can extend dp_types to include netfs etc dp_types = { "DISK_POOL_DIR" : DIR_POOL } - for pool_name, pool_type in dp_types.iteritems(): - status = FAIL - res = [FAIL] - found = 0 - clean_pool=True - try: - if pool_type == DIR_POOL: - pool_name = default_pool_name - clean_pool=False - else: - status = create_pool(server, virt, pool_name, pool_attr, - mode_type=pool_type, pool_type="DiskPool") + format_types = [1, 2] - if status != PASS: - logger.error("Failed to create pool '%s'", pool_name) - return status + for fs in format_types: + for pool_name, pool_type in dp_types.iteritems(): + status = FAIL + res = [FAIL] + found = 0 + clean_pool=True + try: + if pool_type == DIR_POOL: + pool_name = default_pool_name + clean_pool=False + else: + status = create_pool(server, virt, pool_name, pool_attr, + mode_type=pool_type, pool_type="DiskPool") - dp_inst_id = "%s/%s" % (dp_cn, pool_name) - stovol_settings = get_stovol_settings(server, virt, - dp_inst_id, pool_name) - if stovol_settings == None: - raise Exception("Failed to get the defualt StorageVolRASD info") + if status != PASS: + logger.error("Failed to create pool '%s'", pool_name) + return status - disk_pool_inst = get_diskpool(server, virt, dp_cn, dp_inst_id) - if disk_pool_inst == None: - raise Exception("DiskPool instance for '%s' not found!" \ - % pool_name) + dp_inst_id = "%s/%s" % (dp_cn, pool_name) + stovol_settings = get_stovol_settings(server, virt, + dp_inst_id, pool_name, fs) + if stovol_settings == None: + raise Exception("Failed to get the defualt StorageVolRASD info") + + disk_pool_inst = get_diskpool(server, virt, dp_cn, dp_inst_id) + if disk_pool_inst == None: + raise Exception("DiskPool instance for '%s' not found!" \ + % pool_name) - rpcs = get_typed_class(virt, "ResourcePoolConfigurationService") - rpcs_conn = eval("rpcs_service." + rpcs)(server) - res = rpcs_conn.CreateResourceInPool(Settings=stovol_settings, - Pool=disk_pool_inst) - if res[0] != PASS: - raise Exception("Failed to create the Vol %s" % vol_name) + rpcs = get_typed_class(virt, "ResourcePoolConfigurationService") + rpcs_conn = eval("rpcs_service." + rpcs)(server) + res = rpcs_conn.CreateResourceInPool(Settings=stovol_settings, + Pool=disk_pool_inst) + if res[0] != PASS: + raise Exception("Failed to create the Vol %s" % vol_name) - if res[1]['Resource']['InstanceID'] != exp_vol_path and \ - cim_rev >= libvirt_stovol_instance_id: - raise Exception("Incorrect InstanceID") - else: - status = PASS + if res[1]['Resource']['InstanceID'] != exp_vol_path and \ + cim_rev >= libvirt_stovol_instance_id: + raise Exception("Incorrect InstanceID") + else: + status = PASS - found = verify_vol(server, virt, pool_name, exp_vol_path, found) - stovol_status = verify_template_rasd_exists(virt, server, - dp_inst_id, - exp_vol_path) + found = verify_vol(server, virt, pool_name, exp_vol_path, found) + stovol_status = verify_template_rasd_exists(virt, server, + dp_inst_id, + exp_vol_path) - ret = cleanup_pool_vol(server, virt, pool_name, - clean_pool, exp_vol_path) - if res[0] == PASS and found == 1 and \ - ret == PASS and stovol_status == PASS and \ - status == PASS: - status = PASS - else: - return FAIL + ret = cleanup_pool_vol(server, virt, pool_name, + clean_pool, exp_vol_path) + if res[0] == PASS and found == 1 and \ + ret == PASS and stovol_status == PASS and \ + status == PASS: + status = PASS + else: + return FAIL - except Exception, details: - logger.error("Exception details: %s", details) - cleanup_pool_vol(server, virt, pool_name, - clean_pool, exp_vol_path) - status = FAIL + except Exception, details: + logger.error("Exception details: %s", details) + cleanup_pool_vol(server, virt, pool_name, + clean_pool, exp_vol_path) + status = FAIL return status + if __name__ == "__main__": sys.exit(main()) From snmishra at us.ibm.com Tue Dec 28 00:34:53 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Tue, 28 Dec 2010 00:34:53 -0000 Subject: [Libvirt-cim] [PATCH] Patch to fix missing DiskPool type Message-ID: <28f3d6f46a06aa5be6ab.1293496493@elm3b217.beaverton.ibm.com> # HG changeset patch # User Sharad Mishra # Date 1293496322 28800 # Node ID 28f3d6f46a06aa5be6aba8bcfeda55bd0ddc5468 # Parent 35396e5b805193c024b6d4f065136d7b57a0b03d Patch to fix missing DiskPool type. DiskPool type was not being populated. Signed-off-by: Sharad Mishra diff -r 35396e5b8051 -r 28f3d6f46a06 libxkutil/pool_parsing.c --- a/libxkutil/pool_parsing.c Tue Dec 14 13:59:51 2010 -0800 +++ b/libxkutil/pool_parsing.c Mon Dec 27 16:32:02 2010 -0800 @@ -166,6 +166,30 @@ return 1; } +char *get_disk_pool_type(uint16_t type) +{ + + switch (type) { + case DISK_POOL_DIR: + return "dir"; + case DISK_POOL_FS: + return "fs"; + case DISK_POOL_NETFS: + return "netfs"; + case DISK_POOL_DISK: + return "disk"; + case DISK_POOL_ISCSI: + return "iscsi"; + case DISK_POOL_LOGICAL: + return "logical"; + case DISK_POOL_SCSI: + return "scsi"; + default: + return NULL; + } + +} + static const char *parse_disk_pool(xmlNodeSet *nsv, struct disk_pool *pool) { xmlNode **nodes = nsv->nodeTab; diff -r 35396e5b8051 -r 28f3d6f46a06 libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Tue Dec 14 13:59:51 2010 -0800 +++ b/libxkutil/pool_parsing.h Mon Dec 27 16:32:02 2010 -0800 @@ -86,6 +86,7 @@ void cleanup_virt_pool_res(struct virt_pool_res **res); int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type); +char *get_disk_pool_type(uint16_t type); int define_pool(virConnectPtr conn, const char *xml, int res_type); int destroy_pool(virConnectPtr conn, const char *name, int res_type); diff -r 35396e5b8051 -r 28f3d6f46a06 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Tue Dec 14 13:59:51 2010 -0800 +++ b/src/Virt_DevicePool.c Mon Dec 27 16:32:02 2010 -0800 @@ -172,6 +172,7 @@ virStoragePoolInfo info; uint64_t cap; uint64_t res; + uint16_t type; struct virt_pool *pool_vals = NULL; const char *pool_str = NULL; @@ -204,6 +205,10 @@ CMSetProperty(inst, "Path", (CMPIValue *)pool_str, CMPI_chars); } + type = pool_vals->pool_info.disk.pool_type; + CMSetProperty(inst, "OtherResourceType", + (CMPIValue *)get_disk_pool_type(type), + CMPI_chars); } result = true; @@ -957,11 +962,19 @@ const char *refcn, const CMPIBroker *broker) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; char *poolid = NULL; inst = get_typed_instance(broker, refcn, "DiskPool", ns); + if (inst == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to init DiskPool instance"); + goto out; + } + if (asprintf(&poolid, "DiskPool/%s", pool->tag) == -1) return NULL; @@ -976,6 +989,7 @@ CU_DEBUG("Failed to set capacity for disk pool: %s", pool->tag); +out: free(poolid); return inst; From cvincent at linux.vnet.ibm.com Wed Dec 29 21:51:39 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Wed, 29 Dec 2010 16:51:39 -0500 Subject: [Libvirt-cim] [PATCH] (#2) Restore const to interface to avoid warnings Message-ID: <4D1BAD6B.6080406@linux.vnet.ibm.com> # HG changeset patch # User Chip Vincent # Date 1293659369 18000 # Node ID 4339c67a849ce34af7d7df62860431be4a879f31 # Parent b2f96d5cfbe7e4c8608fcee30b6007457677adbd Restore const to interface to avoid warnings. This change simply tweaks the interface to avoid build warnings (sadly buried in macros). Signed-off-by: Chip Vincent diff -r b2f96d5cfbe7 -r 4339c67a849c std_indication.c --- a/std_indication.c Wed Dec 29 16:42:31 2010 -0500 +++ b/std_indication.c Wed Dec 29 16:49:29 2010 -0500 @@ -98,7 +98,7 @@ static CMPIStatus default_raise(const CMPIBroker *broker, const CMPIContext *context, - CMPIObjectPath *ref, + const CMPIObjectPath *ref, CMPIInstance *ind) { CMPIStatus s = {CMPI_RC_OK, NULL}; @@ -117,7 +117,7 @@ static CMPIStatus raise(struct std_indication_ctx *ctx, const CMPIContext *context, const CMPIArgs *argsin, - CMPIObjectPath *ref) + const CMPIObjectPath *ref) { bool enabled; CMPIInstance *inst; @@ -301,7 +301,7 @@ CMPIStatus stdi_handler(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, - CMPIObjectPath *reference, + const CMPIObjectPath *reference, const char *methodname, const CMPIArgs *argsin, CMPIArgs *argsout) diff -r b2f96d5cfbe7 -r 4339c67a849c std_indication.h --- a/std_indication.h Wed Dec 29 16:42:31 2010 -0500 +++ b/std_indication.h Wed Dec 29 16:49:29 2010 -0500 @@ -41,7 +41,7 @@ typedef CMPIStatus (*raise_indication_t)(const CMPIBroker *broker, const CMPIContext *ctx, - CMPIObjectPath *ref, + const CMPIObjectPath *ref, const CMPIInstance *ind); typedef CMPIStatus (*trigger_indication_t)(const CMPIContext *ctx); -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From snmishra at us.ibm.com Wed Dec 29 22:09:32 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 29 Dec 2010 14:09:32 -0800 Subject: [Libvirt-cim] [PATCH] (#2) Restore const to interface to avoid warnings In-Reply-To: <4D1BAD6B.6080406@linux.vnet.ibm.com> References: <4D1BAD6B.6080406@linux.vnet.ibm.com> Message-ID: +1 Sharad Mishra Open Virtualization Linux Technology Center IBM Chip Vincent To Sent by: List for discussion and development libvirt-cim-bounc of libvirt CIM es at redhat.com cc 12/29/2010 01:51 Subject PM [Libvirt-cim] [PATCH] (#2) Restore const to interface to avoid warnings Please respond to List for discussion and development of libvirt CIM # HG changeset patch # User Chip Vincent # Date 1293659369 18000 # Node ID 4339c67a849ce34af7d7df62860431be4a879f31 # Parent b2f96d5cfbe7e4c8608fcee30b6007457677adbd Restore const to interface to avoid warnings. This change simply tweaks the interface to avoid build warnings (sadly buried in macros). Signed-off-by: Chip Vincent diff -r b2f96d5cfbe7 -r 4339c67a849c std_indication.c --- a/std_indication.c Wed Dec 29 16:42:31 2010 -0500 +++ b/std_indication.c Wed Dec 29 16:49:29 2010 -0500 @@ -98,7 +98,7 @@ static CMPIStatus default_raise(const CMPIBroker *broker, const CMPIContext *context, - CMPIObjectPath *ref, + const CMPIObjectPath *ref, CMPIInstance *ind) { CMPIStatus s = {CMPI_RC_OK, NULL}; @@ -117,7 +117,7 @@ static CMPIStatus raise(struct std_indication_ctx *ctx, const CMPIContext *context, const CMPIArgs *argsin, - CMPIObjectPath *ref) + const CMPIObjectPath *ref) { bool enabled; CMPIInstance *inst; @@ -301,7 +301,7 @@ CMPIStatus stdi_handler(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, - CMPIObjectPath *reference, + const CMPIObjectPath *reference, const char *methodname, const CMPIArgs *argsin, CMPIArgs *argsout) diff -r b2f96d5cfbe7 -r 4339c67a849c std_indication.h --- a/std_indication.h Wed Dec 29 16:42:31 2010 -0500 +++ b/std_indication.h Wed Dec 29 16:49:29 2010 -0500 @@ -41,7 +41,7 @@ typedef CMPIStatus (*raise_indication_t)(const CMPIBroker *broker, const CMPIContext *ctx, - CMPIObjectPath *ref, + const CMPIObjectPath *ref, const CMPIInstance *ind); typedef CMPIStatus (*trigger_indication_t)(const CMPIContext *ctx); -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com _______________________________________________ Libvirt-cim mailing list Libvirt-cim at redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pic12313.gif Type: image/gif Size: 1255 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available URL: From snmishra at us.ibm.com Wed Dec 29 22:02:49 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 29 Dec 2010 14:02:49 -0800 Subject: [Libvirt-cim] [PATCH] [TEST] Verify that disk can be dynamically modified Message-ID: <52487783c9e1ae0967aa.1293660169@elm3b197.beaverton.ibm.com> # HG changeset patch # User Sharad Mishra # Date 1293659957 28800 # Node ID 52487783c9e1ae0967aa6f2c72269a85290c3f22 # Parent c08c7fb1eb78c209fd6af1fc40b9858b0027061b [TEST] Verify that disk can be dynamically modified. This test case will create a new VM (define and start) and add a virtio disk and then modify it. Signed-off-by: Sharad Mishra diff -r c08c7fb1eb78 -r 52487783c9e1 suites/libvirt-cim/cimtest/VirtualSystemManagementService/30_dynamic_disk_mod.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/30_dynamic_disk_mod.py Wed Dec 29 13:59:17 2010 -0800 @@ -0,0 +1,88 @@ +#!/usr/bin/python +# +# Copyright 2008 IBM Corp. +# +# Authors: +# Sharad Mishra +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +import sys +import pywbem +from pywbem.cim_obj import CIMInstanceName +from XenKvmLib import vsms +from XenKvmLib import vxml +from XenKvmLib.classes import get_typed_class +from CimTest.Globals import logger +from XenKvmLib.const import do_main +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib import vsms_util + +sup_types = ['Xen', 'KVM', 'XenFV'] +default_dom = 'rstest_domain' + + at do_main(sup_types) +def main(): + options = main.options + + if options.virt == 'KVM': + nddev = 'vda' + else: + nddev = 'xvdb' + + service = vsms.get_vsms_class(options.virt)(options.ip) + cxml = vxml.get_class(options.virt)(default_dom) + classname = get_typed_class(options.virt, 'VirtualSystemSettingData') + inst_id = '%s:%s' % (options.virt, default_dom) + vssd_ref = CIMInstanceName(classname, keybindings = { + 'InstanceID' : inst_id, + 'CreationClassName' : classname}) + dasd = vsms.get_dasd_class(options.virt)(dev=nddev, + source=cxml.secondary_disk_path, + name=default_dom) + disk_attr = { 'nddev' : nddev, + 'src_path' : cxml.secondary_disk_path + } + + cxml.undefine(options.ip) + cxml = vxml.get_class(options.virt)(default_dom) + ret = cxml.cim_define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + + ret = cxml.start(options.ip) + if not ret: + logger.error("Failed to start the dom: %s", default_dom) + return FAIL + + status = vsms_util.add_disk_res(options.ip, service, cxml, vssd_ref, + dasd, disk_attr) + if status != PASS: + return FAIL + dasd = vsms.get_dasd_class(options.virt)(dev='vdc', + instanceid='rstest_domain/vda', + source='/home/rss.iso', + name=default_dom) + + service = vsms.get_vsms_class(options.virt)(options.ip) + output = service.ModifyResourceSettings(ResourceSettings = [str(dasd)]) + + return status + +if __name__ == "__main__": + sys.exit(main()) + From snmishra at us.ibm.com Wed Dec 29 22:18:41 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 29 Dec 2010 22:18:41 -0000 Subject: [Libvirt-cim] [PATCH] Fixing NullPointerException Message-ID: # HG changeset patch # User Sharad Mishra # Date 1293660976 28800 # Node ID a4f6fba67e8e85aaec6969c39cfaa016b60779d3 # Parent 35396e5b805193c024b6d4f065136d7b57a0b03d Fixing NullPointerException CMPIInstance 'inst' is used before it is set. With this patch sending a one line change to set previous instance correctly. Signed-off-by: Sharad Mishra diff -r 35396e5b8051 -r a4f6fba67e8e src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Tue Dec 14 13:59:51 2010 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Wed Dec 29 14:16:16 2010 -0800 @@ -1378,16 +1378,6 @@ goto out; } - if (cu_get_str_prop(inst, "autoStart", &autoStartFlag) != CMPI_RC_OK) - autoStartFlag = strdup("disable"); - - if (STREQ(autoStartFlag, "enable")) - autoflag = 1; - else - autoflag = 0; - if((virDomainSetAutostart(dom, autoflag)) == -1) - CU_DEBUG("Failed to set autostart flag."); - name = virDomainGetName(dom); *s = get_domain_by_name(_BROKER, ref, name, &inst); @@ -1396,6 +1386,20 @@ cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, "Failed to lookup resulting system"); + goto out; + } + + if (inst != NULL) { + if (cu_get_str_prop(inst, "autoStart", + &autoStartFlag) != CMPI_RC_OK) + autoStartFlag = strdup("disable"); + + if (STREQ(autoStartFlag, "enable")) + autoflag = 1; + else + autoflag = 0; + if((virDomainSetAutostart(dom, autoflag)) == -1) + CU_DEBUG("Failed to set autostart flag."); } out: @@ -2424,12 +2428,12 @@ goto out; } + prev_inst = orig_inst; s = cu_merge_instances(rasd, orig_inst); if (s.rc != CMPI_RC_OK) { CU_DEBUG("Failed to merge Instances"); goto out; } - prev_inst = orig_inst; rasd = orig_inst; } From cvincent at linux.vnet.ibm.com Wed Dec 29 22:54:06 2010 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Wed, 29 Dec 2010 17:54:06 -0500 Subject: [Libvirt-cim] [PATCH] (#2) Update indication providers to the std_indication interface change introduced in libcmpiutil f967d9432f31 Message-ID: <4D1BBC0E.7050509@linux.vnet.ibm.com> # HG changeset patch # User Chip Vincent # Date 1293663180 18000 # Node ID 7b2e9efc2778533b14fd7a4ac82b840a3baec275 # Parent 35396e5b805193c024b6d4f065136d7b57a0b03d Update indication providers to the std_indication interface change introduced in libcmpiutil f967d9432f31. This fix is needed to build libvirt-cim with the latest libcmpiutil-devel headers. There will be a small patch coming for std_indication.h shortly to ensure 0 warnings. Signed-off-by: Chip Vincent diff -r 35396e5b8051 -r 7b2e9efc2778 libvirt-cim.spec.in --- a/libvirt-cim.spec.in Tue Dec 14 13:59:51 2010 -0800 +++ b/libvirt-cim.spec.in Wed Dec 29 17:53:00 2010 -0500 @@ -10,10 +10,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://libvirt.org/CIM/ Requires: libxml2 >= 2.6.0 -Requires: libvirt >= 0.3.2 +Requires: libvirt >= 0.6.3 Requires: unzip BuildRequires: tog-pegasus-devel -BuildRequires: libvirt-devel >= 0.3.2 +BuildRequires: libvirt-devel >= 0.5.3 BuildRequires: e2fsprogs-devel BuildRequires: libxml2-devel BuildRequires: libcmpiutil-devel diff -r 35396e5b8051 -r 7b2e9efc2778 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Tue Dec 14 13:59:51 2010 -0800 +++ b/src/Virt_ComputerSystemIndication.c Wed Dec 29 17:53:00 2010 -0500 @@ -787,12 +787,13 @@ static CMPIStatus raise_indication(const CMPIBroker *broker, const CMPIContext *ctx, + const CMPIObjectPath *ref, const CMPIInstance *ind) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *prev_inst; CMPIInstance *src_inst; - CMPIObjectPath *ref = NULL; + CMPIObjectPath *_ref = NULL; struct std_indication_ctx *_ctx = NULL; struct ind_args *args = NULL; char *prefix = NULL; @@ -809,7 +810,7 @@ if (s.rc != CMPI_RC_OK || CMIsNullObject(prev_inst)) goto out; - ref = CMGetObjectPath(prev_inst, &s); + _ref = CMGetObjectPath(prev_inst, &s); if (s.rc != CMPI_RC_OK) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, @@ -819,10 +820,10 @@ /* FIXME: This is a Pegasus work around. Pegsus loses the namespace when an ObjectPath is pulled from an instance */ - if (STREQ(NAMESPACE(ref), "")) - CMSetNameSpace(ref, "root/virt"); + if (STREQ(NAMESPACE(_ref), "")) + CMSetNameSpace(_ref, "root/virt"); - s = get_domain_by_ref(broker, ref, &src_inst); + s = get_domain_by_ref(broker, _ref, &src_inst); if (s.rc != CMPI_RC_OK || CMIsNullObject(src_inst)) goto out; @@ -847,8 +848,8 @@ goto out; } - args->ns = strdup(NAMESPACE(ref)); - args->classname = strdup(CLASSNAME(ref)); + args->ns = strdup(NAMESPACE(_ref)); + args->classname = strdup(CLASSNAME(_ref)); args->_ctx = _ctx; prefix = class_prefix_name(args->classname); diff -r 35396e5b8051 -r 7b2e9efc2778 src/Virt_ResourceAllocationSettingDataIndication.c --- a/src/Virt_ResourceAllocationSettingDataIndication.c Tue Dec 14 13:59:51 2010 -0800 +++ b/src/Virt_ResourceAllocationSettingDataIndication.c Wed Dec 29 17:53:00 2010 -0500 @@ -68,12 +68,13 @@ static CMPIStatus raise_indication(const CMPIBroker *broker, const CMPIContext *ctx, + const CMPIObjectPath *ref, const CMPIInstance *ind) { struct std_indication_ctx *_ctx = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; struct ind_args *args = NULL; - CMPIObjectPath *ref = NULL; + CMPIObjectPath *_ref = NULL; _ctx = malloc(sizeof(struct std_indication_ctx)); if (_ctx == NULL) { @@ -96,8 +97,8 @@ goto out; } - ref = CMGetObjectPath(ind, &s); - if (ref == NULL) { + _ref = CMGetObjectPath(ind, &s); + if (_ref == NULL) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Got a null object path"); @@ -108,14 +109,14 @@ when an ObjectPath is pulled from an instance */ - CMSetNameSpace(ref, "root/virt"); - args->ns = strdup(NAMESPACE(ref)); - args->classname = strdup(CLASSNAME(ref)); + CMSetNameSpace(_ref, "root/virt"); + args->ns = strdup(NAMESPACE(_ref)); + args->classname = strdup(CLASSNAME(_ref)); args->_ctx = _ctx; /* This is a workaround for Pegasus, it loses its objectpath by CMGetObjectPath. So set it back. */ - ind->ft->setObjectPath((CMPIInstance *)ind, ref); + ind->ft->setObjectPath((CMPIInstance *)ind, _ref); s = stdi_deliver(broker, ctx, args, (CMPIInstance *)ind); if (s.rc == CMPI_RC_OK) { -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com From snmishra at us.ibm.com Thu Dec 30 18:05:37 2010 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 30 Dec 2010 10:05:37 -0800 Subject: [Libvirt-cim] [PATCH] (#2) Update indication providers to the std_indication interface change introduced in libcmpiutil f967d9432f31 In-Reply-To: <4D1BBC0E.7050509@linux.vnet.ibm.com> References: <4D1BBC0E.7050509@linux.vnet.ibm.com> Message-ID: +1 Sharad Mishra Open Virtualization Linux Technology Center IBM Chip Vincent To Sent by: List for discussion and development libvirt-cim-bounc of libvirt CIM es at redhat.com cc 12/29/2010 02:54 Subject PM [Libvirt-cim] [PATCH] (#2) Update indication providers to the std_indication interface change Please respond to introduced in libcmpiutil List for f967d9432f31 discussion and development of libvirt CIM # HG changeset patch # User Chip Vincent # Date 1293663180 18000 # Node ID 7b2e9efc2778533b14fd7a4ac82b840a3baec275 # Parent 35396e5b805193c024b6d4f065136d7b57a0b03d Update indication providers to the std_indication interface change introduced in libcmpiutil f967d9432f31. This fix is needed to build libvirt-cim with the latest libcmpiutil-devel headers. There will be a small patch coming for std_indication.h shortly to ensure 0 warnings. Signed-off-by: Chip Vincent diff -r 35396e5b8051 -r 7b2e9efc2778 libvirt-cim.spec.in --- a/libvirt-cim.spec.in Tue Dec 14 13:59:51 2010 -0800 +++ b/libvirt-cim.spec.in Wed Dec 29 17:53:00 2010 -0500 @@ -10,10 +10,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://libvirt.org/CIM/ Requires: libxml2 >= 2.6.0 -Requires: libvirt >= 0.3.2 +Requires: libvirt >= 0.6.3 Requires: unzip BuildRequires: tog-pegasus-devel -BuildRequires: libvirt-devel >= 0.3.2 +BuildRequires: libvirt-devel >= 0.5.3 BuildRequires: e2fsprogs-devel BuildRequires: libxml2-devel BuildRequires: libcmpiutil-devel diff -r 35396e5b8051 -r 7b2e9efc2778 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Tue Dec 14 13:59:51 2010 -0800 +++ b/src/Virt_ComputerSystemIndication.c Wed Dec 29 17:53:00 2010 -0500 @@ -787,12 +787,13 @@ static CMPIStatus raise_indication(const CMPIBroker *broker, const CMPIContext *ctx, + const CMPIObjectPath *ref, const CMPIInstance *ind) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *prev_inst; CMPIInstance *src_inst; - CMPIObjectPath *ref = NULL; + CMPIObjectPath *_ref = NULL; struct std_indication_ctx *_ctx = NULL; struct ind_args *args = NULL; char *prefix = NULL; @@ -809,7 +810,7 @@ if (s.rc != CMPI_RC_OK || CMIsNullObject(prev_inst)) goto out; - ref = CMGetObjectPath(prev_inst, &s); + _ref = CMGetObjectPath(prev_inst, &s); if (s.rc != CMPI_RC_OK) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, @@ -819,10 +820,10 @@ /* FIXME: This is a Pegasus work around. Pegsus loses the namespace when an ObjectPath is pulled from an instance */ - if (STREQ(NAMESPACE(ref), "")) - CMSetNameSpace(ref, "root/virt"); + if (STREQ(NAMESPACE(_ref), "")) + CMSetNameSpace(_ref, "root/virt"); - s = get_domain_by_ref(broker, ref, &src_inst); + s = get_domain_by_ref(broker, _ref, &src_inst); if (s.rc != CMPI_RC_OK || CMIsNullObject(src_inst)) goto out; @@ -847,8 +848,8 @@ goto out; } - args->ns = strdup(NAMESPACE(ref)); - args->classname = strdup(CLASSNAME(ref)); + args->ns = strdup(NAMESPACE(_ref)); + args->classname = strdup(CLASSNAME(_ref)); args->_ctx = _ctx; prefix = class_prefix_name(args->classname); diff -r 35396e5b8051 -r 7b2e9efc2778 src/Virt_ResourceAllocationSettingDataIndication.c --- a/src/Virt_ResourceAllocationSettingDataIndication.c Tue Dec 14 13:59:51 2010 -0800 +++ b/src/Virt_ResourceAllocationSettingDataIndication.c Wed Dec 29 17:53:00 2010 -0500 @@ -68,12 +68,13 @@ static CMPIStatus raise_indication(const CMPIBroker *broker, const CMPIContext *ctx, + const CMPIObjectPath *ref, const CMPIInstance *ind) { struct std_indication_ctx *_ctx = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; struct ind_args *args = NULL; - CMPIObjectPath *ref = NULL; + CMPIObjectPath *_ref = NULL; _ctx = malloc(sizeof(struct std_indication_ctx)); if (_ctx == NULL) { @@ -96,8 +97,8 @@ goto out; } - ref = CMGetObjectPath(ind, &s); - if (ref == NULL) { + _ref = CMGetObjectPath(ind, &s); + if (_ref == NULL) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Got a null object path"); @@ -108,14 +109,14 @@ when an ObjectPath is pulled from an instance */ - CMSetNameSpace(ref, "root/virt"); - args->ns = strdup(NAMESPACE(ref)); - args->classname = strdup(CLASSNAME(ref)); + CMSetNameSpace(_ref, "root/virt"); + args->ns = strdup(NAMESPACE(_ref)); + args->classname = strdup(CLASSNAME(_ref)); args->_ctx = _ctx; /* This is a workaround for Pegasus, it loses its objectpath by CMGetObjectPath. So set it back. */ - ind->ft->setObjectPath((CMPIInstance *)ind, ref); + ind->ft->setObjectPath((CMPIInstance *)ind, _ref); s = stdi_deliver(broker, ctx, args, (CMPIInstance *)ind); if (s.rc == CMPI_RC_OK) { -- Chip Vincent Open Virtualization, Linux Technology Center IBM Systems & Technology Group phone: 919-254-4482, T/L 444-4482 email: cvincent at us.ibm.com _______________________________________________ Libvirt-cim mailing list Libvirt-cim at redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pic02898.gif Type: image/gif Size: 1255 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available URL: