[PATCH 0 of 2] Remove devid-style InstanceID support from ELEC and EC.

Removed devid-style InstanceID support from ELEC - this class now uses just the name of domain. This caused a needed update in EC - cap_to_cs() no longer needs to parse devid-style InstanceIDs.

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1196470485 28800 # Node ID e69c02e79e40056b1d1a4825c048d70355e9cf85 # Parent e6be7823c8e90c1f4b722ce1b33d6d15db123029 ELEC cleanup - remove get_fq_devid(). Removing get_fq_devid() since it's not necessary for building an InstanceID. Since this change causes error1 to be removed, I also renamed error2 to out, which conforms to the style of the other of the providers. Also, having an error2 without an error1 seemed silly. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r e6be7823c8e9 -r e69c02e79e40 src/Virt_EnabledLogicalElementCapabilities.c --- a/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 15:32:26 2007 -0800 +++ b/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 16:54:45 2007 -0800 @@ -30,7 +30,6 @@ #include "std_instance.h" #include "misc_util.h" -#include "device_parsing.h" #include "cs_util.h" #include "Virt_EnabledLogicalElementCapabilities.h" @@ -58,24 +57,15 @@ static CMPIStatus set_inst_properties(co CMPIArray *array; uint16_t element; int edit_name = 0; - char *devid; CMSetProperty(inst, "CreationClassName", (CMPIValue *)classname, CMPI_chars); - devid = get_fq_devid((char *)sys_name, "0"); - if (devid == NULL) { - cu_statusf(broker, &s, - CMPI_RC_ERR_FAILED, - "Could not get full ID"); - goto error1; - } - - CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars); + CMSetProperty(inst, "InstanceID", (CMPIValue *)sys_name, CMPI_chars); array = CMNewArray(broker, 5, CMPI_uint16, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(array)) - goto error2; + goto out; element = (uint16_t)ENABLED; CMSetArrayElementAt(array, 0, &element, CMPI_uint16); @@ -97,9 +87,7 @@ static CMPIStatus set_inst_properties(co CMSetProperty(inst, "ElementNameEditSupported", (CMPIValue *)&edit_name, CMPI_boolean); - error2: - free(devid); - error1: + out: return s; }

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1196472093 28800 # Node ID 23e70ea23f1a9d8fd59ed0980b077a014da8eb8b # Parent e69c02e79e40056b1d1a4825c048d70355e9cf85 Removing support for devid-style InstanceID from EC. Since ELEC no longer uses devid-style InstanceID, we need to remove the devid-parsing from cap_to_cs(). Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r e69c02e79e40 -r 23e70ea23f1a src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Fri Nov 30 16:54:45 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Fri Nov 30 17:21:33 2007 -0800 @@ -31,7 +31,6 @@ #include "libcmpiutil.h" #include "misc_util.h" #include "std_association.h" -#include "device_parsing.h" #include "Virt_VirtualSystemManagementCapabilities.h" #include "Virt_EnabledLogicalElementCapabilities.h" @@ -119,8 +118,6 @@ static CMPIStatus cap_to_cs(const CMPIOb struct inst_list *list) { const char *inst_id; - char *host; - char *device; CMPIInstance *inst; virConnectPtr conn; CMPIStatus s = {CMPI_RC_OK, NULL}; @@ -129,13 +126,6 @@ static CMPIStatus cap_to_cs(const CMPIOb cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get InstanceID"); - goto error1; - } - - if (!parse_fq_devid(inst_id, &host, &device)) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Could not get system name"); goto error1; } @@ -143,14 +133,12 @@ static CMPIStatus cap_to_cs(const CMPIOb if (s.rc != CMPI_RC_OK) goto error1; - inst = instance_from_name(_BROKER, conn, host, ref); + inst = instance_from_name(_BROKER, conn, inst_id, ref); if (inst) inst_list_add(list, inst); virConnectClose(conn); error1: - free(host); - free(device); return s; }

Kaitlin Rupert wrote:
Removed devid-style InstanceID support from ELEC - this class now uses just the name of domain.
This caused a needed update in EC - cap_to_cs() no longer needs to parse devid-style InstanceIDs.
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
works for me ... +1 -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Kaitlin Rupert wrote:
Removed devid-style InstanceID support from ELEC - this class now uses just the name of domain.
This caused a needed update in EC - cap_to_cs() no longer needs to parse devid-style InstanceIDs.
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
There seems to be something broken by the last patch set series (applied the two from Dan, followed by the two from Kaitlin). Before applying patch set: wbemein http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities localhost:5988/root/virt:KVM_VirtualSystemManagementCapabilities.InstanceID="localhost.localdomain/0" localhost:5988/root/virt:KVM_EnabledLogicalElementCapabilities.InstanceID="qemu1/0" After applying patch set: wbemein http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities localhost:5988/root/virt:KVM_VirtualSystemManagementCapabilities.InstanceID="ManagementCapabilities" localhost:5988/root/virt:Xen_VirtualSystemManagementCapabilities.InstanceID="ManagementCapabilities" localhost:5988/root/virt:KVM_EnabledLogicalElementCapabilities.InstanceID="qemu1" The instance of Xen_VirtualSystemManagementCapabilities is wrong. I had a look into the code and think this could be easily fixed by starting return_vsm_cap() with an connect_by_classname(). Kaitlin, please can you incorporate that fix into your patch set ? Thanks. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Heidi Eckhart wrote:
There seems to be something broken by the last patch set series (applied the two from Dan, followed by the two from Kaitlin).
Before applying patch set: wbemein http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities
localhost:5988/root/virt:KVM_VirtualSystemManagementCapabilities.InstanceID="localhost.localdomain/0"
localhost:5988/root/virt:KVM_EnabledLogicalElementCapabilities.InstanceID="qemu1/0"
After applying patch set: wbemein http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities
localhost:5988/root/virt:KVM_VirtualSystemManagementCapabilities.InstanceID="ManagementCapabilities"
localhost:5988/root/virt:Xen_VirtualSystemManagementCapabilities.InstanceID="ManagementCapabilities"
localhost:5988/root/virt:KVM_EnabledLogicalElementCapabilities.InstanceID="qemu1"
The instance of Xen_VirtualSystemManagementCapabilities is wrong. I had a look into the code and think this could be easily fixed by starting return_vsm_cap() with an connect_by_classname(). Kaitlin, please can you incorporate that fix into your patch set ? Thanks.
Thanks for catching this Heidi. I didn't have a chance to look at it today, so I will take a look tomorrow. -- Kaitlin Rupert IBM Linux Technology Center karupert@us.ibm.com
participants (2)
-
Heidi Eckhart
-
Kaitlin Rupert