[Libvirt-cim] [PATCH] Add addiitonal attributes to StorageVolumeResourceAllocationSettingData
Richard Maciel
rmaciel at linux.vnet.ibm.com
Mon Aug 10 00:53:27 UTC 2009
+1
On 08/05/2009 07:16 PM, Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert<karupert at us.ibm.com>
> # Date 1245187550 25200
> # Node ID 7f946266983b4b0a7e0aa86d5a1b21b794b46a76
> # Parent 8c9cb3efdbad40890a5408267bc6a0d7b4b3de6e
> Add addiitonal attributes to StorageVolumeResourceAllocationSettingData...
>
> These attributes will be needed when defining a new image. Also, make the
> necessary changes to expose these attributes via SDC.
>
> Signed-off-by: Kaitlin Rupert<karupert at us.ibm.com>
>
> diff -r 8c9cb3efdbad -r 7f946266983b schema/ResourceAllocationSettingData.mof
> --- a/schema/ResourceAllocationSettingData.mof Wed Aug 05 14:07:00 2009 -0300
> +++ b/schema/ResourceAllocationSettingData.mof Tue Jun 16 14:25:50 2009 -0700
> @@ -296,8 +296,12 @@
> ]
> class Xen_StorageVolumeResourceAllocationSettingData : Xen_ResourceAllocationSettingData
> {
> + string VolumeName;
> string Path;
> - uint16 Type;
> + uint16 FormatType;
> + uint16 AllocationQuantity;
> + uint16 Capacity;
> + string AllocationUnits;
> };
>
> [Description ("KVM storage volume settings"),
> @@ -305,7 +309,11 @@
> ]
> class KVM_StorageVolumeResourceAllocationSettingData : KVM_ResourceAllocationSettingData
> {
> + string VolumeName;
> string Path;
> - uint16 Type;
> + uint16 FormatType;
> + uint16 AllocationQuantity;
> + uint16 Capacity;
> + string AllocationUnits;
> };
>
> diff -r 8c9cb3efdbad -r 7f946266983b src/Virt_SettingsDefineCapabilities.c
> --- a/src/Virt_SettingsDefineCapabilities.c Wed Aug 05 14:07:00 2009 -0300
> +++ b/src/Virt_SettingsDefineCapabilities.c Tue Jun 16 14:25:50 2009 -0700
> @@ -1038,7 +1038,11 @@
> struct virt_pool *pool = NULL;
> CMPIInstance *inst = NULL;
> int type = 0;
> + const char *name;
> const char *path;
> + uint16_t alloc = 0;
> + uint16_t cap = 0;
> + const char *units;
>
> switch(template_type) {
> case SDC_RASD_MIN:
> @@ -1080,11 +1084,24 @@
> goto out;
>
> CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars);
> - CMSetProperty(inst, "Type", (CMPIValue *)&type, CMPI_uint16);
> + CMSetProperty(inst, "FormatType", (CMPIValue *)&type, CMPI_uint16);
> +
> + name = "tmp.img";
> + CMSetProperty(inst, "VolumeName", (CMPIValue *)name, CMPI_chars);
>
> path = "/var/lib/libvirt/images/";
> CMSetProperty(inst, "Path", (CMPIValue *)path, CMPI_chars);
>
> + alloc = 0;
> + CMSetProperty(inst, "AllocationQuantity",
> + (CMPIValue *)&alloc, CMPI_uint16);
> +
> + cap = 0;
> + CMSetProperty(inst, "Capacity", (CMPIValue *)&cap, CMPI_uint16);
> +
> + units = "G";
> + CMSetProperty(inst, "AllocationUnits", (CMPIValue *)units, CMPI_chars);
> +
> inst_list_add(list, inst);
>
> out:
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Richard Maciel, MSc
IBM Linux Technology Center
rmaciel at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list