[PATCH] Set PoolID for CIM_NetResourceAllocationSettingData

# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1310931451 25200 # Node ID e8c1cdd5c9cbe887286ef169d8ff525cc9035485 # Parent 0563cf6502d4cd10418001d88c0c60b269370b3e Set PoolID for CIM_NetResourceAllocationSettingData. PoolID wasn't getting set for NETResourceAllocationSettingData. PoolID for NETResourceAllocationSettingData is set by appending "NetworkPool" to the network name. Signed-off-by: Sharad Mishra <snmishra@us.ibm.com> diff -r 0563cf6502d4 -r e8c1cdd5c9cb libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Fri Jul 15 09:03:55 2011 -0700 +++ b/libxkutil/device_parsing.c Sun Jul 17 12:37:31 2011 -0700 @@ -372,8 +372,16 @@ if (ndev->source != NULL) continue; ndev->source = get_attr_value(child, "network"); - if (ndev->source != NULL) + if (ndev->source != NULL) { + int ret = asprintf(&ndev->poolid, + "NetworkPool/%s", + ndev->source); + if (ret == -1) { + CU_DEBUG("Failed to get network" + " poolid"); + } continue; + } ndev->source = get_attr_value(child, "dev"); ndev->net_mode = get_attr_value(child, "mode"); if ((ndev->source != NULL) && (ndev->net_mode != NULL)) diff -r 0563cf6502d4 -r e8c1cdd5c9cb libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Fri Jul 15 09:03:55 2011 -0700 +++ b/libxkutil/device_parsing.h Sun Jul 17 12:37:31 2011 -0700 @@ -61,6 +61,7 @@ char *type; char *mac; char *source; + char *poolid; char *model; char *device; char *net_mode; diff -r 0563cf6502d4 -r e8c1cdd5c9cb src/Virt_RASD.c --- a/src/Virt_RASD.c Fri Jul 15 09:03:55 2011 -0700 +++ b/src/Virt_RASD.c Sun Jul 17 12:37:31 2011 -0700 @@ -401,6 +401,12 @@ (CMPIValue *)dev->dev.net.model, CMPI_chars); + if (dev->dev.net.poolid != NULL) + CMSetProperty(inst, + "PoolID", + (CMPIValue *)dev->dev.net.poolid, + CMPI_chars); + return s; }

Out of curiosity, have you run the cimtests with this change? The same sort of change for the graphics devices impacted some of the association logic and cimtests and I want to be sure this does not do the same. I'm inclined to keep the logic below 'as is' and independent of the cimtests, and just fix them separately. Thoughts? On 07/17/2011 03:49 PM, Sharad Mishra wrote:
# HG changeset patch # User Sharad Mishra<snmishra@us.ibm.com> # Date 1310931451 25200 # Node ID e8c1cdd5c9cbe887286ef169d8ff525cc9035485 # Parent 0563cf6502d4cd10418001d88c0c60b269370b3e Set PoolID for CIM_NetResourceAllocationSettingData.
PoolID wasn't getting set for NETResourceAllocationSettingData. PoolID for NETResourceAllocationSettingData is set by appending "NetworkPool" to the network name.
Signed-off-by: Sharad Mishra<snmishra@us.ibm.com>
diff -r 0563cf6502d4 -r e8c1cdd5c9cb libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Fri Jul 15 09:03:55 2011 -0700 +++ b/libxkutil/device_parsing.c Sun Jul 17 12:37:31 2011 -0700 @@ -372,8 +372,16 @@ if (ndev->source != NULL) continue; ndev->source = get_attr_value(child, "network"); - if (ndev->source != NULL) + if (ndev->source != NULL) { + int ret = asprintf(&ndev->poolid, + "NetworkPool/%s", + ndev->source); + if (ret == -1) { + CU_DEBUG("Failed to get network" + " poolid"); + } continue; + } ndev->source = get_attr_value(child, "dev"); ndev->net_mode = get_attr_value(child, "mode"); if ((ndev->source != NULL)&& (ndev->net_mode != NULL)) diff -r 0563cf6502d4 -r e8c1cdd5c9cb libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Fri Jul 15 09:03:55 2011 -0700 +++ b/libxkutil/device_parsing.h Sun Jul 17 12:37:31 2011 -0700 @@ -61,6 +61,7 @@ char *type; char *mac; char *source; + char *poolid; char *model; char *device; char *net_mode; diff -r 0563cf6502d4 -r e8c1cdd5c9cb src/Virt_RASD.c --- a/src/Virt_RASD.c Fri Jul 15 09:03:55 2011 -0700 +++ b/src/Virt_RASD.c Sun Jul 17 12:37:31 2011 -0700 @@ -401,6 +401,12 @@ (CMPIValue *)dev->dev.net.model, CMPI_chars);
+ if (dev->dev.net.poolid != NULL) + CMSetProperty(inst, + "PoolID", + (CMPIValue *)dev->dev.net.poolid, + CMPI_chars); + return s; }
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent@linux.vnet.ibm.com

Good point Chip. I have not run the entire set of cimtest with this patch. Will do and report the results later today. Regards, Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces@redhat.com wrote on 07/18/2011 06:13:28 AM:
Chip Vincent <cvincent@linux.vnet.ibm.com> Sent by: libvirt-cim-bounces@redhat.com
07/18/11 06:13 AM
Please respond to cvincent@linux.vnet.ibm.com; Please respond to List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>
To
libvirt-cim@redhat.com
cc
Subject
Re: [Libvirt-cim] [PATCH] Set PoolID for CIM_NetResourceAllocationSettingData
Out of curiosity, have you run the cimtests with this change? The same sort of change for the graphics devices impacted some of the association logic and cimtests and I want to be sure this does not do the same.
I'm inclined to keep the logic below 'as is' and independent of the cimtests, and just fix them separately.
Thoughts?
On 07/17/2011 03:49 PM, Sharad Mishra wrote:
# HG changeset patch # User Sharad Mishra<snmishra@us.ibm.com> # Date 1310931451 25200 # Node ID e8c1cdd5c9cbe887286ef169d8ff525cc9035485 # Parent 0563cf6502d4cd10418001d88c0c60b269370b3e Set PoolID for CIM_NetResourceAllocationSettingData.
PoolID wasn't getting set for NETResourceAllocationSettingData. PoolID for NETResourceAllocationSettingData is set by appending "NetworkPool" to the network name.
Signed-off-by: Sharad Mishra<snmishra@us.ibm.com>
diff -r 0563cf6502d4 -r e8c1cdd5c9cb libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Fri Jul 15 09:03:55 2011 -0700 +++ b/libxkutil/device_parsing.c Sun Jul 17 12:37:31 2011 -0700 @@ -372,8 +372,16 @@ if (ndev->source != NULL) continue; ndev->source = get_attr_value(child, "network"); - if (ndev->source != NULL) + if (ndev->source != NULL) { + int ret = asprintf(&ndev->poolid, + "NetworkPool/%s", + ndev->source); + if (ret == -1) { + CU_DEBUG("Failed to get network" + " poolid"); + } continue; + } ndev->source = get_attr_value(child, "dev"); ndev->net_mode = get_attr_value(child, "mode"); if ((ndev->source != NULL)&& (ndev->net_mode != NULL)) diff -r 0563cf6502d4 -r e8c1cdd5c9cb libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Fri Jul 15 09:03:55 2011 -0700 +++ b/libxkutil/device_parsing.h Sun Jul 17 12:37:31 2011 -0700 @@ -61,6 +61,7 @@ char *type; char *mac; char *source; + char *poolid; char *model; char *device; char *net_mode; diff -r 0563cf6502d4 -r e8c1cdd5c9cb src/Virt_RASD.c --- a/src/Virt_RASD.c Fri Jul 15 09:03:55 2011 -0700 +++ b/src/Virt_RASD.c Sun Jul 17 12:37:31 2011 -0700 @@ -401,6 +401,12 @@ (CMPIValue *)dev->dev.net.model, CMPI_chars);
+ if (dev->dev.net.poolid != NULL) + CMSetProperty(inst, + "PoolID", + (CMPIValue *)dev->dev.net.poolid, + CMPI_chars); + return s; }
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

+1 and pushed since as I mentioned before, this change is correct and we can resolve any test issues via another patch. On 07/19/2011 03:46 PM, Sharad Mishra wrote:
Good point Chip. I have not run the entire set of cimtest with this patch. Will do and report the results later today.
Regards, Sharad Mishra Open Virtualization Linux Technology Center IBM
libvirt-cim-bounces@redhat.com wrote on 07/18/2011 06:13:28 AM:
Chip Vincent <cvincent@linux.vnet.ibm.com> Sent by: libvirt-cim-bounces@redhat.com
07/18/11 06:13 AM
Please respond to cvincent@linux.vnet.ibm.com; Please respond to List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>
To
libvirt-cim@redhat.com
cc
Subject
Re: [Libvirt-cim] [PATCH] Set PoolID for CIM_NetResourceAllocationSettingData
Out of curiosity, have you run the cimtests with this change? The same sort of change for the graphics devices impacted some of the association logic and cimtests and I want to be sure this does not do the same.
I'm inclined to keep the logic below 'as is' and independent of the cimtests, and just fix them separately.
Thoughts?
On 07/17/2011 03:49 PM, Sharad Mishra wrote:
# HG changeset patch # User Sharad Mishra<snmishra@us.ibm.com> # Date 1310931451 25200 # Node ID e8c1cdd5c9cbe887286ef169d8ff525cc9035485 # Parent 0563cf6502d4cd10418001d88c0c60b269370b3e Set PoolID for CIM_NetResourceAllocationSettingData.
PoolID wasn't getting set for NETResourceAllocationSettingData. PoolID for NETResourceAllocationSettingData is set by appending "NetworkPool" to the network name.
Signed-off-by: Sharad Mishra<snmishra@us.ibm.com>
diff -r 0563cf6502d4 -r e8c1cdd5c9cb libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Fri Jul 15 09:03:55 2011 -0700 +++ b/libxkutil/device_parsing.c Sun Jul 17 12:37:31 2011 -0700 @@ -372,8 +372,16 @@ if (ndev->source != NULL) continue; ndev->source = get_attr_value(child, "network"); - if (ndev->source != NULL) + if (ndev->source != NULL) { + int ret = asprintf(&ndev->poolid, + "NetworkPool/%s", + ndev->source); + if (ret == -1) { + CU_DEBUG("Failed to get network" + " poolid"); + } continue; + } ndev->source = get_attr_value(child, "dev"); ndev->net_mode = get_attr_value(child, "mode"); if ((ndev->source != NULL)&& (ndev->net_mode != NULL)) diff -r 0563cf6502d4 -r e8c1cdd5c9cb libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Fri Jul 15 09:03:55 2011 -0700 +++ b/libxkutil/device_parsing.h Sun Jul 17 12:37:31 2011 -0700 @@ -61,6 +61,7 @@ char *type; char *mac; char *source; + char *poolid; char *model; char *device; char *net_mode; diff -r 0563cf6502d4 -r e8c1cdd5c9cb src/Virt_RASD.c --- a/src/Virt_RASD.c Fri Jul 15 09:03:55 2011 -0700 +++ b/src/Virt_RASD.c Sun Jul 17 12:37:31 2011 -0700 @@ -401,6 +401,12 @@ (CMPIValue *)dev->dev.net.model, CMPI_chars);
+ if (dev->dev.net.poolid != NULL) + CMSetProperty(inst, + "PoolID", + (CMPIValue *)dev->dev.net.poolid, + CMPI_chars); + return s; }
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent@linux.vnet.ibm.com
participants (2)
-
Chip Vincent
-
Sharad Mishra