# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1210173475 25200
# Node ID a63bdadd9f6739b78b9f09f5483bb87b315a0953
# Parent d21b04d0ee82ac63d4ceb0cfc2446fee9fd50ac7
Add PoolID into DevicePool instances
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r d21b04d0ee82 -r a63bdadd9f67 src/Virt_DevicePool.c
--- a/src/Virt_DevicePool.c Wed May 07 07:25:09 2008 -0700
+++ b/src/Virt_DevicePool.c Wed May 07 08:17:55 2008 -0700
@@ -600,6 +600,9 @@ static CMPIStatus mempool_instance(virCo
CMSetProperty(inst, "InstanceID",
(CMPIValue *)id, CMPI_chars);
+ CMSetProperty(inst, "PoolID",
+ (CMPIValue *)id, CMPI_chars);
+
CMSetProperty(inst, "ResourceType",
(CMPIValue *)&type, CMPI_uint16);
@@ -635,6 +638,9 @@ static CMPIStatus procpool_instance(virC
set_units(inst, "Processors");
CMSetProperty(inst, "InstanceID",
+ (CMPIValue *)id, CMPI_chars);
+
+ CMSetProperty(inst, "PoolID",
(CMPIValue *)id, CMPI_chars);
CMSetProperty(inst, "ResourceType",
@@ -690,6 +696,8 @@ static CMPIStatus _netpool_for_network(s
CMSetProperty(inst, "InstanceID",
(CMPIValue *)str, CMPI_chars);
+ CMSetProperty(inst, "PoolID",
+ (CMPIValue *)str, CMPI_chars);
free(str);
bridge = virNetworkGetBridgeName(network);
@@ -786,6 +794,9 @@ static CMPIInstance *diskpool_from_path(
return NULL;
CMSetProperty(inst, "InstanceID",
+ (CMPIValue *)poolid, CMPI_chars);
+
+ CMSetProperty(inst, "PoolID",
(CMPIValue *)poolid, CMPI_chars);
CMSetProperty(inst, "ResourceType",
Show replies by date
Dan Smith wrote:
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1210173475 25200
# Node ID a63bdadd9f6739b78b9f09f5483bb87b315a0953
# Parent d21b04d0ee82ac63d4ceb0cfc2446fee9fd50ac7
Add PoolID into DevicePool instances
Since we had to set the InstanceID, PoolID, and ResourceType for all 4
devices, should we farm that out to a different function?
It doesn't save much really, but having the same code in 4 places looks odd.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com
KR> Since we had to set the InstanceID, PoolID, and ResourceType for
KR> all 4 devices, should we farm that out to a different function?
That was my initial thought, however the code is structured in such a
way that each of those handler functions can return more than one pool
if needed. As such, we could loop through the list at the end and
copy the InstanceID to the PoolID. However, as I explain it now, I
can't come up with a reasonable justification to not to that :)
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com