[Libvirt-cim] [PATCH] (#2) Use CIM 'AllocationUnits' to populate libvirt XML 'capacity unit' AND 'allocation unit'

Chip Vincent cvincent at linux.vnet.ibm.com
Wed May 5 17:50:02 UTC 2010


# HG changeset patch
# User Chip Vincent <cvincent at us.ibm.com>
# Date 1273081753 14400
# Node ID 293ef309c85b1b1b3551366624275d7a9bf6fb59
# Parent  22a4721a2d978fe611cb75255a094a0cc23abe5c
(#2) Use CIM 'AllocationUnits' to populate libvirt XML 'capacity unit' AND 'allocation unit'

Today, AllocationUnits only maps to capacity unit, which will leave allocation unit as the default (Kb). With this patch, both will be set to the same units.

Signed-off-by: Chip Vincent <cvincent at us.ibm.com>

diff -r 22a4721a2d97 -r 293ef309c85b libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c	Tue Mar 23 16:31:41 2010 -0700
+++ b/libxkutil/xmlgen.c	Wed May 05 13:49:13 2010 -0400
@@ -1138,6 +1138,13 @@
                 goto out;
 
         free(string);
+        if (vol->cap_units != NULL) {
+                xmlAttrPtr tmp = NULL;
+                tmp = xmlNewProp(cap, BAD_CAST "unit", BAD_CAST vol->cap_units);
+                if (tmp == NULL)
+                        goto out;
+        }
+
         ret = asprintf(&string, "%" PRIu16, vol->cap);
         if (ret == -1)
                 return XML_ERROR;




More information about the Libvirt-cim mailing list