libvirt-cim has a very strict assumption about the presence
of a CIM_LogicalDevice class being associated to a RASD.
It is practically impossible to extend the cimtest framework
for the ConsoleRASD class without having a matching device class.
Adding a new ConsoleDisplayController class for this purpose.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
Reviewed-by: Daniel Hansel <daniel.hansel(a)linux.vnet.ibm.com>
---
schema/DisplayController.mof | 15 +++++++++++++++
schema/DisplayController.registration | 3 +++
src/Virt_Device.c | 18 ++++++++++--------
src/Virt_ElementSettingData.c | 3 +++
src/Virt_SettingsDefineState.c | 6 ++++++
src/Virt_SystemDevice.c | 3 +++
src/Virt_VSSDComponent.c | 3 +++
7 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/schema/DisplayController.mof b/schema/DisplayController.mof
index b57c9cc..8ccdc07 100644
--- a/schema/DisplayController.mof
+++ b/schema/DisplayController.mof
@@ -15,3 +15,18 @@ class LXC_DisplayController : CIM_DisplayController
{
};
+[ Provider("cmpi::Virt_Device") ]
+class Xen_ConsoleDisplayController : CIM_DisplayController
+{
+};
+
+[ Provider("cmpi::Virt_Device") ]
+class KVM_ConsoleDisplayController : CIM_DisplayController
+{
+};
+
+[ Provider("cmpi::Virt_Device") ]
+class LXC_ConsoleDisplayController : CIM_DisplayController
+{
+};
+
diff --git a/schema/DisplayController.registration
b/schema/DisplayController.registration
index de8adc9..e7e9770 100644
--- a/schema/DisplayController.registration
+++ b/schema/DisplayController.registration
@@ -3,3 +3,6 @@
Xen_DisplayController root/virt Virt_Device Virt_Device instance
KVM_DisplayController root/virt Virt_Device Virt_Device instance
LXC_DisplayController root/virt Virt_Device Virt_Device instance
+Xen_ConsoleDisplayController root/virt Virt_Device Virt_Device instance
+KVM_ConsoleDisplayController root/virt Virt_Device Virt_Device instance
+LXC_ConsoleDisplayController root/virt Virt_Device Virt_Device instance
diff --git a/src/Virt_Device.c b/src/Virt_Device.c
index aa47276..498ce2c 100644
--- a/src/Virt_Device.c
+++ b/src/Virt_Device.c
@@ -263,12 +263,12 @@ static CMPIInstance *console_instance(const CMPIBroker *broker,
conn = virDomainGetConnect(dom);
inst = get_typed_instance(broker,
pfx_from_conn(conn),
- "DisplayController",
+ "ConsoleDisplayController",
ns,
true);
if (inst == NULL) {
- CU_DEBUG("Failed to get instance for DisplayController");
+ CU_DEBUG("Failed to get instance for
ConsoleDisplayController");
return NULL;
}
@@ -541,17 +541,19 @@ static bool device_instances(const CMPIBroker *broker,
uint16_t res_type_from_device_classname(const char *classname)
{
- if (strstr(classname, "NetworkPort"))
+ if (strstr(classname, "_NetworkPort"))
return CIM_RES_TYPE_NET;
- else if (strstr(classname, "LogicalDisk"))
+ else if (strstr(classname, "_LogicalDisk"))
return CIM_RES_TYPE_DISK;
- else if (strstr(classname, "Memory"))
+ else if (strstr(classname, "_Memory"))
return CIM_RES_TYPE_MEM;
- else if (strstr(classname, "Processor"))
+ else if (strstr(classname, "_Processor"))
return CIM_RES_TYPE_PROC;
- else if (strstr(classname, "DisplayController"))
+ else if (strstr(classname, "_DisplayController"))
return CIM_RES_TYPE_GRAPHICS;
- else if (strstr(classname, "PointingDevice"))
+ else if (strstr(classname, "_ConsoleDisplayController"))
+ return CIM_RES_TYPE_CONSOLE;
+ else if (strstr(classname, "_PointingDevice"))
return CIM_RES_TYPE_INPUT;
else
return CIM_RES_TYPE_UNKNOWN;
diff --git a/src/Virt_ElementSettingData.c b/src/Virt_ElementSettingData.c
index c257710..c088e49 100644
--- a/src/Virt_ElementSettingData.c
+++ b/src/Virt_ElementSettingData.c
@@ -128,18 +128,21 @@ static char* resource_allocation_setting_data[] = {
"Xen_NetResourceAllocationSettingData",
"Xen_ProcResourceAllocationSettingData",
"Xen_GraphicsResourceAllocationSettingData",
+ "Xen_ConsoleResourceAllocationSettingData",
"Xen_InputResourceAllocationSettingData",
"KVM_DiskResourceAllocationSettingData",
"KVM_MemResourceAllocationSettingData",
"KVM_NetResourceAllocationSettingData",
"KVM_ProcResourceAllocationSettingData",
"KVM_GraphicsResourceAllocationSettingData",
+ "KVM_ConsoleResourceAllocationSettingData",
"KVM_InputResourceAllocationSettingData",
"LXC_DiskResourceAllocationSettingData",
"LXC_MemResourceAllocationSettingData",
"LXC_NetResourceAllocationSettingData",
"LXC_ProcResourceAllocationSettingData",
"LXC_GraphicsResourceAllocationSettingData",
+ "LXC_ConsoleResourceAllocationSettingData",
"LXC_InputResourceAllocationSettingData",
NULL
};
diff --git a/src/Virt_SettingsDefineState.c b/src/Virt_SettingsDefineState.c
index f30f45f..be2ded5 100644
--- a/src/Virt_SettingsDefineState.c
+++ b/src/Virt_SettingsDefineState.c
@@ -327,18 +327,21 @@ static char* logical_device[] = {
"Xen_NetworkPort",
"Xen_LogicalDisk",
"Xen_DisplayController",
+ "Xen_ConsoleDisplayController",
"Xen_PointingDevice",
"KVM_Processor",
"KVM_Memory",
"KVM_NetworkPort",
"KVM_LogicalDisk",
"KVM_DisplayController",
+ "KVM_ConsoleDisplayController",
"KVM_PointingDevice",
"LXC_Processor",
"LXC_Memory",
"LXC_NetworkPort",
"LXC_LogicalDisk",
"LXC_DisplayController",
+ "LXC_ConsoleDisplayController",
"LXC_PointingDevice",
NULL
};
@@ -350,18 +353,21 @@ static char* resource_allocation_setting_data[] = {
"Xen_ProcResourceAllocationSettingData",
"Xen_GraphicsResourceAllocationSettingData",
"Xen_InputResourceAllocationSettingData",
+ "Xen_ConsoleResourceAllocationSettingData",
"KVM_DiskResourceAllocationSettingData",
"KVM_MemResourceAllocationSettingData",
"KVM_NetResourceAllocationSettingData",
"KVM_ProcResourceAllocationSettingData",
"KVM_GraphicsResourceAllocationSettingData",
"KVM_InputResourceAllocationSettingData",
+ "KVM_ConsoleResourceAllocationSettingData",
"LXC_DiskResourceAllocationSettingData",
"LXC_MemResourceAllocationSettingData",
"LXC_NetResourceAllocationSettingData",
"LXC_ProcResourceAllocationSettingData",
"LXC_GraphicsResourceAllocationSettingData",
"LXC_InputResourceAllocationSettingData",
+ "LXC_ConsoleResourceAllocationSettingData",
NULL
};
diff --git a/src/Virt_SystemDevice.c b/src/Virt_SystemDevice.c
index 3a2f7ce..d2e526d 100644
--- a/src/Virt_SystemDevice.c
+++ b/src/Virt_SystemDevice.c
@@ -135,18 +135,21 @@ static char* part_component[] = {
"Xen_NetworkPort",
"Xen_LogicalDisk",
"Xen_DisplayController",
+ "Xen_ConsoleDisplayController",
"Xen_PointingDevice",
"KVM_Processor",
"KVM_Memory",
"KVM_NetworkPort",
"KVM_LogicalDisk",
"KVM_DisplayController",
+ "KVM_ConsoleDisplayController",
"KVM_PointingDevice",
"LXC_Processor",
"LXC_Memory",
"LXC_NetworkPort",
"LXC_LogicalDisk",
"LXC_DisplayController",
+ "LXC_ConsoleDisplayController",
"LXC_PointingDevice",
NULL
};
diff --git a/src/Virt_VSSDComponent.c b/src/Virt_VSSDComponent.c
index 378de96..35bffde 100644
--- a/src/Virt_VSSDComponent.c
+++ b/src/Virt_VSSDComponent.c
@@ -132,6 +132,7 @@ static char* part_component[] = {
"Xen_NetResourceAllocationSettingData",
"Xen_ProcResourceAllocationSettingData",
"Xen_GraphicsResourceAllocationSettingData",
+ "Xen_ConsoleResourceAllocationSettingData",
"Xen_InputResourceAllocationSettingData",
"KVM_DiskResourceAllocationSettingData",
"KVM_MemResourceAllocationSettingData",
@@ -139,12 +140,14 @@ static char* part_component[] = {
"KVM_ProcResourceAllocationSettingData",
"KVM_GraphicsResourceAllocationSettingData",
"KVM_InputResourceAllocationSettingData",
+ "KVM_ConsoleResourceAllocationSettingData",
"LXC_DiskResourceAllocationSettingData",
"LXC_MemResourceAllocationSettingData",
"LXC_NetResourceAllocationSettingData",
"LXC_ProcResourceAllocationSettingData",
"LXC_GraphicsResourceAllocationSettingData",
"LXC_InputResourceAllocationSettingData",
+ "LXC_ConsoleResourceAllocationSettingData",
NULL
};
--
1.7.9.5