As it stands now - this will end up in one "final" mega patch. As it
turned out - there's no way one can add the mofs without affecting how
cimtest runs. Naturally vice versa applies - the code cannot be there
first and then the mofs just appear. So pretty much everything in your
patches 2-5 will end up in one patch from me (unfortunately).
On 03/25/2014 03:20 AM, Xu Wang wrote:
Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
schema/ResourceAllocationSettingData.mof | 27 +++++++++++++++++++++
schema/ResourceAllocationSettingData.registration | 3 ++
src/Virt_RASD.c | 24 ++++++++++++++++++
3 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/schema/ResourceAllocationSettingData.mof
b/schema/ResourceAllocationSettingData.mof
index 6b649de..3512170 100644
--- a/schema/ResourceAllocationSettingData.mof
+++ b/schema/ResourceAllocationSettingData.mof
@@ -328,6 +328,33 @@ class LXC_InputResourceAllocationSettingData :
LXC_ResourceAllocationSettingData
string BusType;
};
+[Description ("Xen virtual controller device"),
+ Provider("cmpi::Virt_RASD")
+]
+class Xen_ControllerResourceAllocationSettingData : Xen_ResourceAllocationSettingData
+{
+ string Type;
+ string Model;
+};
Does Xen have one? I'm following Boris' advice and removing Xen and LXC
defs, see:
http://www.redhat.com/archives/libvirt-cim/2014-March/msg00021.html
+
+[Description ("KVM virtual controller device"),
+ Provider("cmpi::Virt_RASD")
+]
+class KVM_ControllerResourceAllocationSettingData : KVM_ResourceAllocationSettingData
+{
+ string Type;
+ string Model;
As you'll see I have many more definitions.
+};
+
+[Description ("LXC virtual controller device"),
+ Provider("cmpi::Virt_RASD")
+]
+class LXC_ControllerResourceAllocationSettingData : LXC_ResourceAllocationSettingData
+{
+ string Type;
+ string Model;
+};
+
[Description ("Xen virtual network pool settings"),
Provider("cmpi::Virt_RASD")
]
diff --git a/schema/ResourceAllocationSettingData.registration
b/schema/ResourceAllocationSettingData.registration
index b969bfe..1142376 100644
--- a/schema/ResourceAllocationSettingData.registration
+++ b/schema/ResourceAllocationSettingData.registration
@@ -7,6 +7,7 @@ Xen_MemResourceAllocationSettingData root/virt Virt_RASD Virt_RASD
instance
Xen_GraphicsResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
Xen_InputResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
Xen_ConsoleResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
+Xen_ControllerResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
Again no Xen/LXC
KVM_DiskResourceAllocationSettingData root/virt Virt_RASD Virt_RASD
instance
KVM_NetResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
KVM_ProcResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
@@ -14,9 +15,11 @@ KVM_MemResourceAllocationSettingData root/virt Virt_RASD Virt_RASD
instance
KVM_GraphicsResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
KVM_InputResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
KVM_ConsoleResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
+KVM_ControllerResourceAllocationSettingData 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
LXC_GraphicsResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
LXC_InputResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
LXC_ConsoleResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
+LXC_ControllerResourceAllocationSettingData root/virt Virt_RASD Virt_RASD instance
diff --git a/src/Virt_RASD.c b/src/Virt_RASD.c
index abfb09f..594fe83 100644
--- a/src/Virt_RASD.c
+++ b/src/Virt_RASD.c
@@ -915,6 +915,20 @@ static CMPIStatus set_input_rasd_params(const struct virt_device
*dev,
return s;
}
+static CMPIStatus set_controller_rasd_params(const struct virt_device *dev,
+ CMPIInstance *inst)
+{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ CMSetProperty(inst, "Type",
+ (CMPIValue *)dev->dev.controller.type, CMPI_chars);
+
+ CMSetProperty(inst, "Model",
+ (CMPIValue *)dev->dev.controller.model, CMPI_chars);
+
There will be many more fields to handle here.
+ return s;
+}
+
CMPIInstance *rasd_from_vdev(const CMPIBroker *broker,
struct virt_device *dev,
const char *host,
@@ -949,6 +963,9 @@ CMPIInstance *rasd_from_vdev(const CMPIBroker *broker,
} else if (dev->type == CIM_RES_TYPE_INPUT) {
type = CIM_RES_TYPE_INPUT;
base = "InputResourceAllocationSettingData";
+ } else if (dev->type == CIM_RES_TYPE_CONTROLLER) {
+ type = CIM_RES_TYPE_CONTROLLER;
+ base = "ControllerResourceAllocationSettingData";
} else {
return NULL;
}
@@ -1004,6 +1021,8 @@ CMPIInstance *rasd_from_vdev(const CMPIBroker *broker,
s = set_input_rasd_params(dev, inst);
} else if (dev->type == CIM_RES_TYPE_CONSOLE) {
s = set_console_rasd_params(dev, inst);
+ } else if (dev->type == CIM_RES_TYPE_CONTROLLER) {
+ s = set_controller_rasd_params(dev, inst);
}
/* FIXME: Put the HostResource in place */
@@ -1138,6 +1157,8 @@ CMPIrc res_type_from_rasd_classname(const char *cn, uint16_t
*type)
*type = CIM_RES_TYPE_IMAGE;
else if (STREQ(base, "ConsoleResourceAllocationSettingData"))
*type = CIM_RES_TYPE_CONSOLE;
+ else if (STREQ(base, "ControllerResourceAllocationSettingData"))
+ *type = CIM_RES_TYPE_CONTROLLER;
else
goto out;
@@ -1175,6 +1196,9 @@ CMPIrc rasd_classname_from_type(uint16_t type, const char
**classname)
case CIM_RES_TYPE_INPUT:
*classname = "InputResourceAllocationSettingData";
break;
+ case CIM_RES_TYPE_CONTROLLER:
+ *classname = "ControllerResourceAllocationSettingData";
+ break;
default:
rc = CMPI_RC_ERR_FAILED;
}