[Libvirt-cim] [PATCH] Set PoolID for CIM_NetResourceAllocationSettingData

Chip Vincent cvincent at linux.vnet.ibm.com
Mon Jul 18 13:13:28 UTC 2011


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 at 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 at 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 at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim

-- 
Chip Vincent
Open Virtualization
IBM Linux Technology Center
cvincent at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list