[Libvirt-cim] [PATCH 3 of 3] Expose LXC_ProcRASD so that the scheduling parameters are visible

Dan Smith danms at us.ibm.com
Wed Oct 15 18:12:39 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1224094346 25200
# Node ID 0f39ab1ee83013c43586d05b2ae0803b935ea693
# Parent  c9faf7ec24553425ffc3068b0b8a19b9b83ee99b
Expose LXC_ProcRASD so that the scheduling parameters are visible

Also make ProcRASD not set the VirtualQuantity field if it's zero,
so that LXC_ProcRASD's value appears undefined instead of 0.

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r c9faf7ec2455 -r 0f39ab1ee830 schema/ResourceAllocationSettingData.registration
--- a/schema/ResourceAllocationSettingData.registration	Wed Oct 15 09:48:53 2008 -0700
+++ b/schema/ResourceAllocationSettingData.registration	Wed Oct 15 11:12:26 2008 -0700
@@ -10,3 +10,4 @@
 KVM_MemResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
 LXC_MemResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
 LXC_DiskResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
+LXC_ProcResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
diff -r c9faf7ec2455 -r 0f39ab1ee830 src/Virt_RASD.c
--- a/src/Virt_RASD.c	Wed Oct 15 09:48:53 2008 -0700
+++ b/src/Virt_RASD.c	Wed Oct 15 11:12:26 2008 -0700
@@ -306,8 +306,13 @@
                 CMSetProperty(inst, "Limit",
                               (CMPIValue *)&dev->dev.mem.maxsize, CMPI_uint64);
         } else if (dev->type == CIM_RES_TYPE_PROC) {
-                CMSetProperty(inst, "VirtualQuantity",
-                              (CMPIValue *)&dev->dev.vcpu.quantity, CMPI_uint64);
+                if (dev->dev.vcpu.quantity > 0) {
+                        CMSetProperty(inst,
+                                      "VirtualQuantity",
+                                      (CMPIValue *)&dev->dev.vcpu.quantity,
+                                      CMPI_uint64);
+                }
+
                 set_proc_rasd_params(broker, ref, host, inst);
         }
 




More information about the Libvirt-cim mailing list