# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1196468209 28800
# Node ID 069db51711b5089167809cecc193b700aa2c6814
# Parent 075b7c91e9729f9705af3a2f4726e6883be29b59
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(a)us.ibm.com>
diff -r 075b7c91e972 -r 069db51711b5 src/Virt_EnabledLogicalElementCapabilities.c
--- a/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 14:16:17 2007 -0800
+++ b/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 16:16:49 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;
}
Show replies by date
KR> # HG changeset patch
KR> # User Kaitlin Rupert <karupert(a)us.ibm.com>
KR> # Date 1196468209 28800
KR> # Node ID 069db51711b5089167809cecc193b700aa2c6814
KR> # Parent 075b7c91e9729f9705af3a2f4726e6883be29b59
KR> ELEC cleanup - remove get_fq_devid().
KR> Removing get_fq_devid() since it's not necessary for building an
KR> InstanceID. Since this change causes error1 to be removed, I also
KR> renamed error2 to out, which conforms to the style of the other of
KR> the providers. Also, having an error2 without an error1 seemed
KR> silly.
Yep, all good things.
However, doesn't Virt_ElementCapabilities.c:cap_to_sys() need to
change to no longer expecting to parse the devid-style InstanceID?
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
Dan Smith wrote:
Yep, all good things.
However, doesn't Virt_ElementCapabilities.c:cap_to_sys() need to
change to no longer expecting to parse the devid-style InstanceID?
No, your recent patch removed that functionality. cap_to_sys() is now
a more generic function - it doesn't do any kind of checking, it just
returns a HostSystem instance.
--
Kaitlin Rupert
IBM Linux Technology Center
karupert(a)us.ibm.com
KR> No, your recent patch removed that functionality. cap_to_sys() is
KR> now a more generic function - it doesn't do any kind of checking,
KR> it just returns a HostSystem instance.
Sorry, yes, I meant cap_to_cs() :)
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
Dan Smith wrote:
KR> No, your recent patch removed that functionality.
cap_to_sys() is
KR> now a more generic function - it doesn't do any kind of checking,
KR> it just returns a HostSystem instance.
Sorry, yes, I meant cap_to_cs() :)
Yep, you're right. I must have made a mistake when I unit tested,
because my queries to EC passed before I submitted. Oops. Will send a
patch set. =)
--
Kaitlin Rupert
IBM Linux Technology Center
karupert(a)us.ibm.com