From: Xu Wang <gesaint(a)linux.vnet.ibm.com>
Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
schema/ResourceAllocationSettingData.mof | 27 +++++++++++++++++++++++
schema/ResourceAllocationSettingData.registration | 3 +++
src/Virt_RASD.c | 24 ++++++++++++++++++++
3 files changed, 54 insertions(+)
diff --git a/schema/ResourceAllocationSettingData.mof
b/schema/ResourceAllocationSettingData.mof
index bf1fbb6..5c76a1c 100644
--- a/schema/ResourceAllocationSettingData.mof
+++ b/schema/ResourceAllocationSettingData.mof
@@ -322,6 +322,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;
+};
+
+[Description ("KVM virtual controller device"),
+ Provider("cmpi::Virt_RASD")
+]
+class KVM_ControllerResourceAllocationSettingData : KVM_ResourceAllocationSettingData
+{
+ string Type;
+ string Model;
+};
+
+[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
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 df1e921..f75027e 100644
--- a/src/Virt_RASD.c
+++ b/src/Virt_RASD.c
@@ -903,6 +903,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);
+
+ return s;
+}
+
CMPIInstance *rasd_from_vdev(const CMPIBroker *broker,
struct virt_device *dev,
const char *host,
@@ -937,6 +951,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;
}
@@ -992,6 +1009,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 */
@@ -1126,6 +1145,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;
@@ -1163,6 +1184,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;
}
--
1.8.5.3