[PATCH] VSMS: fv_vssd_to_domain() resolve Coverity error
by John Ferlan
Coverity discovered that the free(domain->os_info.fv.arch) and then
usage later on during get_default_machine() and get_default_emulator()
calls could result in using free()'d memory.
If the 'cu_get_str_prop() failed or capsinfo == NULL, then the fv.arch
wouldn't necessarily be strdup()'d.
Passing a NULL os_info.fv_arch into the get*() API's is fine since
they'll call findDomainInfo() which can handle a NULL arch value.
Also added an initialization of val just to be safe. I don't think it's
necessary though.
---
NOTE:
I found this during a Coverity run applying the endianness patches. For
some reason Coverity "woke up" and saw this even though it hasn't found
this issue in a couple months of runs since the changes to this module
were made. See commit id '117dabb9'.
src/Virt_VirtualSystemManagementService.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Virt_VirtualSystemManagementService.c b/src/Virt_VirtualSystemManagementService.c
index d51f230..9f8b5b9 100644
--- a/src/Virt_VirtualSystemManagementService.c
+++ b/src/Virt_VirtualSystemManagementService.c
@@ -464,7 +464,7 @@ static int fv_vssd_to_domain(CMPIInstance *inst,
{
int ret = 1;
int retr;
- const char *val;
+ const char *val = NULL;
const char *domtype = NULL;
const char *ostype = "hvm";
struct capabilities *capsinfo = NULL;
@@ -494,6 +494,7 @@ static int fv_vssd_to_domain(CMPIInstance *inst,
}
free(domain->os_info.fv.arch);
+ domain->os_info.fv.arch = NULL;
retr = cu_get_str_prop(inst, "Arch", &val);
if (retr != CMPI_RC_OK) {
if (capsinfo != NULL) { /* set default */
--
1.8.3.1
10 years, 11 months
[PATCH 00/20] REWORK/PARIAL: Changes to solve unsupported tag issue
by John Ferlan
This is a *partial rework* of Xu Wang's patches sent last month:
https://www.redhat.com/archives/libvirt-cim/2013-October/msg00081.html
Although not the complete set of changes - it's a good stopping point
insomuch as it handles the "others" parsing. If this looks good, I can
push it, then work through the changes to write the xml.
I have run all the changes through cimtest - even with the patches on the
list from Viktor. No new issues are found.
Changes to the original patches
1. I rebased to top of tree as of today (11/14/13)
2. I reworked each of the patches to only add the 'others' to the
particular *_device structure. This was done to be able to show
the progression and to ensure I didn't forget something
2a. This found that there needed to be a cleanup_vcpu_device() and
cleanup_mem_device() since both added "others" to their structure
but were never cleaned up during cleanup_virt_device()
2b. I did not see a need for "others" in "vnc_device" and "sdl_device"
2c. I added a cleanup_others() call in _get_dominfo()
3. I added fetch_device_address_from_others() to replace parse_device_address().
This bridges the "gap" bewteen the parsing of the <address> tag that was
recently added and the 'others' parsing code which didn't handle it.
All I did was traverse the others list looking for parent name and id
match for TYPE_PROP entries. Essentially anything inside of <address...>
us then copied in to name/value structure managed by devaddr. Once the last
caller of parse_device_address() was removed, that function went away
4. I changed the type for unknown from CIM_RES_TYPE_UNKNOWN to
CIM_RES_TYPE_UNKDEV. Turns out the former is used in other contexts
and if/when cleanup_virt_device() was called from one of those contexts
the result was a core in cimprovagt. This was seen in the cimtest
for VirtualSystemManagementService 16_removeresource.py.
4. Various "bug fixes" based on a coverity run and what I saw in code
review from Boris.
- Original code had a "ddev->disk_type == DISK_PHY;"
- There was a "if (node->name == NULL)" check in parse_graphics_device
after "else if (STREQC(gdev->type, "pty")) {" which coverity flagged
as unnecessary since earlier code assumed node->name != NULL
- In parse_os() there was a "STREQC(dominfo->os_info.pv.type, "linux")"
which needed a "dominfo->os_info.pv.type &&" prior to it since the value
could have been NULL according to a check earlier in the routine
- I added the "free(dev->name);" to cleanup_unknown_device()
- Checks for others->{name|parent_name|value} were removed. Since the
structures are calloc()'d and free(NULL) does nothing, this is OK.
Xu Wang (20):
Add others member for saving unsupported tag and unknown device
Add others and unknown_device clean up
Add basic operations for reading data from xml node
Fix xml parsing algorithm for parse_fs_device()
Fix xml parsing algorithm for parse_block_device()
Fix xml parsing algorithm for parse_vsi_device()
Fix xml parsing algorithm for parse_net_device()
Fix xml parsing algorithm for parse_vcpu_device()
Fix xml parsing algorithm for parse_emu_device()
Fix xml parsing algorithm for parse_mem_device()
Fix xml parsing algorithm for parse_console_device()
Fix xml parsing algorithm for parse_graphics_device()
Fix xml parsing algorithm for parse_input_device()
Add parse_unknown_device()
Add parse_devices() for unknown type in get_dominfo_from_xml()
Fix xml parsing algorithm in parse_domain()
Fix xml parsing algorithm in parse_os()
Fix xml parsing algorithm in parse_features()
Add dup function for device copy
Add type CIM_RES_TYPE_DELETED and modify type as it after resource_del
libxkutil/device_parsing.c | 2055 ++++++++++++++++++++++++-----
libxkutil/device_parsing.h | 58 +
src/Virt_VirtualSystemManagementService.c | 2 +-
src/svpc_types.h | 2 +
4 files changed, 1774 insertions(+), 343 deletions(-)
--
1.8.3.1
11 years
[PATCH] RFC: Use of root/interop instead of root/PG_InterOp
by John Ferlan
As a result of an issue I recently discovered where the most recent
update to tog-pegasus on my Fedora 19 box, I have found a set of changes
that will will allow my Fedora system to operate as before (mostly). The
following is a link to the original discovery - there's 5 followups that
are worth reading too.
https://www.redhat.com/archives/libvirt-cim/2013-November/msg00008.html
I'm not 100% sure the changes contained in these patches will work for
all the cases, hence the request for comments as opposed to let's get
this in ASAP. There may also be some extraneous adjustments - I was
hoping that I could get the make install environment work, but I'm not
sure I got everything right there either.
At the very least the 'make rpm' will build an rpm which I can install
and use.
These changes do work for my Fedora 19 environment with tog-pegasus
2.12.1-8 installed.
One innocent bystander in all this is the FilterList. It happened to
use 'InstanceID' from the base/parent class CIM_ManagedElement. If I've
read the description correctly here:
http://schemas.dmtf.org/wbem/cim-html/2.34.0/CIM_ManagedElement.html
The usage of InstanceID for libvirt-cim would need to go through some
sort of renaming within the MOF, but it wasn't really clear "how" that
would be accomplished. As an alternative, I created an InstanceUUID
property which does work for me, although I'm not sure it's the right
solution. The downside to doing this is that the cimtest (and I'm sure
any other libvirt-cim client) requires a change to grab the FilterList
data from the new different property. This creates an incompatibility
situation which I'm not in favor of.
Hopefully someone knows the right incantation to tell the FilterList.mof
that we're going to use InstanceID
---
Makefile.am | 29 ++++++++++++++++++++++++-----
libvirt-cim.spec.in | 27 ++++++++++++++++++++++-----
provider-register.sh | 18 +++++++++++++++++-
schema/FilterList.mof | 4 ++++
src/Virt_FilterList.c | 2 +-
5 files changed, 68 insertions(+), 12 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 9e8e96b..69b65cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -78,6 +78,9 @@ INTEROP_MOFS = \
$(top_srcdir)/schema/ReferencedProfile.mof \
$(top_srcdir)/schema/AllocationCapabilities.mof
+# The PGINTEROP_MOFS are used by tog-pegasus up through version 2.12.1
+# If support for versions prior to 2.12.1 is removed, then these defs
+# can go away
PGINTEROP_MOFS = \
$(top_srcdir)/schema/RegisteredProfile.mof \
$(top_srcdir)/schema/ElementConformsToProfile.mof \
@@ -157,6 +160,9 @@ INTEROP_REGS = \
$(top_srcdir)/schema/ElementConformsToProfile.registration \
$(top_srcdir)/schema/ReferencedProfile.registration
+# The PGINTEROP_REGS are used by tog-pegasus up through version 2.12.1
+# If support for versions prior to 2.12.1 is removed, then these defs
+# can go away
PGINTEROP_REGS = \
$(top_srcdir)/schema/RegisteredProfile.registration \
$(top_srcdir)/schema/ElementConformsToProfile.registration \
@@ -181,7 +187,8 @@ EXTRA_DIST = schema $(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS) \
.changeset .revision \
examples/diskpool.conf
-# If Pegasus isn't the CIMOM target, then remove the PG_InterOp namespace from the appropriate files
+# If Pegasus isn't the CIMOM target, then remove the PG_InterOp namespace
+# from the appropriate files
install-data-local:
$(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)"
$(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(MOFS)
@@ -189,11 +196,12 @@ install-data-local:
$(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(INTEROP_MOFS)
$(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(INTEROP_REGS)
if [[ @CIMSERVER@ != pegasus ]]; then \
- sed -i '/^# --/,/^# --!/d' $(subst $(top_srcdir)/schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_REGS)); \
+ sed -i '/^# --/,/^# --!/d' $(subst $(top_srcdir)/schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_REGS)); \
+ sed -i '/^# --/,/^# --!/d' $(subst $(top_srcdir)/schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_MOFS)); \
fi
uninstall-local:
- @list='$(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS)'; \
+ @list='$(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS) $(PGINTEROP_REGS) $(PGINTEROP_MOFS)'; \
for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;'`; \
echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
@@ -209,8 +217,19 @@ postinstall:
$(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))
+ #
+ # We need to check the version - if we're not yet at 2.12.1, then
+ # we'll register at root/PG_InterOp; otherwise, using just the above
+ # registration should be sufficient. The actual cutoff root/PG_InterOp
+ # not being valid was 2.12.1-5; however, --version doesn't give us that
+ # level of detail. The Pegasus docs imply that usage of root/interop was
+ # valid as of 2.12.0.
+ #
if [[ @CIMSERVER@ = pegasus ]]; then \
- $(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)); \
+ CIMVER=`@CIMSERVER@ --version | awk -F. '{printf("%02d%02d%02d\n", $1,$2,$3); }'` \
+ if [[ $CIMVER -lt 021201 ]]; then \
+ $(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 \
fi
virsh -v | grep -q '^0.3' && cp examples/diskpool.conf $(DISK_POOL_CONFIG) || true
mkdir -p $(INFO_STORE)
@@ -220,7 +239,7 @@ preuninstall:
$(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 \
- $(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)); \
+ $(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/libvirt-cim.spec.in b/libvirt-cim.spec.in
index c96451b..0eab663 100644
--- a/libvirt-cim.spec.in
+++ b/libvirt-cim.spec.in
@@ -199,6 +199,10 @@ rm -fr $RPM_BUILD_ROOT
%{_datadir}/%{name}/ReferencedProfile.mof \\\
%{_datadir}/%{name}/AllocationCapabilities.mof
+# NOTE: As of Pegasus 2.12.1-5, using root/PG_InterOp will no longer be
+# valid. All mofs can just compile into root/interop. However, we
+# need to keep these here for 'historical purposes'.
+#
%define PGINTEROP_REG %{_datadir}/%{name}/RegisteredProfile.registration \\\
%{_datadir}/%{name}/ElementConformsToProfile.registration \\\
%{_datadir}/%{name}/ReferencedProfile.registration
@@ -267,12 +271,12 @@ fi
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
if [ "`systemctl is-active tog-pegasus.service 2> /dev/null`" = "active" ]
then
- systemctl restart tog-pegasus.service
+ systemctl restart tog-pegasus.service > /dev/null 2>&1
fi
if [ "`systemctl is-active sblim-sfcb.service 2> /dev/null`" = "active" ]
then
- systemctl restart sblim-sfcb.service
+ systemctl restart sblim-sfcb.service > /dev/null 2>&1
fi
%else
/etc/init.d/tog-pegasus condrestart
@@ -286,9 +290,22 @@ then
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n root/interop \
-r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true
- %{_datadir}/%{name}/provider-register.sh -t pegasus \
- -n root/PG_InterOp \
- -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true
+ #
+ # We need to check the version - if we're not yet at 2.12.1, then
+ # we'll register at root/PG_InterOp; otherwise, using just the above
+ # registration should be sufficient. The actual cutoff root/PG_InterOp
+ # not being valid was 2.12.1-5; however, --version doesn't give us that
+ # level of detail. The Pegasus docs imply that usage of root/interop was
+ # valid as of 2.12.0.
+ #
+ CIMVER=`/usr/sbin/cimserver --version | \
+ awk -F. '{printf("%02d%02d%02d\n", $1,$2,$3); }'`
+ if [ $CIMVER -lt 021201 ]
+ then
+ %{_datadir}/%{name}/provider-register.sh -t pegasus \
+ -n root/PG_InterOp \
+ -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true
+ fi
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n root/cimv2\
-r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
diff --git a/provider-register.sh b/provider-register.sh
index abe8e95..f66fe54 100755
--- a/provider-register.sh
+++ b/provider-register.sh
@@ -274,7 +274,23 @@ pegasus_install()
chatter Registering providers with $state cimserver '('$version')'
chatter Installing mofs into namespace $namespace from path $mofpath
$CIMMOF -uc -I $mofpath -n $namespace $mymofs &&
- $CIMMOF -uc -n root/PG_Interop $_REGFILENAME
+ #
+ # If compare_version returns false here (e.g. $version is less than
+ # "2.12.1", then we will compile into root/PG_InterOp; otherwise,
+ # compile into root/interop. As of 2.12.1-5 using the PG_InterOp
+ # will fail. Since we cannot get that level of detail out of the
+ # --version output, "assume" that 2.12.1 -> 2.12.1-4 will be able
+ # to use the new namespace. The Pegasus docs imply as of 2.12.0 using
+ # root/interop was preferred.
+ #
+ if compare_version "$version" "2.12.1"
+ then
+ chatter Installing $_REGFILENAME into root/PG_InterOp
+ $CIMMOF -uc -n root/PG_Interop $_REGFILENAME
+ else
+ chatter Installing $_REGFILENAME into root/interop
+ $CIMMOF -uc -n root/interop $_REGFILENAME
+ fi
else
echo "Failed to build pegasus registration MOF." >&2
return 1
diff --git a/schema/FilterList.mof b/schema/FilterList.mof
index 7339db6..b7d8551 100644
--- a/schema/FilterList.mof
+++ b/schema/FilterList.mof
@@ -10,4 +10,8 @@ class KVM_FilterList : CIM_FilterList
MinValue(-1000),
MaxValue(1000)]
sint16 Priority = 500;
+
+ [Description("The network filter UUID value. This value was formerly "
+ "stored in the InstanceID field.")]
+ string InstanceUUID;
};
diff --git a/src/Virt_FilterList.c b/src/Virt_FilterList.c
index b248004..6a9112e 100644
--- a/src/Virt_FilterList.c
+++ b/src/Virt_FilterList.c
@@ -76,7 +76,7 @@ static CMPIInstance *convert_filter_to_instance(
CMSetProperty(inst, "SystemName", sys_name, CMPI_chars);
CMSetProperty(inst, "SystemCreationClassName", sys_ccname, CMPI_chars);
CMSetProperty(inst, "Name", (CMPIValue *)filter->name, CMPI_chars);
- CMSetProperty(inst, "InstanceID", (CMPIValue *)filter->uuid,
+ CMSetProperty(inst, "InstanceUUID", (CMPIValue *)filter->uuid,
CMPI_chars);
CMSetProperty(inst, "Direction", (CMPIValue *)&direction, CMPI_uint16);
--
1.8.3.1
11 years, 1 month
[PATCH] live.full_hostname: Adjust mechanism to get FQDN
by John Ferlan
Using just socket.gethostbyaddr(socket.gethostname())[0] caused some
issues recently in one of my DHCP testing environments. Breaking down
the calls showed the following:
>>> socket.gethostname()
'dhcp-186-211.bos.redhat.com'
>>> socket.gethostbyname("dhcp-186-211.bos.redhat.com")
'10.16.186.211'
>>> socket.gethostbyaddr(socket.gethostname())[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
socket.herror: [Errno 1] Unknown host
While just a socket.gethostname() could have worked, using the
socket.getfqdn() seemed to be safer just in case.
---
lib/VirtLib/live.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/VirtLib/live.py b/lib/VirtLib/live.py
index c929e71..6a10474 100644
--- a/lib/VirtLib/live.py
+++ b/lib/VirtLib/live.py
@@ -100,6 +100,9 @@ def hostname(server):
return out
def full_hostname(server):
- """To return the fully qualifiec domain name(FQDN) of the system"""
+ """To return the fully qualified domain name(FQDN) of the system"""
- return socket.gethostbyaddr(socket.gethostname())[0]
+ if socket.getfqdn().find('.') >= 0:
+ return socket.getfqdn()
+ else:
+ return socket.gethostbyaddr(socket.gethostname())[0]
--
1.8.3.1
11 years, 1 month
[PATCH] libxkutil: Added missing address element for filesystem 'disk'
by Viktor Mihajlovski
This was an omission from the original patch series adding
device address support. For disks of type filesystem the addresses
were parsed however not written back.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
libxkutil/xmlgen.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c
index 40e2905..931f0c9 100644
--- a/libxkutil/xmlgen.c
+++ b/libxkutil/xmlgen.c
@@ -342,6 +342,9 @@ static const char *disk_fs_xml(xmlNodePtr root, struct disk_device *dev)
return XML_ERROR;
xmlNewProp(tmp, BAD_CAST "dir", BAD_CAST dev->virtual_dev);
+ if (dev->address.ct > 0)
+ return device_address_xml(fs, &dev->address);
+
return NULL;
}
--
1.7.9.5
11 years, 1 month
[PATCH 0/5] Persistent Device Address Support
by Viktor Mihajlovski
This patch set is adding persistent device address support to
libvirt-cim. Now it is possible to specify device bus addresses
as supported by libvirt when defining or modifying domains.
This applies on top of current master but I would recommend
to first apply the little/big endian series posted last week.
Reviewed-by: Daniel Hansel <daniel.hansel(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Viktor Mihajlovski (5):
RASD/schema: Add properties for device address representation
libxkutil: Support for device addresses
RASD: Support for device address properties
VSMS: Support for device addresses
VSMS: Improve device cleanup
libxkutil/device_parsing.c | 113 +++++++++++++++++++++++++++++
libxkutil/device_parsing.h | 11 +++
libxkutil/xmlgen.c | 28 +++++++
schema/ResourceAllocationSettingData.mof | 12 +++
src/Virt_RASD.c | 73 +++++++++++++++++++
src/Virt_VirtualSystemManagementService.c | 86 +++++++++++++++-------
6 files changed, 295 insertions(+), 28 deletions(-)
--
1.7.9.5
11 years, 1 month
[RESEND PATCH 0/3] libvirt-cim: Fix provider registration
by Viktor Mihajlovski
The following series fixes two issues in the provider registration
process of the libvirt-cim RPM package.
First, the RPM scriptlets didn't properly reflect the invocation
sequence during an RPM upgrade. This is fixed by the first patch.
Further, the registration using wildcards (*.mof) failed because of
an inter-MOF depedency. Fixed by the second patch.
Finally, the class deletion sequence in provider-register.sh was
prone to failure, resulting in residual entries in the Pegasus
class repository. Addressed by third patch.
Note: since the redhat.com mailing lists are bouncing my emails
I am sending from a different account temporarily until this is
resolved.
Viktor Mihajlovski (3):
build: Fix incorrect provider registration in upgrade path
build: Fix provider registration issues
schema: Fix class removal with Pegasus
libvirt-cim.spec.in | 282 ++++++++++++++++++++++++++++++++++++++++----------
provider-register.sh | 8 +-
2 files changed, 231 insertions(+), 59 deletions(-)
--
1.7.9.5
11 years, 1 month
[PATCH 0/2] cimtest support for consoles
by Viktor Mihajlovski
This series extends the KVM cimtests with the verification of
the console instrumentation.
If the tested libvirt-cim provider has the necessary release
level, the test domains are instantiated with a console.
The other patch deals with the fact that certain device types
(like graphics) are supported on s390.
I ran the tests on an x86 system as well seeing no regressions,
but an independent test run would be welcome...
Viktor Mihajlovski (2):
cimtest: Adding support for ConsoleRASD
cimtest: Fix s390 failures
.../cimtest/ElementSettingData/01_forward.py | 8 +++--
.../cimtest/HostSystem/02_hostsystem_to_rasd.py | 2 ++
.../cimtest/HostSystem/04_hs_to_EAPF.py | 24 +++++++++----
.../cimtest/HostedAccessPoint/01_forward.py | 5 +++
.../cimtest/HostedAccessPoint/02_reverse.py | 5 +++
.../cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py | 5 +++
.../cimtest/KVMRedirectionSAP/02_ipv6_support.py | 5 +++
.../02_guest_add_mod_rem_rasd_ind.py | 9 +++--
.../RedirectionService/03_RedirectionSAP_errs.py | 5 +++
.../ResourceAllocationFromPool/01_forward.py | 3 ++
.../ResourceAllocationFromPool/02_reverse.py | 3 ++
.../cimtest/ServiceAccessBySAP/01_forward.py | 5 +++
.../cimtest/ServiceAccessBySAP/02_reverse.py | 6 ++++
.../cimtest/ServiceAffectsElement/01_forward.py | 6 ++--
.../cimtest/ServiceAffectsElement/02_reverse.py | 12 ++++---
.../libvirt-cim/cimtest/SystemDevice/01_forward.py | 16 +++++++--
suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py | 11 ++++--
suites/libvirt-cim/cimtest/VSSD/07_autostart.py | 5 +++
.../01_forward.py | 4 ++-
.../02_reverse.py | 9 +++--
suites/libvirt-cim/lib/XenKvmLib/devices.py | 6 ++++
suites/libvirt-cim/lib/XenKvmLib/pool.py | 4 ++-
suites/libvirt-cim/lib/XenKvmLib/rasd.py | 21 ++++++++++-
suites/libvirt-cim/lib/XenKvmLib/vsms.py | 36 +++++++++++++++++++
suites/libvirt-cim/lib/XenKvmLib/vxml.py | 38 ++++++++++++++------
25 files changed, 215 insertions(+), 38 deletions(-)
--
1.7.9.5
11 years, 1 month
[PATCH V2 00/48] Solution to solve unsupported tag missing issue
by Xu Wang
What's new in V2:
1. Rebase commit to the current upstream.
2. Update console device support.
3. Add id and parent_id to handle there are more than two sub-node but
with the same issue.
4. Add status (ACTIVE/INACTIVE) to identify if a node was fetched.
5. Adjust the original designing plan. Now after fetched a node from link
list just change its status from ACTIVE to INACTIVE instead of delete
it. Purpose of this update is to make link list keep the structure of
xml and regenerate xml easily.
6. Necessary comments added.
7. Add function (compare_param_int/compare_param_str) to adjust the result
of comparation (if any parameter is NULL/-1 the comparation result is
TRUE instead of FALSE.
8. Bugs fixing. Such as attribute 'arch' under <type> of <os>, <dev> of
<target> parsing, etc.
--------------------------------------------------------------------------
These patches are based on commit 04bfeb825e5e155ffa72119253de608ccf3bd72b.
So I may need more work on rebasing.
Most of bugs reported recently are about some tags libvirt-cim doesn't
support will be dropped after resource updated. So a new member was added
into every virt_device and domain structure. And a new structure named
unknown device was added to save those tags new added.
The original implementaion is reading every member of virt_device structure
from xml and save it. But the defect of this is some tags were not a
member of virt_device were dropped. After resource updated, every data
in the virt_device will be used to regenerate new xml. Hence the tags
unsupported above, disappeared.
So I added a member into every virt_device and domain structure, 'others'.
It's a link list and used to save all data read from xml. Another new
structure 'unknown_device' was added to save data except libvirt-cim could
recognize.
The new implementation is, firstly parse_*_device() could read all nodes and
properties from xml and save them into 'others' link list. Then every member
of virt_device will fetch data from others link list and save it. So that
nodes in the 'others' link list could be saved until they are used to re-
generate xml.
After resource updating finished, libvirt-cim will call *_xml() to generate
xml. The new process of generating xml like this, firstly all data in the
members of virt_device will be restored into 'others' link list, then a
function (others_to_xml) will use this link list to generate xml.
Some points I have updated,
1. 'others' link list has to be processed in _get_proc_device() and
_get_mem_device(). They should be copied into new data structure.
2. If resource updating happened, others field should be cleared
because this device has been changed and they are useless.
Besides above some logic may be a little strange or boring. Implemention
like that is just to be compatible with upper layer functions (to make
changes as less as possible). After keep a balance I decided to devide
the whole xml into several parts:
<domain>------------------------others in domain to save unsupported sub-nodes of domain
-some fields (devices, mem, vcpu...) will be skiped because
-they have their own parsing functions.
<name>xxx</name>
<uuid>xxx</uuid>
<vcpu>xxx</vcpu>
<mem>xxx</mem>
<devices>
<disk>xxx</disk>------- others in virt_device to save unsupported tags of this device
<emulator>xxx</emulator>
...----------- unknown_device to save unsupported device except like <disk>,<emu>,etc.
</devices>
</domain>
Hence, all nodes read from xml will be restored after xml generation.
Xu Wang (48):
Add others member for saving unsupported tag and unknown device
Add others and unknown_device clean up
Add basic operations for reading data from xml node
Fix xml parsing algorithm for parse_fs_device()
Fix xml parsing algorithm for parse_block_device()
Fix xml parsing algorithm for parse_vsi_device()
Fix xml parsing algorithm for parse_net_device()
Fix xml parsing algorithm for parse_vcpu_device()
Fix xml parsing algorithm for parse_emu_device()
Fix xml parsing algorithm for parse_mem_device()
Fix xml parsing algorithm for parse_console_device()
Fix xml parsing algorithm for parse_graphics_device()
Fix xml parsing algorithm for parse_input_device()
Add parse_unknown_device()
Add parse_devices() for unknown type in get_dominfo_from_xml()
Fix xml parsing algorithm in parse_domain()
Fix xml parsing algorithm in parse_os()
Fix xml parsing algorithm in parse_feature()
Add dup function for device copy
Add type CIM_RES_TYPE_DELETED and modify type as it after
resource_del
Add basic functions about converting others link list to xml
Fix xml generation algorithm in console_xml()
Fix xml generation algorithm in disk_block_xml()
Fix xml generation algorithm in disk_file_xml()
Fix xml generation algorithm in disk_fs_xml()
Fix xml generation algorithm in set_net_vsi()
Fix xml generation algorithm in set_net_source()
Fix xml generation algorithm in bridge_net_to_xml()
Fix xml generation algorithm in net_xml()
Fix xml generation algorithm in vcpu_xml()
Fix xml generation algorithm in cputune_xml()
Fix xml generation algorithm in mem_xml()
Fix xml generation algorithm in emu_xml()
Fix xml generation algorithm in graphics_vnc_xml()
Fix xml generation algorithm in input_xml()
Fix xml generation algorithm in system_xml()
Fix xml generation algorithm in _xenpv_os_xml()
Fix xml generation algorithm in _fv_bootlist_xml()
Fix xml generation algorithm in _xenfv_os_xml()
Fix xml generation algorithm in _kvm_os_xml()
Fix xml generation algorithm in _lxc_os_xml()
Fix xml generation algorithm in os_xml()
Fix xml generation algorithm in features_xml()
Add functions for xml generation of unknown devices
Fix xml generation algorithm in system_to_xml()
Add cleanup_others() calling during rasd_to_vdev()
Add others handling in _get_mem_device()
Add dup_others() into _get_proc_device()
libxkutil/device_parsing.c | 1959 ++++++++++++++++++++++-----
libxkutil/device_parsing.h | 64 +
libxkutil/xmlgen.c | 2103 +++++++++++++++++++++++------
src/Virt_VirtualSystemManagementService.c | 20 +-
src/svpc_types.h | 1 +
5 files changed, 3445 insertions(+), 702 deletions(-)
11 years, 1 month
[PATCH 0/4] Little/big endian and memory fixes.
by Viktor Mihajlovski
This series addresses a number of problems encountered testing
libvirt-cim on s390.
The first three patches deal with endian-unsafe memory access,
which of course only surfaces on big endian systems.
The last patch addresses a potential heap corruption/double
free issue also hit during testing.
Thilo Boehm (2):
FilterEntry: Fix endianness issues
VSSM: Fix endianness issue in domain properties
Viktor Mihajlovski (2):
VSDC: Fix endianess issues
libxkutil: clean entire device structure to avoid memory corruption
libxkutil/device_parsing.c | 4 +--
libxkutil/device_parsing.h | 8 ++---
src/Virt_FilterEntry.c | 46 +++++++++++++++--------------
src/Virt_SettingsDefineCapabilities.c | 16 +++++-----
src/Virt_VirtualSystemManagementService.c | 4 +--
5 files changed, 40 insertions(+), 38 deletions(-)
--
1.7.9.5
11 years, 1 month