[PATCH 0/6] Coverity cleanups
by John Ferlan
A recent Coverity version update discovered some existing issues (and some
benign cases). This patch set cleans them all up.
John Ferlan (6):
VSMS: Coverity cleanups
libxkutil:pool_parsing: Coverity cleanups
libxkutil:device_parsing: Coverity cleanups
libxkutil/xml_parse_test: Coverity cleanup
RAFP: Coverity cleanup
EAFP: Coverity cleanup
libxkutil/device_parsing.c | 41 +++++++++++++++++--------------
libxkutil/pool_parsing.c | 39 +++++++++++++++--------------
libxkutil/xml_parse_test.c | 1 +
src/Virt_ElementAllocatedFromPool.c | 6 ++++-
src/Virt_ResourceAllocationFromPool.c | 7 ++++--
src/Virt_SettingsDefineCapabilities.c | 2 +-
src/Virt_VirtualSystemManagementService.c | 11 ++++++---
7 files changed, 63 insertions(+), 44 deletions(-)
--
1.8.4.2
10 years, 6 months
How LIBVIRT-CIM actually works
by Bouabid Mohamed Amine
Hello,
I am a CIM developer and i am interested in LIBVIRT-CIM as a foundation for
a futur work, so i have some questions about its design:
How the VMs' life cycle methods are mapped with libvirt API? i mean the
methods of the class CIM_VirtualSystemManagementService (DefineSystem,
DestroySystem, ModifyResourceSettings, ModifySystemSettings,
RemoveResourceSettings)
What is the relation between the command wirsh and its XML description
with the classes CIM_VirtualSystemSettingData,
CIM_ResourceAllocationSettingData ?
Is the libvirt-cim provider invoking the virsh command ?
Thanks in advance
Amine Bouabid
10 years, 7 months
libvirt-cim compil errors
by Bouabid Mohamed Amine
Hello,
I have compile errors when installing libvirt-cim from sources on UBUNTU
13.10 (amd-64 platform)
I am using openpegasus as cimom, and i installed libcmpiutil successfully
Bellow are the errors i get after make command (i followed instructions on
the website http://wiki.libvirt.org/page/Libvirt-cim_setup)
.....
make[2]: Entering directory
`/usr/local/src/libvirt-cim/libvirt-cim-0.6.3/src'
CC Virt_VirtualSystemManagementService.lo
Virt_VirtualSystemManagementService.c: In function '_update_resources_for':
Virt_VirtualSystemManagementService.c:2936:17: warning: implicit
declaration of function 'cu_merge_instances'
[-Wimplicit-function-declaration]
s = cu_merge_instances(rasd, orig_inst);
^
Virt_VirtualSystemManagementService.c:2936:19: error: incompatible types
when assigning to type 'CMPIStatus' from type 'int'
s = cu_merge_instances(rasd, orig_inst);
^
make[2]: *** [Virt_VirtualSystemManagementService.lo] Error 1
make[2]: Leaving directory `/usr/local/src/libvirt-cim/libvirt-cim-0.6.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/libvirt-cim/libvirt-cim-0.6.3'
make: *** [all] Error 2
...
PS:
the following commands do not working:
$ hg clone http://libvirt.org/hg/libcmpiutil/
$ hg clone http://libvirt.org/hg/libvirt-cim/
the server says :
abort: HTTP Error 404: Not Found
Best Regards
Amine Bouabid
10 years, 7 months
[PATCH] spec: Fix docs/*.html packaging issue
by John Ferlan
Using a more recent rpmbuild on f20, I found that the 'make rpm' was failing:
Installed (but unpackaged) file(s) found:
/usr/share/doc/libvirt-cim-0.6.3/html/architecture.html
/usr/share/doc/libvirt-cim-0.6.3/html/downloads.html
/usr/share/doc/libvirt-cim-0.6.3/html/index.html
/usr/share/doc/libvirt-cim-0.6.3/html/intro.html
/usr/share/doc/libvirt-cim-0.6.3/html/libvirt-cim.html
/usr/share/doc/libvirt-cim-0.6.3/html/news.html
/usr/share/doc/libvirt-cim-0.6.3/html/patches.html
/usr/share/doc/libvirt-cim-0.6.3/html/platforms.html
/usr/share/doc/libvirt-cim-0.6.3/html/schema.html
make: *** [rpm] Error 1
After a bit of research - I found the following page that describes a
workaround to add "%define _unpackaged_files_terminate_build 0" to the
spec file:
http://www.oldrpm.org/hintskinks/unpackaged/
However, figuring that wasn't a great solution - I found a libvirt change
that provided a way to work around what was being seen, see:
http://www.redhat.com/archives/libvir-list/2013-November/msg00441.html
It seems as though having that %doc doc/*.html is not proper any more.
With this change I can once again build RPM packages
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
libvirt-cim.spec.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in
index c96451b..24ef280 100644
--- a/libvirt-cim.spec.in
+++ b/libvirt-cim.spec.in
@@ -60,6 +60,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libxkutil.so
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
echo %{_libdir}/cmpi > $RPM_BUILD_ROOT/etc/ld.so.conf.d/libvirt-cim.%{_arch}.conf
mkdir -p $RPM_BUILD_ROOT@INFO_STORE@
+mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-cim-%{version} libvirt-cim-docs
%clean
rm -fr $RPM_BUILD_ROOT
@@ -347,9 +348,8 @@ fi
%defattr(-, root, root)
%{_sysconfdir}/libvirt/cim
-%doc README COPYING doc/CodingStyle doc/SubmittingPatches
+%doc README COPYING doc/CodingStyle doc/SubmittingPatches libvirt-cim-docs/*
%doc base_schema/README.DMTF
-%doc doc/*.html
%{_libdir}/lib*.so*
%{_libdir}/cmpi/lib*.so*
%{_datadir}/libvirt-cim
--
1.8.4.2
10 years, 7 months
[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, 7 months