Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
schema/ResourceAllocationSettingData.mof | 48 +++++++++++++++-------
schema/ResourceAllocationSettingData.registration | 2 -
src/Virt_ElementSettingData.c | 1 +
src/Virt_RASD.c | 49 +++++++++++++++++++----
src/Virt_SettingsDefineState.c | 1 +
src/Virt_VSSDComponent.c | 1 +
6 files changed, 78 insertions(+), 24 deletions(-)
diff --git a/schema/ResourceAllocationSettingData.mof
b/schema/ResourceAllocationSettingData.mof
index 5c76a1c..bec49b8 100644
--- a/schema/ResourceAllocationSettingData.mof
+++ b/schema/ResourceAllocationSettingData.mof
@@ -322,31 +322,49 @@ 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"),
+[Description ("KVM virtual controller device. It is identified by: "
+ "CIM_ResourceAllocationSettingData.ResourceType=1 ('Other'),
"
+
"CIM_ResourceAllocationSettingData.OtherResourceType='controller'"
+ " and CIM_ResourceAllocationSettingData.ResourceSubType set to "
+ "one of 'ide', 'fdc', 'scsi', 'sata',
'ccid', 'virtio-serial', "
+ "or 'pci'."),
Provider("cmpi::Virt_RASD")
]
class KVM_ControllerResourceAllocationSettingData : KVM_ResourceAllocationSettingData
{
- string Type;
- string Model;
-};
+ [Description ("Order in which the bus controller is encountered. "
+ "The order is controller type scoped.")]
+ uint64 Index;
-[Description ("LXC virtual controller device"),
- Provider("cmpi::Virt_RASD")
-]
-class LXC_ControllerResourceAllocationSettingData : LXC_ResourceAllocationSettingData
-{
- string Type;
+ [Description ("Optional string providing a specific model "
+ "information based on the controller type.")]
string Model;
+
+ [Description ("The 'virtio-serial' controller uses the Ports and
"
+ "Vectors to control how many devices can be connected "
+ "through the controller.")]
+ sint64 Ports;
+ sint64 Vectors;
+
+ [Description ("")]
+ uint64 Queues;
+
+ [Description ("Device master property names")]
+ string MasterProperties[];
+
+ [Description ("Device master property values")]
+ string MasterValues[];
+
+ [Description ("For controllers that are themselves devices on a "
+ "PCI or USB bus an optional element to specify the "
+ "exact relationship of the controller to its master "
+ "bus. Stored in the property and value arrays.")]
+ string AddressProperties[];
+ string AddressValues[];
};
[Description ("Xen virtual network pool settings"),
diff --git a/schema/ResourceAllocationSettingData.registration
b/schema/ResourceAllocationSettingData.registration
index 1142376..da0b7d9 100644
--- a/schema/ResourceAllocationSettingData.registration
+++ b/schema/ResourceAllocationSettingData.registration
@@ -7,7 +7,6 @@ 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
@@ -22,4 +21,3 @@ 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_ElementSettingData.c b/src/Virt_ElementSettingData.c
index c088e49..1fa81f2 100644
--- a/src/Virt_ElementSettingData.c
+++ b/src/Virt_ElementSettingData.c
@@ -137,6 +137,7 @@ static char* resource_allocation_setting_data[] = {
"KVM_GraphicsResourceAllocationSettingData",
"KVM_ConsoleResourceAllocationSettingData",
"KVM_InputResourceAllocationSettingData",
+ "KVM_ControllerResourceAllocationSettingData",
"LXC_DiskResourceAllocationSettingData",
"LXC_MemResourceAllocationSettingData",
"LXC_NetResourceAllocationSettingData",
diff --git a/src/Virt_RASD.c b/src/Virt_RASD.c
index 249e6e5..d3922cf 100644
--- a/src/Virt_RASD.c
+++ b/src/Virt_RASD.c
@@ -909,16 +909,51 @@ static CMPIStatus set_input_rasd_params(const struct virt_device
*dev,
return s;
}
-static CMPIStatus set_controller_rasd_params(const struct virt_device *dev,
+static CMPIStatus set_controller_rasd_params(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
+ const struct virt_device *dev,
CMPIInstance *inst)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
- CMSetProperty(inst, "Type",
+ CMSetProperty(inst, "OtherResourceType", "controller",
CMPI_chars);
+ CMSetProperty(inst, "ResourceSubType",
(CMPIValue *)dev->dev.controller.type, CMPI_chars);
-
- CMSetProperty(inst, "Model",
- (CMPIValue *)dev->dev.controller.model, CMPI_chars);
+ CMSetProperty(inst, "Index",
+ (CMPIValue *)dev->dev.controller.index, CMPI_uint32);
+
+ if (dev->dev.controller.model)
+ CMSetProperty(inst, "Model",
+ (CMPIValue *)dev->dev.controller.model, CMPI_chars);
+
+ if (dev->dev.controller.ports)
+ CMSetProperty(inst, "Ports",
+ (CMPIValue *)dev->dev.controller.ports, CMPI_uint32);
+
+ if (dev->dev.controller.vectors)
+ CMSetProperty(inst, "Vectors",
+ (CMPIValue *)dev->dev.controller.vectors,
+ CMPI_uint32);
+
+ if (dev->dev.controller.queues)
+ CMSetProperty(inst, "Queues",
+ (CMPIValue *)dev->dev.controller.queues, CMPI_uint32);
+
+ if (dev->dev.controller.master.ct > 0)
+ set_rasd_property_value(broker,
+ ref,
+ &dev->dev.controller.address,
+ inst,
+ "MasterProperties",
+ "MasterValues");
+
+ if (dev->dev.controller.address.ct > 0)
+ set_rasd_property_value(broker,
+ ref,
+ &dev->dev.controller.address,
+ inst,
+ "AddressProperties",
+ "AddressValues");
return s;
}
@@ -958,7 +993,7 @@ CMPIInstance *rasd_from_vdev(const CMPIBroker *broker,
type = CIM_RES_TYPE_INPUT;
base = "InputResourceAllocationSettingData";
} else if (dev->type == CIM_RES_TYPE_CONTROLLER) {
- type = CIM_RES_TYPE_CONTROLLER;
+ type = CIM_RES_TYPE_OTHER;
base = "ControllerResourceAllocationSettingData";
} else {
return NULL;
@@ -1016,7 +1051,7 @@ CMPIInstance *rasd_from_vdev(const CMPIBroker *broker,
} 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);
+ s = set_controller_rasd_params(broker, ref, dev, inst);
}
/* FIXME: Put the HostResource in place */
diff --git a/src/Virt_SettingsDefineState.c b/src/Virt_SettingsDefineState.c
index c8cda97..d5c6726 100644
--- a/src/Virt_SettingsDefineState.c
+++ b/src/Virt_SettingsDefineState.c
@@ -361,6 +361,7 @@ static char* resource_allocation_setting_data[] = {
"KVM_GraphicsResourceAllocationSettingData",
"KVM_InputResourceAllocationSettingData",
"KVM_ConsoleResourceAllocationSettingData",
+ "KVM_ControllerResourceAllocationSettingData",
"LXC_DiskResourceAllocationSettingData",
"LXC_MemResourceAllocationSettingData",
"LXC_NetResourceAllocationSettingData",
diff --git a/src/Virt_VSSDComponent.c b/src/Virt_VSSDComponent.c
index 35bffde..734271c 100644
--- a/src/Virt_VSSDComponent.c
+++ b/src/Virt_VSSDComponent.c
@@ -141,6 +141,7 @@ static char* part_component[] = {
"KVM_GraphicsResourceAllocationSettingData",
"KVM_InputResourceAllocationSettingData",
"KVM_ConsoleResourceAllocationSettingData",
+ "KVM_ControllerResourceAllocationSettingData",
"LXC_DiskResourceAllocationSettingData",
"LXC_MemResourceAllocationSettingData",
"LXC_NetResourceAllocationSettingData",
--
1.8.5.3