[Libvirt-cim] [PATCH] Convert capacity and reserved to megabytes

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Jul 9 21:04:03 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1215636494 25200
# Node ID 5bc5dc103a569a07ee8a120285af1573f77942a3
# Parent  bbcd58a5a44acdf91df2c220f2d3698809669301
Convert capacity and reserved to megabytes.

This only affects the case where diskpool support is available in libvirt.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r bbcd58a5a44a -r 5bc5dc103a56 src/Virt_DevicePool.c
--- a/src/Virt_DevicePool.c	Thu Jul 03 10:16:40 2008 -0700
+++ b/src/Virt_DevicePool.c	Wed Jul 09 13:48:14 2008 -0700
@@ -108,6 +108,8 @@
         bool result = false;
         virStoragePoolPtr pool;
         virStoragePoolInfo info;
+        uint64_t cap;
+        uint64_t res;
 
         pool = virStoragePoolLookupByName(conn, _pool->tag);
         if (pool == NULL) {
@@ -120,11 +122,14 @@
                 goto out;
         }
 
+        cap = info.capacity >> 20;
+        res = info.allocation >> 20;
+
         CMSetProperty(inst, "Capacity",
-                      (CMPIValue *)&info.capacity, CMPI_uint64);
+                      (CMPIValue *)&cap, CMPI_uint64);
 
         CMSetProperty(inst, "Reserved",
-                      (CMPIValue *)&info.allocation, CMPI_uint64);
+                      (CMPIValue *)&res, CMPI_uint64);
 
         result = true;
  out:




More information about the Libvirt-cim mailing list