[PATCH] [TEST] Improve libvirt virt support check in main.py
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1224634275 25200
# Node ID 0ceafbdc8a2d17b52ca72401b7ffaeb220069b66
# Parent 868aa0f5175568c5752787c1fcbd2b1df4001aad
[TEST] Improve libvirt virt support check in main.py
If /usr/bin/qemu does not exist on the system (or if libvirt cannot find it),
it is possible to define KVM guests but not run them. Instead of returning a
error saying libvirt doesn't support the virt type, we need to return an error
that indicates a problem with libvirt was encountered.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 868aa0f51755 -r 0ceafbdc8a2d suites/libvirt-cim/main.py
--- a/suites/libvirt-cim/main.py Tue Oct 21 01:31:11 2008 -0700
+++ b/suites/libvirt-cim/main.py Tue Oct 21 17:11:15 2008 -0700
@@ -90,10 +90,15 @@
print "Cleaned log files."
def pre_check(ip, virt):
- cmd = "virsh -c %s version " % utils.virt2uri(virt)
+ cmd = "virsh -c %s list --all" % utils.virt2uri(virt)
ret, out = utils.run_remote(ip, cmd)
if ret != 0:
return "This libvirt install does not support %s" % virt
+
+ cmd = "virsh -c %s version" % utils.virt2uri(virt)
+ ret, out = utils.run_remote(ip, cmd)
+ if ret != 0:
+ return "Encountered an error querying libvirt with: %s" % cmd
cmd = "ps -ef | grep -v grep | grep cimserver"
rc, out = utils.run_remote(ip, cmd)
16 years, 2 months
[PATCH] [TEST] Clean up minor test issues with VSMS 14_define_sys_disk.py
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1224626746 25200
# Node ID 664c2fc4c52c63c5505a19c59fdc6e94c7135191
# Parent ede6419d3a506b7cb67bbb91e2d80f2010a0bc3c
[TEST] Clean up minor test issues with VSMS 14_define_sys_disk.py
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r ede6419d3a50 -r 664c2fc4c52c suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py Tue Oct 21 03:51:14 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py Tue Oct 21 15:05:46 2008 -0700
@@ -53,8 +53,8 @@
rasds = get_default_rasds(ip, virt)
- for i in range(0, len(rasds)):
- if rasds[i]['PoolID'].find('DiskPool') >= 0:
+ for i in range(len(rasds)):
+ if 'DiskPool' in rasds[i]['PoolID']:
rasds[i]['Address'] = addr
rasds[i] = inst_to_mof(rasds[i])
16 years, 2 months
[PATCH] [TEST] Updating 02_reverse.py of HostedService to also verify the association with CRS
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1224757317 25200
# Node ID c177b3f78ae1fe0b3405f9bcad8b69316f78badf
# Parent 2c77be4e041a0a8669d234d6219e1f207b6d4ed5
[TEST] Updating 02_reverse.py of HostedService to also verify the association with CRS.
Tested on KVM with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 2c77be4e041a -r c177b3f78ae1 suites/libvirt-cim/cimtest/HostedService/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Thu Oct 23 00:48:48 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Thu Oct 23 03:21:57 2008 -0700
@@ -41,7 +41,8 @@
servicelist = {"ResourcePoolConfigurationService" : "RPCS",
"VirtualSystemManagementService" : "Management Service",
- "VirtualSystemMigrationService" : "MigrationService"}
+ "VirtualSystemMigrationService" : "MigrationService",
+ "ConsoleRedirectionService" : "ConsoleRedirectionService" }
status, host_name, host_ccn = get_host_info(options.ip, virt)
if status != PASS:
@@ -72,9 +73,10 @@
logger.error("CreationClassName Error")
return FAIL
- elif name != host_name:
+ if name != host_name:
logger.error("CCN Error")
return FAIL
+ return PASS
if __name__ == "__main__":
16 years, 2 months
[PATCH] [TEST] Fix several negative test cases to work with older provider versions
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1224620362 25200
# Node ID 77c8b5955eb50d027ac97ce59f01462205b6115f
# Parent 868aa0f5175568c5752787c1fcbd2b1df4001aad
[TEST] Fix several negative test cases to work with older provider versions.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 868aa0f51755 -r 77c8b5955eb5 suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Tue Oct 21 01:31:11 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/03_ld_gi_errs.py Tue Oct 21 13:19:22 2008 -0700
@@ -133,7 +133,7 @@
from CimTest.ReturnCodes import PASS, FAIL
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, \
CIM_ERROR_GETINSTANCE
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
sup_types = ['Xen', 'KVM', 'XenFV']
@@ -207,6 +207,13 @@
global conn
conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS)
+ rev, changeset = get_provider_version(options.virt, options.ip)
+ if rev < 682:
+ old_ret = { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance (INVALID_DevID_Keyvalue)"
+ }
+ expr_values["invalid_devid_keyvalue"] = old_ret
+
global name_val
name_val = [
'CreationClassName', disk.CreationClassName,
diff -r 868aa0f51755 -r 77c8b5955eb5 suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py
--- a/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Tue Oct 21 01:31:11 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Processor/03_proc_gi_errs.py Tue Oct 21 13:19:22 2008 -0700
@@ -131,7 +131,7 @@
from XenKvmLib.test_doms import destroy_and_undefine_all
from CimTest.ReturnCodes import PASS, FAIL
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
sup_types = ['Xen', 'KVM', 'XenFV']
@@ -207,6 +207,13 @@
'INVALID_SysName_Keyvalue' : 'invalid_sysname'
}
+ rev, changeset = get_provider_version(options.virt, options.ip)
+ if rev < 682:
+ old_ret = { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance (INVALID_DevID_Keyvalue)"
+ }
+ expr_values["invalid_devid_keyvalue"] = old_ret
+
i = 0
for field1, field2 in sorted(tc_scen.items()):
retval = try_invalid_gi(i, field1, field2)
diff -r 868aa0f51755 -r 77c8b5955eb5 suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py
--- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Tue Oct 21 01:31:11 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Tue Oct 21 13:19:22 2008 -0700
@@ -152,7 +152,7 @@
from XenKvmLib.classes import get_typed_class
from CimTest.ReturnCodes import PASS, FAIL
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -246,6 +246,13 @@
'INVALID_SysName_Keyname', 'INVALID_SysName_Keyval'
]
+ rev, changeset = get_provider_version(options.virt, options.ip)
+ if rev < 682:
+ old_ret = { 'rc' : pywbem.CIM_ERR_NOT_FOUND,
+ 'desc' : "No such instance (INVALID_DevID_Keyval)"
+ }
+ expr_values["INVALID_DevID_Keyval"] = old_ret
+
sccn = get_typed_class(options.virt, 'ComputerSystem')
for classname, devid in sorted(class_id.items()):
name_val = get_name_val(classname, devid, sccn)
diff -r 868aa0f51755 -r 77c8b5955eb5 suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Oct 21 01:31:11 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Oct 21 13:19:22 2008 -0700
@@ -139,7 +139,7 @@
if revision is None or changeset is None:
return 0, "Unknown"
- revision.strip("+")
+ revision = revision.strip("+")
if revision.isdigit():
revision = int(revision)
16 years, 2 months
[PATCH] * Added association Console Redirections Service <-> Console Redirection
by Richard Maciel
# HG changeset patch
# User Richard Maciel <richardm(a)br.ibm.com>
# Date 1224700352 25200
# Node ID 35c5cab8577f353d4c4bbb7daf74fa667bcdc3cd
# Parent ec6d265c6536f88a81c5336fa97028cffd6068ad
* Added association Console Redirections Service <-> Console Redirection
Service Capabilities into the ElementCapabilities.c file
* Added ConsoleRedirectionServiceCapabilities.h to export the
get_console_rs_caps function get_console_rs_caps is not static anymore
* Added ConsoleRedirectionServiceCapabilities.h to export the
get_console_rs_caps function
* get_console_rs_caps is not static anymore
* Fixed whitespace issues
* Removed not useful CU_DEBUG calls from ElementCapabilities.c file
Signed-off-by: Richard Maciel <richardm(a)br.ibm.com>
diff -r ec6d265c6536 -r 35c5cab8577f src/Makefile.am
--- a/src/Makefile.am Wed Oct 22 09:17:23 2008 -0700
+++ b/src/Makefile.am Wed Oct 22 11:32:32 2008 -0700
@@ -21,7 +21,8 @@
Virt_VirtualSystemSnapshotService.h \
Virt_VirtualSystemSnapshotServiceCapabilities.h \
Virt_VSMigrationSettingData.h \
- Virt_ConsoleRedirectionService.h
+ Virt_ConsoleRedirectionService.h \
+ Virt_ConsoleRedirectionServiceCapabilities.h
XKUADD = $(top_builddir)/libxkutil/libxkutil.la
@@ -120,7 +121,7 @@
libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c
libVirt_AllocationCapabilities_la_LIBADD = -lVirt_DevicePool
-libVirt_ElementCapabilities_la_DEPENDENCIES = libVirt_VirtualSystemManagementCapabilities.la libVirt_EnabledLogicalElementCapabilities.la libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_VSMigrationCapabilities.la libVirt_VirtualSystemManagementService.la libVirt_VSMigrationService.la libVirt_DevicePool.la libVirt_AllocationCapabilities.la
+libVirt_ElementCapabilities_la_DEPENDENCIES = libVirt_VirtualSystemManagementCapabilities.la libVirt_EnabledLogicalElementCapabilities.la libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_VSMigrationCapabilities.la libVirt_VirtualSystemManagementService.la libVirt_VSMigrationService.la libVirt_DevicePool.la libVirt_AllocationCapabilities.la libVirt_ConsoleRedirectionService.la libVirt_ConsoleRedirectionServiceCapabilities.la
libVirt_ElementCapabilities_la_SOURCES = Virt_ElementCapabilities.c
libVirt_ElementCapabilities_la_LIBADD = -lVirt_VirtualSystemManagementCapabilities \
-lVirt_EnabledLogicalElementCapabilities \
@@ -130,7 +131,9 @@
-lVirt_AllocationCapabilities \
-lVirt_VirtualSystemManagementService \
-lVirt_VSMigrationService \
- -lVirt_DevicePool
+ -lVirt_DevicePool \
+ -lVirt_ConsoleRedirectionService \
+ -lVirt_ConsoleRedirectionServiceCapabilities
libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_VSMigrationCapabilities.la libVirt_VSMigrationSettingData.la libVirt_AllocationCapabilities.la
libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
diff -r ec6d265c6536 -r 35c5cab8577f src/Virt_ConsoleRedirectionServiceCapabilities.c
--- a/src/Virt_ConsoleRedirectionServiceCapabilities.c Wed Oct 22 09:17:23 2008 -0700
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.c Wed Oct 22 11:32:32 2008 -0700
@@ -32,6 +32,7 @@
#include "svpc_types.h"
#include "Virt_ConsoleRedirectionService.h"
+#include "Virt_ConsoleRedirectionServiceCapabilities.h"
const static CMPIBroker *_BROKER;
@@ -69,10 +70,10 @@
return s;
}
-static CMPIStatus get_console_rs_caps(const CMPIBroker *broker,
- const CMPIObjectPath *ref,
- CMPIInstance **_inst,
- bool is_get_inst)
+CMPIStatus get_console_rs_caps(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
+ CMPIInstance **_inst,
+ bool is_get_inst)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
diff -r ec6d265c6536 -r 35c5cab8577f src/Virt_ConsoleRedirectionServiceCapabilities.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.h Wed Oct 22 11:32:32 2008 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright IBM Corp. 2008
+ *
+ * Authors:
+ * Richard Maciel <richardm(a)br.ibm.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+CMPIStatus get_console_rs_caps(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
+ CMPIInstance **_inst,
+ bool is_get_inst);
+
+ /*
+ * Local Variables:
+ * mode: C
+ * c-set-style: "K&R"
+ * tab-width: 8
+ * c-basic-offset: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r ec6d265c6536 -r 35c5cab8577f src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Wed Oct 22 09:17:23 2008 -0700
+++ b/src/Virt_ElementCapabilities.c Wed Oct 22 11:32:32 2008 -0700
@@ -41,6 +41,8 @@
#include "Virt_VSMigrationCapabilities.h"
#include "Virt_AllocationCapabilities.h"
#include "Virt_DevicePool.h"
+#include "Virt_ConsoleRedirectionService.h"
+#include "Virt_ConsoleRedirectionServiceCapabilities.h"
#include "svpc_types.h"
@@ -75,7 +77,13 @@
goto out;
s = get_migration_service(ref, &_inst, _BROKER, context, false);
- } else
+ } else if (STREQC(classname, "ConsoleRedirectionServiceCapabilities")) {
+ s = get_console_rs_caps(_BROKER, ref, &_inst, true);
+ if ((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ goto out;
+
+ s = get_console_rs(ref, &_inst, _BROKER, context, false);
+ } else
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
"Not found");
@@ -113,6 +121,12 @@
goto out;
s = get_migration_caps(ref, &_inst, _BROKER, false);
+ } else if (STREQC(classname, "ConsoleRedirectionService")) {
+ s = get_console_rs(ref, &_inst, _BROKER, context, true);
+ if ((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ goto out;
+
+ s = get_console_rs_caps(_BROKER, ref, &_inst, false);
} else
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
@@ -382,22 +396,28 @@
"Xen_HostSystem",
"Xen_VirtualSystemManagementService",
"Xen_VirtualSystemMigrationService",
+ "Xen_ConsoleRedirectionService",
"KVM_HostSystem",
"KVM_VirtualSystemManagementService",
"KVM_VirtualSystemMigrationService",
+ "KVM_ConsoleRedirectionService",
"LXC_HostSystem",
"LXC_VirtualSystemManagementService",
"LXC_VirtualSystemMigrationService",
+ "LXC_ConsoleRedirectionService",
NULL
};
static char *host_caps[] = {
"Xen_VirtualSystemManagementCapabilities",
"Xen_VirtualSystemMigrationCapabilities",
+ "Xen_ConsoleRedirectionServiceCapabilities",
"KVM_VirtualSystemManagementCapabilities",
"KVM_VirtualSystemMigrationCapabilities",
+ "KVM_ConsoleRedirectionServiceCapabilities",
"LXC_VirtualSystemManagementCapabilities",
"LXC_VirtualSystemMigrationCapabilities",
+ "LXC_ConsoleRedirectionServiceCapabilities",
"Xen_AllocationCapabilities",
"KVM_AllocationCapabilities",
"LXC_AllocationCapabilities",
@@ -437,6 +457,9 @@
"Xen_VirtualSystemMigrationService",
"KVM_VirtualSystemMigrationService",
"LXC_VirtualSystemMigrationService",
+ "Xen_ConsoleRedirectionService",
+ "KVM_ConsoleRedirectionService",
+ "LXC_ConsoleRedirectionService",
NULL
};
16 years, 2 months
[PATCH] Add DisplayController device
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1224689317 25200
# Node ID a8e8c492537e87479011b393f424efd81eb5ea7d
# Parent 09bff95fb0a130f9c5e9ba45ace31de8240a9f6b
Add DisplayController device.
This represents the graphics device for the system.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 09bff95fb0a1 -r a8e8c492537e Makefile.am
--- a/Makefile.am Wed Oct 22 08:28:01 2008 -0700
+++ b/Makefile.am Wed Oct 22 08:28:37 2008 -0700
@@ -46,7 +46,8 @@
schema/ConsoleRedirectionService.mof \
schema/ConsoleRedirectionServiceCapabilities.mof \
schema/ServiceAffectsElement.mof \
- schema/KVMRedirectionSAP.mof
+ schema/KVMRedirectionSAP.mof \
+ schema/DisplayController.mof
INTEROP_MOFS = \
schema/ComputerSystem.mof \
@@ -103,7 +104,8 @@
schema/ConsoleRedirectionService.registration \
schema/ConsoleRedirectionServiceCapabilities.registration \
schema/ServiceAffectsElement.registration \
- schema/KVMRedirectionSAP.registration
+ schema/KVMRedirectionSAP.registration \
+ schema/DisplayController.registration
INTEROP_REGS = \
schema/RegisteredProfile.registration \
diff -r 09bff95fb0a1 -r a8e8c492537e libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Wed Oct 22 08:28:01 2008 -0700
+++ b/libxkutil/device_parsing.c Wed Oct 22 08:28:37 2008 -0700
@@ -443,6 +443,7 @@
goto err;
vdev->type = CIM_RES_TYPE_GRAPHICS;
+ vdev->id = strdup("graphics");
*vdevs = vdev;
diff -r 09bff95fb0a1 -r a8e8c492537e schema/DisplayController.mof
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/DisplayController.mof Wed Oct 22 08:28:37 2008 -0700
@@ -0,0 +1,17 @@
+// Copyright IBM Corp. 2007
+
+[ Provider("cmpi::Virt_Device") ]
+class Xen_DisplayController : CIM_DisplayController
+{
+};
+
+[ Provider("cmpi::Virt_Device") ]
+class KVM_DisplayController : CIM_DisplayController
+{
+};
+
+[ Provider("cmpi::Virt_Device") ]
+class LXC_DisplayController : CIM_DisplayController
+{
+};
+
diff -r 09bff95fb0a1 -r a8e8c492537e schema/DisplayController.registration
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/DisplayController.registration Wed Oct 22 08:28:37 2008 -0700
@@ -0,0 +1,5 @@
+# Copyright IBM Corp. 2008
+# Classname Namespace ProviderName ProviderModule ProviderTypes
+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
diff -r 09bff95fb0a1 -r a8e8c492537e src/Virt_Device.c
--- a/src/Virt_Device.c Wed Oct 22 08:28:01 2008 -0700
+++ b/src/Virt_Device.c Wed Oct 22 08:28:37 2008 -0700
@@ -175,6 +175,45 @@
return inst;
}
+static int graphics_set_attr(CMPIInstance *instance,
+ struct graphics_device *dev)
+{
+ int rc;
+ char *vp_str = NULL;
+
+ rc = asprintf(&vp_str, "vnc:%s", dev->port);
+ if (rc == -1) {
+ return 0;
+ }
+
+ CMSetProperty(instance, "VideoProcessor",
+ (CMPIValue *)vp_str, CMPI_chars);
+
+ free(vp_str);
+
+ return 1;
+}
+
+static CMPIInstance *graphics_instance(const CMPIBroker *broker,
+ struct graphics_device *dev,
+ const virDomainPtr dom,
+ const char *ns)
+{
+ CMPIInstance *inst;
+ virConnectPtr conn;
+
+ conn = virDomainGetConnect(dom);
+ inst = get_typed_instance(broker,
+ pfx_from_conn(conn),
+ "DisplayController",
+ ns);
+
+ if (!graphics_set_attr(inst, dev))
+ return NULL;
+
+ return inst;
+}
+
static int device_set_devid(CMPIInstance *instance,
struct virt_device *dev,
const virDomainPtr dom)
@@ -314,7 +353,12 @@
else if (dev->type == CIM_RES_TYPE_PROC) {
proc_count = dev->dev.vcpu.quantity;
continue;
- } else
+ } else if (dev->type == CIM_RES_TYPE_GRAPHICS)
+ instance = graphics_instance(broker,
+ &dev->dev.graphics,
+ dom,
+ ns);
+ else
return false;
if (!instance)
@@ -346,6 +390,8 @@
return CIM_RES_TYPE_MEM;
else if (strstr(classname, "Processor"))
return CIM_RES_TYPE_PROC;
+ else if (strstr(classname, "DisplayController"))
+ return CIM_RES_TYPE_GRAPHICS;
else
return CIM_RES_TYPE_UNKNOWN;
}
diff -r 09bff95fb0a1 -r a8e8c492537e src/svpc_types.h
--- a/src/svpc_types.h Wed Oct 22 08:28:01 2008 -0700
+++ b/src/svpc_types.h Wed Oct 22 08:28:37 2008 -0700
@@ -31,12 +31,13 @@
#define CIM_RES_TYPE_GRAPHICS 24
#define CIM_RES_TYPE_UNKNOWN 1000
-#define CIM_RES_TYPE_COUNT 4
+#define CIM_RES_TYPE_COUNT 5
const static int cim_res_types[CIM_RES_TYPE_COUNT] =
{CIM_RES_TYPE_NET,
CIM_RES_TYPE_DISK,
CIM_RES_TYPE_MEM,
CIM_RES_TYPE_PROC,
+ CIM_RES_TYPE_GRAPHICS,
};
#define CIM_VSSD_RECOVERY_NONE 2
16 years, 2 months
[PATCH] * Added association Console Redirections Service <-> Console Redirection
by Richard Maciel
# HG changeset patch
# User Richard Maciel <richardm(a)br.ibm.com>
# Date 1224683061 25200
# Node ID 74a53f67691133c24dac6ce7a67583954ea6d0e7
# Parent f7b995404a9c6a4c55374155b9d6826ad6fb2f3a
* Added association Console Redirections Service <-> Console Redirection
Service Capabilities into the ElementCapabilities.c file
* Added ConsoleRedirectionServiceCapabilities.h to export the
get_console_rs_caps function get_console_rs_caps is not static anymore
* Added ConsoleRedirectionServiceCapabilities.h to export the
get_console_rs_caps function
* get_console_rs_caps is not static anymore
* Fixed whitespace issues
* Removed not useful CU_DEBUG calls from ElementCapabilities.c file
Signed-off-by: Richard Maciel <richardm(a)br.ibm.com>
diff -r f7b995404a9c -r 74a53f676911 src/Makefile.am
--- a/src/Makefile.am Mon Oct 06 08:37:42 2008 -0700
+++ b/src/Makefile.am Wed Oct 22 06:44:21 2008 -0700
@@ -21,7 +21,8 @@
Virt_VirtualSystemSnapshotService.h \
Virt_VirtualSystemSnapshotServiceCapabilities.h \
Virt_VSMigrationSettingData.h \
- Virt_ConsoleRedirectionService.h
+ Virt_ConsoleRedirectionService.h \
+ Virt_ConsoleRedirectionServiceCapabilities.h
XKUADD = $(top_builddir)/libxkutil/libxkutil.la
@@ -119,7 +120,7 @@
libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c
libVirt_AllocationCapabilities_la_LIBADD = -lVirt_DevicePool
-libVirt_ElementCapabilities_la_DEPENDENCIES = libVirt_VirtualSystemManagementCapabilities.la libVirt_EnabledLogicalElementCapabilities.la libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_VSMigrationCapabilities.la libVirt_VirtualSystemManagementService.la libVirt_VSMigrationService.la libVirt_DevicePool.la
+libVirt_ElementCapabilities_la_DEPENDENCIES = libVirt_VirtualSystemManagementCapabilities.la libVirt_EnabledLogicalElementCapabilities.la libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_VSMigrationCapabilities.la libVirt_VirtualSystemManagementService.la libVirt_VSMigrationService.la libVirt_DevicePool.la libVirt_ConsoleRedirectionService.la libVirt_ConsoleRedirectionServiceCapabilities.la
libVirt_ElementCapabilities_la_SOURCES = Virt_ElementCapabilities.c
libVirt_ElementCapabilities_la_LIBADD = -lVirt_VirtualSystemManagementCapabilities \
-lVirt_EnabledLogicalElementCapabilities \
@@ -129,7 +130,9 @@
-lVirt_AllocationCapabilities \
-lVirt_VirtualSystemManagementService \
-lVirt_VSMigrationService \
- -lVirt_DevicePool
+ -lVirt_DevicePool \
+ -lVirt_ConsoleRedirectionService \
+ -lVirt_ConsoleRedirectionServiceCapabilities
libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_VSMigrationCapabilities.la libVirt_VSMigrationSettingData.la
libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
diff -r f7b995404a9c -r 74a53f676911 src/Virt_ConsoleRedirectionServiceCapabilities.c
--- a/src/Virt_ConsoleRedirectionServiceCapabilities.c Mon Oct 06 08:37:42 2008 -0700
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.c Wed Oct 22 06:44:21 2008 -0700
@@ -32,6 +32,7 @@
#include "svpc_types.h"
#include "Virt_ConsoleRedirectionService.h"
+#include "Virt_ConsoleRedirectionServiceCapabilities.h"
const static CMPIBroker *_BROKER;
@@ -69,10 +70,10 @@
return s;
}
-static CMPIStatus get_console_rs_caps(const CMPIBroker *broker,
- const CMPIObjectPath *ref,
- CMPIInstance **_inst,
- bool is_get_inst)
+CMPIStatus get_console_rs_caps(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
+ CMPIInstance **_inst,
+ bool is_get_inst)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
diff -r f7b995404a9c -r 74a53f676911 src/Virt_ConsoleRedirectionServiceCapabilities.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.h Wed Oct 22 06:44:21 2008 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright IBM Corp. 2008
+ *
+ * Authors:
+ * Richard Maciel <richardm(a)br.ibm.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+CMPIStatus get_console_rs_caps(const CMPIBroker *broker,
+ const CMPIObjectPath *ref,
+ CMPIInstance **_inst,
+ bool is_get_inst);
+
+ /*
+ * Local Variables:
+ * mode: C
+ * c-set-style: "K&R"
+ * tab-width: 8
+ * c-basic-offset: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r f7b995404a9c -r 74a53f676911 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Mon Oct 06 08:37:42 2008 -0700
+++ b/src/Virt_ElementCapabilities.c Wed Oct 22 06:44:21 2008 -0700
@@ -41,6 +41,8 @@
#include "Virt_VSMigrationCapabilities.h"
#include "Virt_AllocationCapabilities.h"
#include "Virt_DevicePool.h"
+#include "Virt_ConsoleRedirectionService.h"
+#include "Virt_ConsoleRedirectionServiceCapabilities.h"
#include "svpc_types.h"
@@ -75,7 +77,13 @@
goto out;
s = get_migration_service(ref, &_inst, _BROKER, context, false);
- } else
+ } else if (STREQC(classname, "ConsoleRedirectionServiceCapabilities")) {
+ s = get_console_rs_caps(_BROKER, ref, &_inst, true);
+ if ((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ goto out;
+
+ s = get_console_rs(ref, &_inst, _BROKER, context, false);
+ } else
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
"Not found");
@@ -113,6 +121,12 @@
goto out;
s = get_migration_caps(ref, &_inst, _BROKER, false);
+ } else if (STREQC(classname, "ConsoleRedirectionService")) {
+ s = get_console_rs(ref, &_inst, _BROKER, context, true);
+ if ((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ goto out;
+
+ s = get_console_rs_caps(_BROKER, ref, &_inst, false);
} else
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
@@ -382,22 +396,28 @@
"Xen_HostSystem",
"Xen_VirtualSystemManagementService",
"Xen_VirtualSystemMigrationService",
+ "Xen_ConsoleRedirectionService",
"KVM_HostSystem",
"KVM_VirtualSystemManagementService",
"KVM_VirtualSystemMigrationService",
+ "KVM_ConsoleRedirectionService",
"LXC_HostSystem",
"LXC_VirtualSystemManagementService",
"LXC_VirtualSystemMigrationService",
+ "LXC_ConsoleRedirectionService",
NULL
};
static char *host_caps[] = {
"Xen_VirtualSystemManagementCapabilities",
"Xen_VirtualSystemMigrationCapabilities",
+ "Xen_ConsoleRedirectionServiceCapabilities",
"KVM_VirtualSystemManagementCapabilities",
"KVM_VirtualSystemMigrationCapabilities",
+ "KVM_ConsoleRedirectionServiceCapabilities",
"LXC_VirtualSystemManagementCapabilities",
"LXC_VirtualSystemMigrationCapabilities",
+ "LXC_ConsoleRedirectionServiceCapabilities",
NULL,
};
@@ -434,6 +454,9 @@
"Xen_VirtualSystemMigrationService",
"KVM_VirtualSystemMigrationService",
"LXC_VirtualSystemMigrationService",
+ "Xen_ConsoleRedirectionService",
+ "KVM_ConsoleRedirectionService",
+ "LXC_ConsoleRedirectionService",
NULL
};
16 years, 2 months
[PATCH] [TEST] #2 Remove old enumerate* and getInstance in devices.py and enumclass.py
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1224666506 25200
# Node ID fc949371313630bd0d5abd47e5f15048e85c9ca8
# Parent 868aa0f5175568c5752787c1fcbd2b1df4001aad
[TEST] #2 Remove old enumerate* and getInstance in devices.py and enumclass.py
Due to these patch will hit most of tc, I will cut it into several patches:
1) Remove old enumerate* and getInstance
2) Remove CIM_Instance in devices.py and update related tc
3) Remove CIM_* class definitions and update related tc
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 868aa0f51755 -r fc9493713136 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue Oct 21 01:31:11 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Oct 22 02:08:26 2008 -0700
@@ -38,7 +38,6 @@
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from VirtLib.live import diskpool_list, virsh_version, net_list, domain_list
from XenKvmLib.vxml import PoolXML, NetXML
-from XenKvmLib.enumclass import getInstance
from VirtLib import utils
from XenKvmLib.const import default_pool_name, default_network_name
@@ -52,12 +51,13 @@
def get_cs_instance(domain_name, ip, virt='Xen'):
cs = None
+ cs_class = get_typed_class(virt, 'ComputerSystem')
try:
keys = {
'Name' : domain_name,
- 'CreationClassName' : get_typed_class(virt, 'ComputerSystem')
+ 'CreationClassName' : cs_class
}
- cs = enumclass.getInstance(ip, 'ComputerSystem', keys, virt)
+ cs = enumclass.GetInstance(ip, cs_class, keys)
if cs.Name != domain_name:
logger.error("VS %s is not found" % domain_name)
@@ -172,16 +172,15 @@
def poll_for_state_change(server, virt, dom, exp_state, timeout=30):
dom_cs = None
-
+ cs_class = get_typed_class(virt, 'ComputerSystem')
keys = {
'Name' : dom,
- 'CreationClassName' : get_typed_class(virt, 'ComputerSystem')
+ 'CreationClassName' : cs_class
}
try:
for i in range(1, (timeout + 1)):
- dom_cs = enumclass.getInstance(server, 'ComputerSystem', keys,
- virt)
+ dom_cs = enumclass.GetInstance(server, cs_class, keys)
if dom_cs is None or dom_cs.Name != dom:
continue
diff -r 868aa0f51755 -r fc9493713136 suites/libvirt-cim/lib/XenKvmLib/devices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue Oct 21 01:31:11 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Wed Oct 22 02:08:26 2008 -0700
@@ -101,36 +101,6 @@
def get_class(classname):
return eval(classname)
-def enumerate(server, basetype, keys, virt='Xen'):
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
-
- list = []
-
- #FIXME - Remove once all tests are converted for KVM
- basetype = basetype.split('_', 1)[-1]
-
- devtype = eval(get_typed_class(virt, basetype))
- try:
- names = conn.EnumerateInstanceNames(devtype.__name__)
- except pywbem.CIMError, arg:
- raise Exception("%s" % arg[1])
- return list
-
- for name in names:
- key_list = {}
- for item in keys:
- key_list[item] = name.keybindings[item]
-
- if len(key_list) == 0:
- return list
-
- list.append(devtype(server, key_list))
-
- return list
-
-
def device_of(server, key_list):
t = eval(key_list["CreationClassName"])
diff -r 868aa0f51755 -r fc9493713136 suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Tue Oct 21 01:31:11 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Wed Oct 22 02:08:26 2008 -0700
@@ -357,75 +357,6 @@
pass
-# Generic function which can be used to get the enumerate instances of any
-# class when the following fields are specified
-# classname = any class for which we want obtain the instances
-# ex: Xen_RegisteredProfile
-# keyname = The keyvalue
-# ex: InstanceID in case of Xen_RegisteredProfile
-def enumerate_inst(server, classname, virt="Xen"):
- classname = "%s" % classname
- new_classname = classname.split('_')
- if len(new_classname) == 2:
- classname = new_classname[1]
- classname = eval(get_typed_class(virt, classname))
- instances = []
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
-
- try:
- instances = conn.EnumerateInstances(classname.__name__)
- except pywbem.CIMError, arg:
- print arg[1]
- return []
-
- return instances
-
-def enumerate(server, basename, keys, virt="Xen"):
- #FIXME - Remove once all tests are converted for KVM
- basename = "%s" % basename
- new_base = basename.split('_')
- if len(new_base) == 2:
- basename = new_base[1]
-
- classname = eval(get_typed_class(virt, basename))
- instances = enumerate_inst(server, classname, virt)
-
- list = []
-
- for instance in instances:
- key_list = {}
- for item in keys:
- key_list[item] = instance[item]
-
- if len(key_list) == 0:
- return list
-
- list.append(classname(server, key_list))
-
- return list
-
-def getInstance(server, basename, keys, virt="Xen"):
- conn = pywbem.WBEMConnection('http://%s' % server,
- (Globals.CIM_USER, Globals.CIM_PASS),
- Globals.CIM_NS)
-
- #FIXME - Remove once all tests are converted for KVM
- basename = "%s" % basename
- new_base = basename.split('_')
- if len(new_base) == 2:
- basename = new_base[1]
-
- classname = eval(get_typed_class(virt, basename))
- try:
- inst = classname(server, keys)
-
- except pywbem.CIMError, arg:
- print arg[1]
- return None
-
- return inst
class CIM_CimtestClass(CIM_Instance):
def __init__(self, host, ref):
16 years, 2 months
[PATCH] Fix CRS MaxConcurrentEnabledSAPs value
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1224628392 25200
# Node ID 6b7e629b8ca10658d31b1148403a0424af0a2985
# Parent e7ffee5deb372f73fa3f315bffca69e6b21fe5b8
Fix CRS MaxConcurrentEnabledSAPs value.
The current calculation isn't valid. The profile says that the number of
enabled sessions cannot exeed the MaxConcurrentEnabledSAPs value. So anytime
you create a new guest (after the initial start), then you are exeeding this
value.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r e7ffee5deb37 -r 6b7e629b8ca1 src/Virt_ConsoleRedirectionService.c
--- a/src/Virt_ConsoleRedirectionService.c Tue Oct 21 09:22:28 2008 -0700
+++ b/src/Virt_ConsoleRedirectionService.c Tue Oct 21 15:33:12 2008 -0700
@@ -38,12 +38,13 @@
#include "Virt_HostSystem.h"
#include "Virt_ConsoleRedirectionService.h"
+#define MAX_SAP_SESSIONS 65535
+
const static CMPIBroker *_BROKER;
static CMPIStatus set_inst_properties(const CMPIBroker *broker,
const CMPIContext *context,
const CMPIObjectPath *ref,
- virConnectPtr conn,
CMPIInstance *inst)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
@@ -51,8 +52,6 @@
const char *name = NULL;
const char *ccname = NULL;
uint16_t prop_val;
- int num_defined_dom;
- int num_dom;
s = get_host_system_properties(&name, &ccname, ref, broker, context);
if (s.rc != CMPI_RC_OK) {
@@ -84,16 +83,7 @@
CMSetProperty(inst, "RedirectionServiceType",
(CMPIValue *)&array, CMPI_uint16A);
- num_dom = virConnectNumOfDomains(conn);
- num_defined_dom = virConnectNumOfDefinedDomains(conn);
-
- if (num_dom < 0)
- num_dom = 0;
-
- if (num_defined_dom < 0)
- num_defined_dom = 0;
-
- prop_val = (uint16_t) num_defined_dom + (uint16_t) num_defined_dom;
+ prop_val = (uint16_t)MAX_SAP_SESSIONS;
CMSetProperty(inst, "MaxConcurrentEnabledSAPs",
(CMPIValue *)&prop_val, CMPI_uint16);
@@ -147,7 +137,7 @@
goto out;
}
- s = set_inst_properties(broker, context, reference, conn, inst);
+ s = set_inst_properties(broker, context, reference, inst);
if (s.rc != CMPI_RC_OK)
goto out;
16 years, 2 months
[PATCH] [TEST] Update VSSD.02 to call new GetInstance
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1224470190 25200
# Node ID d83baa71965d37027e1ef08ab79c72c177c0f9b7
# Parent a3d9c0a81c27471418993b7c8f907f0b95f79e63
[TEST] Update VSSD.02 to call new GetInstance
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r a3d9c0a81c27 -r d83baa71965d suites/libvirt-cim/cimtest/VSSD/02_bootldr.py
--- a/suites/libvirt-cim/cimtest/VSSD/02_bootldr.py Wed Oct 15 19:13:10 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VSSD/02_bootldr.py Sun Oct 19 19:36:30 2008 -0700
@@ -60,8 +60,8 @@ def main():
try:
key_list = { 'InstanceID' : instIdval }
- system = enumclass.getInstance(options.ip, \
- enumclass.Xen_VirtualSystemSettingData, key_list)
+ system = enumclass.GetInstance(options.ip, \
+ "Xen_VirtualSystemSettingData", key_list)
name = system.ElementName
if name == test_dom :
16 years, 2 months