[PATCH 0/3] Console Fixes and Enhancements
by Viktor Mihajlovski
Enabling cimtest for the Console RASDs required a few
improvements. The XML generation code was simplified,
a logical device class for consoles had to be added and
a bug in the KVM redirection service was fixed.
Viktor Mihajlovski (3):
libxkutil: Simplify XML handling of consoles
Virt_Device: Add a device class for consoles
KVMRedirectionSAP: Only return redirection SAPs for VNC graphics
libxkutil/device_parsing.c | 12 +-----
libxkutil/xmlgen.c | 76 ---------------------------------
schema/DisplayController.mof | 15 +++++++
schema/DisplayController.registration | 3 ++
src/Virt_Device.c | 18 ++++----
src/Virt_ElementSettingData.c | 3 ++
src/Virt_KVMRedirectionSAP.c | 23 ++++++----
src/Virt_SettingsDefineState.c | 6 +++
src/Virt_SystemDevice.c | 3 ++
src/Virt_VSSDComponent.c | 3 ++
10 files changed, 59 insertions(+), 103 deletions(-)
--
1.7.9.5
11 years, 2 months
[PATCH] Make sure provider revision is a number
by Viktor Mihajlovski
Commit 4a7fae9 changed the revision returned by get_provider_version
to a string. However, the revision has to be a number because (since
git is used) it's basically the number of commits in HEAD.
Comparing a string against an int in Python 2.x will always result in
the string value being greater than the int value. Since there
are a lot of compares against revision numbers all over the test
scripts, this change is probably the most economic.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
Not being a python guy I got wacked myself when I was testing
my (soon to come) cimtest changes against a pre-console libvirt-cim.
'1272' > 1276 silently returned True leading to epic failures :-(
suites/libvirt-cim/lib/XenKvmLib/const.py | 4 +++-
suites/libvirt-cim/lib/XenKvmLib/reporting.py | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/suites/libvirt-cim/lib/XenKvmLib/const.py b/suites/libvirt-cim/lib/XenKvmLib/const.py
index a8d0254..a454b2f 100755
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py
@@ -179,7 +179,9 @@ def get_provider_version(virt, ip):
revision = revision.strip("+")
if revision.isdigit():
revision = int(revision)
+ else:
+ raise Exception("revision %s is not a digit", revision)
- return str(revision), str(changeset)
+ return revision, changeset
diff --git a/suites/libvirt-cim/lib/XenKvmLib/reporting.py b/suites/libvirt-cim/lib/XenKvmLib/reporting.py
index 67ec974..88375b0 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/reporting.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/reporting.py
@@ -101,7 +101,7 @@ def get_env_data(ip, virt):
rev, changeset = get_provider_version(virt, ip)
cimtest_revision, cimtest_changeset = get_cimtest_version()
- lc_ver = "Libvirt-cim revision: %s\nLibvirt-cim changeset: %s\n" % \
+ lc_ver = "Libvirt-cim revision: %d\nLibvirt-cim changeset: %s\n" % \
(rev, changeset)
cimtest_ver = "Cimtest revision: %s\nCimtest changeset: %s\n" % \
(cimtest_revision, cimtest_changeset)
--
1.7.9.5
11 years, 2 months
[PATCH] cimtest: Add type == 'bridge' handling branch in vsms_util.py
by Xu Wang
The name of interface should be read based on the type of it. There
are two basic types for interface device (bridge and network). The
name should be fetched in different way. I don't clear if Xen could
support network type so I didn't make any change for it and just
enhanced the logic in "virt == 'KVM'". I'll submit a set of patches
and they solved XFAIL of VirtualSystemManagementService/
22_addmulti_brg_interface.py. So it's necessary to fix it.
Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py
index 075c09f..7839a38 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py
@@ -189,10 +189,19 @@ def add_net_res(server, service, virt, cxml, vssd_ref, nasd, attr):
% attr['nmac'])
if virt == "KVM":
- name = cxml.get_value_xpath(
+ if attr['ntype'] == "network":
+ name = cxml.get_value_xpath(
'/domain/devices/interface/source/@network[. = "%s"]'
% attr['net_name'])
-
+ elif attr['ntype'] == "bridge":
+ br = get_bridge_from_network_xml(attr['net_name'], server, virt)
+ name = cxml.get_value_xpath(
+ '/domain/devices/interface/source/@bridge[. = "%s"]'
+ % br)
+ if name != None:
+ name = attr['net_name']
+ else:
+ logger.error("Unrecognized interface type: %s" % type)
else:
# For Xen, network interfaces are converted to bridge interfaces.
br = get_bridge_from_network_xml(attr['net_name'], server, virt)
--
1.7.1
11 years, 2 months
[PATCHv2 0/7] Support for full function consoles
by Viktor Mihajlovski
Motivation: the current libvirt-cim support for consoles is
very limited in that it doesn't allow to specify the target
and source types supported by libvirt. Having full support
of the libvirt console feature is however mandatory for
architectures like s390.
The current implementation using a Graphics_RASD to represent
consoles cannot easily be extended without breaking the existing
implementation (or without being entirely unusable).
Therefore a new RASD class is added to represent consoles in
the model. Since there's no SVPC resource type for a console
we use the combination of ResourceType = 1 (Other) and
OtherResourceType = "console" for the new RASD instances.
In order to be backward compatible, the only console type supported
by older libvirt-cim versions (target type 'pty') will still
be returned as Graphics_RASD. In the long run, this should be
deprecated.
V2 Changes:
- Squashed old patches 2 and 5 and moved that one to position 4
- Fix double frees
- Fix NULL pointer accesses
- Improve error handling
- Improve error messages
- Some cosmetic changes
Thilo Boehm (5):
schema: New SVPC types for chardev/consoles
libxkutil: Console Support
RASD: Schema and Provider Support for Console RASDs
VSMS: Support for domains with console devices
VSMS: add default console
Viktor Mihajlovski (2):
VSMS: Set resource types for default devices
Device: CIM_LogicalDevice for consoles
libxkutil/device_parsing.c | 314 ++++++++++++++++++-
libxkutil/device_parsing.h | 43 ++-
libxkutil/xmlgen.c | 191 ++++++++++-
schema/ResourceAllocationSettingData.mof | 246 ++++++++++++++-
schema/ResourceAllocationSettingData.registration | 5 +-
src/Virt_Device.c | 33 ++
src/Virt_RASD.c | 149 ++++++++-
src/Virt_VirtualSystemManagementService.c | 348 +++++++++++++++++++--
src/svpc_types.h | 102 +++++-
9 files changed, 1392 insertions(+), 39 deletions(-)
--
1.7.9.5
11 years, 3 months
[PATCH 0/2] Remove memory leaks in XML device parsing
by Viktor Mihajlovski
Discovered a few leaks in device_parsing.c running xml_parse_test under
valgrind. The series applies on master as well as on top of the
last series I sent out.
Viktor Mihajlovski (2):
libxkutil: Plug memory leaks in device parsing
xml_parse_test: Call cleanup_dominfo before exiting
libxkutil/device_parsing.c | 30 ++++++++++++++++++++----------
libxkutil/xml_parse_test.c | 2 ++
2 files changed, 22 insertions(+), 10 deletions(-)
--
1.7.9.5
11 years, 3 months
[PATCH 0/8] Support for full function consoles
by Viktor Mihajlovski
Motivation: the current libvirt-cim support for consoles is
very limited in that it doesn't allow to specify the target
and source types supported by libvirt. Having full support
of the libvirt console feature is however mandatory for
architectures like s390.
The current implementation using a Graphics_RASD to represent
consoles cannot easily be extended without breaking the existing
implementation (or without being entirely unusable).
Therefore a new RASD class is added to represent consoles in
the model. Since there's no SVPC resource type for a console
we use the combination of ResourceType = 1 (Other) and
OtherResourceType = "console" for the new RASD instances.
In order to be backward compatible, the only console type supported
by older libvirt-cim versions (target type 'pty') will still
be returned as Graphics_RASD. In the long run, this should be
deprecated.
Thilo Boehm (6):
schema: Add CIM_ResourceAllocationSettingData for console resources
schema: New SVPC types for chardev/consoles
libxkutil: Console Support
RASD: Provider Support for Console RASDs
VSMS: Support for domains with console devices
VSMS: add default console
Viktor Mihajlovski (2):
VSMS: Set resource types for default devices
Device: CIM_LogicalDevice for consoles
libxkutil/device_parsing.c | 316 ++++++++++++++++++-
libxkutil/device_parsing.h | 43 ++-
libxkutil/xmlgen.c | 191 +++++++++++-
schema/ResourceAllocationSettingData.mof | 247 ++++++++++++++-
schema/ResourceAllocationSettingData.registration | 5 +-
src/Virt_Device.c | 33 ++
src/Virt_RASD.c | 148 ++++++++-
src/Virt_VirtualSystemManagementService.c | 336 +++++++++++++++++++--
src/svpc_types.h | 102 ++++++-
9 files changed, 1384 insertions(+), 37 deletions(-)
--
1.7.9.5
11 years, 3 months
[PATCH 0/2] Make cimtest more s390-friendly
by Viktor Mihajlovski
cimtest currently doesn't work too well on s390 systems,
the two main areas of failure are the attempt to
define systems with IDE hard drivers and VGA graphics,
both not supported on this host type.
Changing from IDE to virtio disks fixed a lot of the
test FAILs with no adverse impacts to the x86 runs
on our systems at least. It would be nice if somebody
could verify this.
Further, we do not add the graphics RASD to the default
guest definition if the hypervisor host is an s390
system. In principle, we could have removed the graphics
RASD altogether, because libvirt-cim will define a
default graphics device for x86 but since it is only a
small change, it seems safer to do it this way.
Thilo Boehm (1):
cimtest: Use vda instead of hda for disk RASDs
Viktor Mihajlovski (1):
cimtest: Don't generate graphics for s390
.../cimtest/ElementAllocatedFromPool/01_forward.py | 2 +-
.../cimtest/ElementAllocatedFromPool/02_reverse.py | 2 +-
.../ElementAllocatedFromPool/03_reverse_errs.py | 2 +-
.../ElementAllocatedFromPool/04_forward_errs.py | 2 +-
.../cimtest/HostedAccessPoint/01_forward.py | 2 +-
.../cimtest/HostedAccessPoint/02_reverse.py | 2 +-
.../02_guest_add_mod_rem_rasd_ind.py | 2 +-
.../cimtest/ServiceAccessBySAP/01_forward.py | 2 +-
.../cimtest/ServiceAccessBySAP/02_reverse.py | 2 +-
.../cimtest/SettingsDefine/01_forward.py | 2 +-
.../cimtest/SettingsDefine/02_reverse.py | 2 +-
.../cimtest/SettingsDefine/03_sds_fwd_errs.py | 2 +-
.../cimtest/SettingsDefine/04_sds_rev_errs.py | 2 +-
.../libvirt-cim/cimtest/SystemDevice/01_forward.py | 2 +-
.../libvirt-cim/cimtest/SystemDevice/03_fwderrs.py | 2 +-
suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py | 2 +-
.../13_refconfig_additional_devs.py | 2 +-
.../14_define_sys_disk.py | 2 +-
.../30_dynamic_disk_mod.py | 2 +-
.../02_reverse.py | 2 +-
.../03_vssdc_fwd_errs.py | 2 +-
suites/libvirt-cim/lib/XenKvmLib/const.py | 2 +-
suites/libvirt-cim/lib/XenKvmLib/vsms.py | 2 +-
suites/libvirt-cim/lib/XenKvmLib/vxml.py | 5 +++--
suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py | 7 +++++++
25 files changed, 33 insertions(+), 25 deletions(-)
--
1.7.9.5
11 years, 3 months
[PATCH] REDSAP: Fix double exception possibilty
by John Ferlan
Test failed with the following:
--------------------------------------------------------------------
KVMRedirectionSAP - 01_enum_KVMredSAP.py: FAIL
ERROR - Failed to enumerate the class of KVM_KVMRedirectionSAP
ERROR - Exception details: Got more than one record for: test_kvmredsap_dom
ERROR - Exception details: 'ElementName' Value Mismatch, Expected 5988:-1, Got 5988:0
ERROR - Exception: Failed to verify information for the defined dom:test_kvmredsap_dom
--------------------------------------------------------------------
There are two exceptions listed because the 'enum_redsap()' method was
perusing a list, finding a match, declaring success, and continuing to
peruse the list. Then found another match declared an exception and returned
with status = PASS.
The caller just checked the status before continuing.
This patch doesn't resolve the underlying cause, but does avoid the call to
'verify_redsap_values()' which will also fail...
---
NOTE: I was able to reproduce the initial exception if I run this test
very quickly two times in succession. I debated adding a 'sleep(5)' (or
similar) prior to the end of the test to ensure whatever teardown was
not occurring in a timely manner (by the networking code) could happen,
but I believe that wouldn't necessarily fix the problem - just make it
less likely to happen. The resource in question is a specific port in the
underlying VNC technology. That code may have built in 'safeguards' to help
with throttling, e.g. reuse a recently used port thus make it unreliable for
the test to rely on getting the "first" port. Since the test isn't designed
to run twice in a row, I don't think it's a real issue...
.../libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py b/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py
index 6001405..af9b5c6 100644
--- a/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py
+++ b/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py
@@ -50,7 +50,7 @@ test_dom = 'test_kvmredsap_dom'
def enum_redsap(server, virt, classname):
redsap_insts = { }
- status = FAIL
+ status = PASS
try:
redsap_list = EnumInstances(server, classname)
@@ -58,11 +58,11 @@ def enum_redsap(server, virt, classname):
if redsap.SystemName == test_dom:
if redsap.Classname not in redsap_insts.keys():
redsap_insts[redsap.Classname] = redsap
- status = PASS
else:
raise Exception("Got more than one record for: %s" \
% test_dom)
except Exception, details:
+ status = FAIL
logger.error(CIM_ERROR_ENUMERATE, classname)
logger.error("Exception details: %s", details)
@@ -139,7 +139,7 @@ def main():
raise Exception("Failed to verify information for the defined "\
"dom:%s" % test_dom)
- # For now verifying KVMRedirectoinSAP only for a defined LXC guest.
+ # For now verifying KVMRedirectionSAP only for a defined LXC guest.
# Once complete Graphics support for LXC is in, we need to verify the
# KVMRedirectionSAP for a running guest.
if virt == 'LXC':
@@ -150,10 +150,10 @@ def main():
status = vsxml.cim_start(server)
if not ret:
raise Exception("Failed to start the dom: %s" % test_dom)
+ action_start = True
status, redsap_inst = enum_redsap(server, virt, classname)
if status != PASS:
- action_start = True
raise Exception("Failed to get information for running dom:%s" \
% test_dom)
@@ -162,7 +162,6 @@ def main():
status = verify_redsap_values(val_list, redsap_inst, classname)
if status != PASS:
- action_start = True
raise Exception("Failed to verify information for running dom:%s" \
% test_dom)
--
1.8.3.1
11 years, 3 months
[PATCH] build: Don't use /bin/sh unconditionally
by Viktor Mihajlovski
provider-register.sh implicitly assumes that the shell has bash-like
capabilities. On systems like Ubuntu this is not the case leading
to a make postinstall failure when used with Pegasus.
Changing the script shebang to /bin/bash to make this explicit.
Further replace occurrences of sh to $(SHELL) in the Makefile
invocations of provider-register.sh.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
May not be relevant as libvirt-cim/pegasus isn't part of Debian-ish distros
as far as I am aware of. But it is a constant source of annoyance...
Makefile.am | 18 +++++++++---------
provider-register.sh | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 63ed3c7..9e8e96b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -201,26 +201,26 @@ uninstall-local:
done
preinstall:
- sh -x base_schema/install_base_schema.sh `pwd`/base_schema
+ $(SHELL) -x base_schema/install_base_schema.sh `pwd`/base_schema
# Un/Register the providers and class definitions from/to the current CIMOM.
# @CIMSERVER@ is set by the configure script
postinstall:
- sh provider-register.sh -v -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS))
- sh provider-register.sh -v -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS))
- sh provider-register.sh -v -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS))
+ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS))
+ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS))
+ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS))
if [[ @CIMSERVER@ = pegasus ]]; then \
- sh provider-register.sh -v -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \
+ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \
fi
virsh -v | grep -q '^0.3' && cp examples/diskpool.conf $(DISK_POOL_CONFIG) || true
mkdir -p $(INFO_STORE)
preuninstall:
- sh provider-register.sh -v -d -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS))
- sh provider-register.sh -v -d -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS))
- sh provider-register.sh -v -d -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS))
+ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS))
+ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS))
+ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS))
if [[ @CIMSERVER@ = pegasus ]]; then \
- sh provider-register.sh -v -d -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \
+ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \
fi
rpm: clean
diff --git a/provider-register.sh b/provider-register.sh
index b907df1..b730ef3 100755
--- a/provider-register.sh
+++ b/provider-register.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# $Id$
# ==================================================================
# Copyright IBM Corp. 2005
--
1.7.9.5
11 years, 3 months
[PATCH 0/3] Address 'cimtest' issues
by John Ferlan
These patches resolve some issues with test logging and there's one test
fix that I've had just hanging around that I figure I'd put out there since
there was some activity.
John Ferlan (3):
Allow adding bridged network for running domain
Remove extranous or unnecessary parameter from error messages
Ensure get_provider_version() returns strings as expected
.../cimtest/Profile/03_rprofile_gi_errs.py | 2 +-
suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py | 2 +-
.../cimtest/ResourcePool/02_rp_gi_errors.py | 2 +-
.../22_addmulti_brg_interface.py | 9 +++++++--
suites/libvirt-cim/lib/XenKvmLib/const.py | 2 +-
suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 23 +++++++++++++++++-----
6 files changed, 29 insertions(+), 11 deletions(-)
--
1.8.3.1
11 years, 3 months