From cvincent at linux.vnet.ibm.com Tue Nov 1 17:25:05 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 01 Nov 2011 13:25:05 -0400 Subject: [Libvirt-cim] [PATCH] Fix qos bug when retrieving SettingsDefineCapabilites RASDs for primordial Network/0 pool Message-ID: <4EB02B71.3000008@linux.vnet.ibm.com> Mmmm.. another patch did not get forwarded to my email. Anyway, +1 this patch because it solves the crashes and does not make the current hackery any worse. Please get the libvirt API version of this feature on the list so we can rip and replace QoS. Thanks. -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From snmishra at us.ibm.com Tue Nov 1 17:34:35 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Tue, 1 Nov 2011 10:34:35 -0700 Subject: [Libvirt-cim] Error doing make install for libvirt-cim In-Reply-To: References: <4EADFFB8.1040009@linux.vnet.ibm.com> Message-ID: Deepak, I have not tried Ubuntu. But have used RH and SuSE, and never had to do any of the manual steps you mentioned here. I recommend, on a fresh system installing libcmpiutil and then get libvirt-cim and run - 1. autoconfiscate.sh 2. configure 3. make Let me know if that does not work for you. Regards, Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 10/31/2011 01:21:26 AM: > Deepak Shetty > Sent by: libvirt-cim-bounces at redhat.com > > 10/31/2011 01:21 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > Wayne Xia > > cc > > List for discussion and development of libvirt CIM > > Subject > > Re: [Libvirt-cim] Error doing make install for libvirt-cim > > It looks like there is a bug in the ' make install' > I had to manually do the steps below to copy the library onto the > right path, before make install could succed > Took clues from the libxkutil.a library install that happens just > before this error. > > cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src/ > > 1) /usr/bin/install -c .libs/ > libVirt_VirtualSystemSnapshotService.so.0.5.14 /home/dpkshetty/usr/ > lib/cmpi/libVirt_VirtualSystemSnapshotService.so.0.5.14 > 2) cd /home/dpkshetty/usr/lib/cmpi/ > 3) ln -s -f? libVirt_VirtualSystemSnapshotService.so.0.5.14 > libVirt_VirtualSystemSnapshotService.so.0 > 4) ln -s -f? libVirt_VirtualSystemSnapshotService.so.0.5.14 > libVirt_VirtualSystemSnapshotService.so > 5) cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src/ > 6) /usr/bin/install -c .libs/ > libVirt_VirtualSystemSnapshotService.lai /home/dpkshetty/usr/lib/ > cmpi/libVirt_VirtualSystemSnapshotService.la > 7) /usr/bin/install -c .libs/libVirt_VirtualSystemSnapshotService.a > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > 8) chmod 644 /home/dpkshetty/usr/lib/cmpi/ > libVirt_VirtualSystemSnapshotService.a > 9) ranlib /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > 10) ldconfig -n /home/dpkshetty/usr/lib/cmpi > > After this 'make install' worked fine. > > On Mon, Oct 31, 2011 at 10:45 AM, Deepak Shetty wrote: > Hello Wayne, > ? Thanks for the pointer , will try. > But i am on Ubuntu and did not understand why I should be doing a 'make rpm'. > Also i have sfcb ( Lite weight broker ) installed, will that not > work with libvirt-cim ? Is CIMOM pegasus a must ? > > On Mon, Oct 31, 2011 at 7:24 AM, Wayne Xia wrote: > pls have a try for following commands with CIMOM tog-pegasus installed: > ./autoconfiscate.sh > ./configure > make rpm > > > > ? 2011-10-29 19:46, Deepak Shetty ??: > Hi, > ? I am getting the following error while doing ' make install' for > libvirt-cim. Can someone pls help provide some pointers on what could be > wrong here ? > > .... > .... > > test -z "/home/dpkshetty/usr/lib/cmpi" || /bin/mkdir -p > "/home/dpkshetty/usr/lib/cmpi" > ?/bin/bash ../libtool ? --mode=install /usr/bin/install -c > libVirt_ComputerSystem.la libVirt_Device.la libVirt_RASD.la > libVirt_HostSystem.la libVirt_VSSD.la > libVirt_EnabledLogicalElementCapabilities.la libVirt_DevicePool.la > libVirt_RegisteredProfile.la libVirt_VSMigrationCapabilities.la > libVirt_VSMigrationSettingData.la > libVirt_VirtualSystemSnapshotServiceCapabilities.la > libVirt_SystemDevice.la libVirt_ComputerSystemIndication.la > libVirt_ResourceAllocationSettingDataIndication.la > libVirt_SwitchService.la libVirt_ComputerSystemMigrationIndication.la > libVirt_VirtualSystemManagementCapabilities.la > libVirt_AllocationCapabilities.la libVirt_ReferencedProfile.la > libVirt_VirtualSystemSnapshotService.la > libVirt_VirtualSystemManagementService.la > libVirt_ResourcePoolConfigurationService.la > libVirt_ResourcePoolConfigurationCapabilities.la > libVirt_VSMigrationService.la libVirt_ConsoleRedirectionService.la > libVirt_ConsoleRedirectionServiceCapabilities.la > libVirt_KVMRedirectionSAP.la libVirt_SettingsDefineCapabilities.la > libVirt_HostedDependency.la libVirt_ElementConformsToProfile.la > libVirt_HostedResourcePool.la libVirt_ElementCapabilities.la > libVirt_VSSDComponent.la libVirt_SettingsDefineState.la > libVirt_ResourceAllocationFromPool.la > libVirt_ElementAllocatedFromPool.la libVirt_HostedService.la > libVirt_ElementSettingData.la libVirt_ConcreteComponent.la > libVirt_ServiceAffectsElement.la libVirt_HostedAccessPoint.la > libVirt_ServiceAccessBySAP.la libVirt_SAPAvailableForElement.la > libVirt_FilterList.la libVirt_FilterEntry.la > libVirt_EntriesInFilterList.la libVirt_NestedFilterList.la > libVirt_HostedFilterList.la libVirt_AppliedFilterList.la > '/home/dpkshetty/usr/lib/cmpi' > *libtool: install: warning: relinking `libVirt_ComputerSystem.la'* > > libtool: install: (cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src; > /bin/bash /home/dpkshetty/work/libvirt-cim/libvirt-cim/libtool ?--silent > --tag CC --mode=relink gcc -g -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE > -D_LARGEFILE64_SOURCE -Wall -Wmissing-prototypes -Wmissing-declarations > -Wstrict-prototypes -Wpointer-arith -Wformat=2 -Wformat-security > -Wformat-nonliteral -Wno-format-y2k -Wcast-align -Wno-unused-value > -DLIBVIRT_CIM_CS=\"2714b9a5e842\" -DLIBVIRT_CIM_RV=\"1151\" > -I../libxkutil ../libxkutil/libxkutil.la > > -version-info 5:14:5 -L/home/dpkshetty/usr/lib -lvirt -ldl > -L/home/dpkshetty/usr/lib -lcmpiutil -L/usr/lib/i386-linux-gnu -luuid -o > libVirt_ComputerSystem.la -rpath /home/dpkshetty/usr/lib/cmpi > Virt_ComputerSystem.lo -lVirt_VirtualSystemSnapshotService ) > */usr/bin/ld: cannot find -lVirt_VirtualSystemSnapshotService* > > collect2: ld returned 1 exit status > libtool: install: error: relink `libVirt_ComputerSystem.la' with the > above command before installing it > make[2]: *** [install-providerLTLIBRARIES] Error 1 > make[2]: Leaving directory > `/home/dpkshetty/work/libvirt-cim/libvirt-cim/src' > make[1]: *** [install-am] Error 2 > make[1]: Leaving directory > `/home/dpkshetty/work/libvirt-cim/libvirt-cim/src' > make: *** [install-recursive] Error 1 > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > > > -- > Best Regards > > Wayne Xia > mail:xiawenc at linux.vnet.ibm.com > tel:86-010-82450803 > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From snmishra at us.ibm.com Tue Nov 1 17:28:21 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Tue, 1 Nov 2011 10:28:21 -0700 Subject: [Libvirt-cim] Error doing make install for libvirt-cim In-Reply-To: References: <4EADFFB8.1040009@linux.vnet.ibm.com> Message-ID: Deepak, We actively test with Pegasus, but sfcb should work too. Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 10/30/2011 10:15:45 PM: > Deepak Shetty > Sent by: libvirt-cim-bounces at redhat.com > > 10/30/2011 10:15 PM > > Please respond to > List for discussion and development of libvirt CIM > > To > > Wayne Xia > > cc > > List for discussion and development of libvirt CIM > > Subject > > Re: [Libvirt-cim] Error doing make install for libvirt-cim > > Hello Wayne, > ? Thanks for the pointer , will try. > But i am on Ubuntu and did not understand why I should be doing a 'make rpm'. > Also i have sfcb ( Lite weight broker ) installed, will that not > work with libvirt-cim ? Is CIMOM pegasus a must ? > On Mon, Oct 31, 2011 at 7:24 AM, Wayne Xia wrote: > pls have a try for following commands with CIMOM tog-pegasus installed: > ./autoconfiscate.sh > ./configure > make rpm > > > > ? 2011-10-29 19:46, Deepak Shetty ??: > Hi, > ? I am getting the following error while doing ' make install' for > libvirt-cim. Can someone pls help provide some pointers on what could be > wrong here ? > > .... > .... > > test -z "/home/dpkshetty/usr/lib/cmpi" || /bin/mkdir -p > "/home/dpkshetty/usr/lib/cmpi" > ?/bin/bash ../libtool ? --mode=install /usr/bin/install -c > libVirt_ComputerSystem.la libVirt_Device.la libVirt_RASD.la > libVirt_HostSystem.la libVirt_VSSD.la > libVirt_EnabledLogicalElementCapabilities.la libVirt_DevicePool.la > libVirt_RegisteredProfile.la libVirt_VSMigrationCapabilities.la > libVirt_VSMigrationSettingData.la > libVirt_VirtualSystemSnapshotServiceCapabilities.la > libVirt_SystemDevice.la libVirt_ComputerSystemIndication.la > libVirt_ResourceAllocationSettingDataIndication.la > libVirt_SwitchService.la libVirt_ComputerSystemMigrationIndication.la > libVirt_VirtualSystemManagementCapabilities.la > libVirt_AllocationCapabilities.la libVirt_ReferencedProfile.la > libVirt_VirtualSystemSnapshotService.la > libVirt_VirtualSystemManagementService.la > libVirt_ResourcePoolConfigurationService.la > libVirt_ResourcePoolConfigurationCapabilities.la > libVirt_VSMigrationService.la libVirt_ConsoleRedirectionService.la > libVirt_ConsoleRedirectionServiceCapabilities.la > libVirt_KVMRedirectionSAP.la libVirt_SettingsDefineCapabilities.la > libVirt_HostedDependency.la libVirt_ElementConformsToProfile.la > libVirt_HostedResourcePool.la libVirt_ElementCapabilities.la > libVirt_VSSDComponent.la libVirt_SettingsDefineState.la > libVirt_ResourceAllocationFromPool.la > libVirt_ElementAllocatedFromPool.la libVirt_HostedService.la > libVirt_ElementSettingData.la libVirt_ConcreteComponent.la > libVirt_ServiceAffectsElement.la libVirt_HostedAccessPoint.la > libVirt_ServiceAccessBySAP.la libVirt_SAPAvailableForElement.la > libVirt_FilterList.la libVirt_FilterEntry.la > libVirt_EntriesInFilterList.la libVirt_NestedFilterList.la > libVirt_HostedFilterList.la libVirt_AppliedFilterList.la > '/home/dpkshetty/usr/lib/cmpi' > *libtool: install: warning: relinking `libVirt_ComputerSystem.la'* > > libtool: install: (cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src; > /bin/bash /home/dpkshetty/work/libvirt-cim/libvirt-cim/libtool ?--silent > --tag CC --mode=relink gcc -g -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE > -D_LARGEFILE64_SOURCE -Wall -Wmissing-prototypes -Wmissing-declarations > -Wstrict-prototypes -Wpointer-arith -Wformat=2 -Wformat-security > -Wformat-nonliteral -Wno-format-y2k -Wcast-align -Wno-unused-value > -DLIBVIRT_CIM_CS=\"2714b9a5e842\" -DLIBVIRT_CIM_RV=\"1151\" > -I../libxkutil ../libxkutil/libxkutil.la > > -version-info 5:14:5 -L/home/dpkshetty/usr/lib -lvirt -ldl > -L/home/dpkshetty/usr/lib -lcmpiutil -L/usr/lib/i386-linux-gnu -luuid -o > libVirt_ComputerSystem.la -rpath /home/dpkshetty/usr/lib/cmpi > Virt_ComputerSystem.lo -lVirt_VirtualSystemSnapshotService ) > */usr/bin/ld: cannot find -lVirt_VirtualSystemSnapshotService* > > collect2: ld returned 1 exit status > libtool: install: error: relink `libVirt_ComputerSystem.la' with the > above command before installing it > make[2]: *** [install-providerLTLIBRARIES] Error 1 > make[2]: Leaving directory > `/home/dpkshetty/work/libvirt-cim/libvirt-cim/src' > make[1]: *** [install-am] Error 2 > make[1]: Leaving directory > `/home/dpkshetty/work/libvirt-cim/libvirt-cim/src' > make: *** [install-recursive] Error 1 > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > > > -- > Best Regards > > Wayne Xia > mail:xiawenc at linux.vnet.ibm.com > tel:86-010-82450803 > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From cvincent at linux.vnet.ibm.com Tue Nov 1 21:27:34 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 01 Nov 2011 17:27:34 -0400 Subject: [Libvirt-cim] [PATCH] [TEST] Fix VSMS/32_modify_cdrom_media.py In-Reply-To: <1319549416-30992-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1319549416-30992-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EB06446.5010402@linux.vnet.ibm.com> Sorry for the delay. Was setting up a new system and took a while to get cimtest running again. Testing KVM hypervisor -------------------------------------------------------------------- VirtualSystemManagementService - 32_modify_cdrom_media.py: PASS -------------------------------------------------------------------- +1 and pushed. On 10/25/2011 09:30 AM, eblima at linux.vnet.ibm.com wrote: > From: Eduardo Lima (Etrunko) > > This test depended on some modifications in the core classes that resulted in > many other tests failing. This patch fixed this issue by moving the necessary > bits to the testcase itself. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > .../32_modify_cdrom_media.py | 16 +++++++++++++++- > suites/libvirt-cim/lib/XenKvmLib/vxml.py | 17 +++-------------- > 2 files changed, 18 insertions(+), 15 deletions(-) > > diff --git a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/32_modify_cdrom_media.py b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/32_modify_cdrom_media.py > index 9b42831..ff9d034 100755 > --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/32_modify_cdrom_media.py > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/32_modify_cdrom_media.py > @@ -32,9 +32,10 @@ import pywbem > > from CimTest.ReturnCodes import PASS, FAIL, XFAIL, SKIP > from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS > -from XenKvmLib.const import do_main, _image_dir > +from XenKvmLib.const import do_main, _image_dir, KVM_default_cdrom_dev > from XenKvmLib.classes import get_typed_class > from XenKvmLib.vxml import get_class > +from XenKvmLib import vsms > > supported = ['KVM',] > > @@ -49,6 +50,19 @@ class CIMDomain(object): > self.server = server > self.virt = virt > self._domain = get_class(virt)(name) > + > + # CIM Instance for cdrom > + dasd = vsms.get_dasd_class(virt) > + cdrom_dasd = dasd(dev=KVM_default_cdrom_dev, source="", > + name=name, emu_type=1) > + self._domain.res_settings.append(str(cdrom_dasd)) > + > + # cdrom XML description > + devices = self._domain.get_node('/domain/devices') > + cdrom = self._domain.add_sub_node(devices, 'disk', type='file', > + device='cdrom') > + self._domain.add_sub_node(cdrom, 'source', file="") > + self._domain.add_sub_node(cdrom, 'target', dev=KVM_default_cdrom_dev) > #__init__ > > def define(self): > diff --git a/suites/libvirt-cim/lib/XenKvmLib/vxml.py b/suites/libvirt-cim/lib/XenKvmLib/vxml.py > index 6790036..15859c1 100644 > --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py > +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py > @@ -628,17 +628,13 @@ class VirtCIM: > self.iasd = vsms.get_iasd_class(virt)(name=dom_name, > res_sub_type=irstype, > bus_type=btype) > - if virt == "KVM": > - dasd = vsms.get_dasd_class(virt) > - self.cdrom_dasd = dasd(dev=const.KVM_default_cdrom_dev, > - source="", > - name=dom_name, > - emu_type=1) > + self.res_settings = [] > + > def cim_define(self, ip, ref_conf=None): > service = vsms.get_vsms_class(self.virt)(ip) > sys_settings = str(self.vssd) > > - res_settings = [] > + res_settings = self.res_settings > if self.dasd is not None: > res_settings.append(str(self.dasd)) > if self.pasd is not None: > @@ -651,10 +647,6 @@ class VirtCIM: > else: > res_settings.append(str(self.nasd)) > > - # CDROM device > - if self.virt == "KVM": > - res_settings.append(str(self.cdrom_dasd)) > - > curr_cim_rev, changeset = get_provider_version(self.virt, ip) > if curr_cim_rev>= vsms_graphics_sup: > if self.gasd is not None: > @@ -952,9 +944,6 @@ class KVMXML(VirtXML, VirtCIM): > self.add_sub_node(disk, 'source', file=disk_img) > self.add_sub_node(disk, 'target', dev=disk_dev) > > - cdrom = self.add_sub_node(devices, 'disk', type='file', device='cdrom') > - self.add_sub_node(cdrom, 'source', file="") > - self.add_sub_node(cdrom, 'target', dev=const.KVM_default_cdrom_dev) > > self.add_sub_node(devices, 'input', type='mouse', bus='ps2') > self.add_sub_node(devices, 'graphics', type='vnc', port='5900', -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From cvincent at linux.vnet.ibm.com Tue Nov 1 21:47:40 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 01 Nov 2011 17:47:40 -0400 Subject: [Libvirt-cim] [PATCH] [TEST] Fix syntax errors in VSMS/09_procrasd_persist.py In-Reply-To: <1319549443-31041-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1319549443-31041-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EB068FC.9070908@linux.vnet.ibm.com> I got an error when running this test, but I believe the problem is on the providers side. Testing KVM hypervisor -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest with return code 1 ERROR - Unable to define procrasd_persist_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest -------------------------------------------------------------------- Since I don't believe the test is the problem, +1 and pushed. On 10/25/2011 09:30 AM, eblima at linux.vnet.ibm.com wrote: > From: Eduardo Lima (Etrunko) > > Traceback (most recent call last): > File "/usr/lib64/python2.7/logging/__init__.py", line 838, in emit > msg = self.format(record) > File "/usr/lib64/python2.7/logging/__init__.py", line 715, in format > return fmt.format(record) > File "/usr/lib64/python2.7/logging/__init__.py", line 464, in format > record.message = record.getMessage() > File "/usr/lib64/python2.7/logging/__init__.py", line 328, in getMessage > msg = msg % self.args > TypeError: %d format: a number is required, not NoneType > > Signed-off-by: Eduardo Lima (Etrunko) > --- > .../09_procrasd_persist.py | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py > index cc5b71b..91415dd 100644 > --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py > @@ -91,19 +91,19 @@ def check_proc_sched(server, virt, cn_name): > return FAIL > > if proc_rasd["VirtualQuantity"] != nvcpu and virt != 'KVM': > - logger.error("VirtualQuantity is %i, expected %i", > + logger.error("VirtualQuantity is %s, expected %s", > proc_rasd["VirtualQuantity"], nvcpu) > return FAIL > elif proc_rasd["VirtualQuantity"] != nvcpu and virt == "KVM": > return XFAIL_RC(libvirt_bug) > > if proc_rasd["Limit"] != limit: > - logger.error("Limit is %i, expected %i", > + logger.error("Limit is %s, expected %s", > proc_rasd["Limit"], limit) > return FAIL > > if proc_rasd["Weight"] != weight: > - logger.error("Weight is %i, expected %i", > + logger.error("Weight is %s, expected %s", > proc_rasd["Weight"], weight) > return FAIL > > -- 1.7.4.4 _______________________________________________ Libvirt-cim > mailing list Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvincent at linux.vnet.ibm.com Tue Nov 1 22:23:28 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 01 Nov 2011 18:23:28 -0400 Subject: [Libvirt-cim] [PATCHv2] [TEST] Fix syntax errors, small tweaks In-Reply-To: <1319726099-9856-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1319726099-9856-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EB07160.1080003@linux.vnet.ibm.com> -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: PASS -------------------------------------------------------------------- -------------------------------------------------------------------- VirtualSystemManagementService - 31_unset_netrasd.py: PASS -------------------------------------------------------------------- +1 and pushed. Thanks, Eduardo. On 10/27/2011 10:34 AM, Eduardo Lima (Etrunko) wrote: > From: Eduardo Lima (Etrunko) > > suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py: > - Unecessary virt param > > suites/libvirt-cim/cimtest/VirtualSystemManagementService/31_unset_netrasd.py: > - Undefined symbols XFAIL, SKIP > > suites/libvirt-cim/main.py > - options referenced in except block without being defined > > Signed-off-by: Eduardo Lima (Etrunko) > --- > .../08_modifyresource.py | 8 ++++---- > .../31_unset_netrasd.py | 2 +- > suites/libvirt-cim/main.py | 2 +- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py > index 6661ef3..df58d1f 100644 > --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py > @@ -47,7 +47,7 @@ new_mac1 = "11:%s:22:%s:33:%s" % (new_int, new_int, new_int) > new_int += 1 > new_mac2 = "11:%s:22:%s:33:%s" % (new_int, new_int, new_int) > > -def cleanup_env(ip, virt, cxml): > +def cleanup_env(ip, cxml): > cxml.destroy(ip) > cxml.undefine(ip) > > @@ -82,13 +82,13 @@ def main(): > ret = cxml.cim_define(options.ip) > if not ret: > logger.error("Failed to define the dom: %s", default_dom) > - cleanup_env(options.ip, options.virt, cxml) > + cleanup_env(options.ip, cxml) > return FAIL > if case == "start": > ret = cxml.start(options.ip) > if not ret: > logger.error("Failed to start the dom: %s", default_dom) > - cleanup_env(options.ip, options.virt, cxml) > + cleanup_env(options.ip, cxml) > return FAIL > > status = vsms_util.mod_vcpu_res(options.ip, service, cxml, pasd, ncpu, > @@ -114,7 +114,7 @@ def main(): > if status != PASS: > break > > - cleanup_env(options.ip, options.virt, cxml) > + cleanup_env(options.ip, cxml) > > return status > > diff --git a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/31_unset_netrasd.py b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/31_unset_netrasd.py > index 417ad7f..9c78eb8 100755 > --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/31_unset_netrasd.py > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/31_unset_netrasd.py > @@ -28,7 +28,7 @@ > import sys > import pywbem > > -from CimTest.ReturnCodes import PASS, FAIL > +from CimTest.ReturnCodes import PASS, FAIL, XFAIL, SKIP > from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS > from XenKvmLib.const import do_main > from XenKvmLib.classes import get_typed_class > diff --git a/suites/libvirt-cim/main.py b/suites/libvirt-cim/main.py > index 4e7d621..a4e33e6 100644 > --- a/suites/libvirt-cim/main.py > +++ b/suites/libvirt-cim/main.py > @@ -306,8 +306,8 @@ def main(options, args): > > if __name__ == '__main__': > ret = -1 > + options, args = parser.parse_args() > try: > - options, args = parser.parse_args() > ret = main(options, args) > except (KeyboardInterrupt, SystemExit): > print "\nKeyboardInterrupt. Cleaning up..." -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From cvincent at linux.vnet.ibm.com Tue Nov 1 23:14:12 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 01 Nov 2011 19:14:12 -0400 Subject: [Libvirt-cim] [PATCH] Avoid connection to libvirt if previous attempt fails In-Reply-To: <1319832237-22515-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1319832237-22515-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EB07D44.6020606@linux.vnet.ibm.com> Very nice! This should keep things must simpler and quiet, especially with brute force clients. Thanks. BTW - I ran tests before and after this patch with no diff in results: # diff 01_run_report.txt 02_run_report.txt 9,10c9,10 < Libvirt-cim revision: 1156 < Libvirt-cim changeset: 555e122 --- > Libvirt-cim revision: 1158 > Libvirt-cim changeset: d0c6a89 So, +1 and pushed. Thanks!!! On 10/28/2011 04:03 PM, Eduardo Lima (Etrunko) wrote: > From: Eduardo Lima (Etrunko) > > This is a workaround to avoid libvirt flooding error messages in syslog. This > happens often if a client submits queries for CIM_ superclasses, which then will > translate to a query for each registered class. In our case KVM_, LXC_ and XEN_. > > Ideally, there should be a way to ask libvirt if a given URI or hypervisor is > enabled/supported. A patch for that feature is on the works, and as soon as it > is integrated to libvirt tree this feature will be updated. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > libxkutil/misc_util.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 48 insertions(+), 0 deletions(-) > > diff --git a/libxkutil/misc_util.c b/libxkutil/misc_util.c > index c2cc204..61893c3 100644 > --- a/libxkutil/misc_util.c > +++ b/libxkutil/misc_util.c > @@ -24,6 +24,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -53,6 +54,46 @@ static int libvirt_initialized = 0; > > #define URI_ENV "HYPURI" > > +struct _hypervisor_status_t { > + const char *name; > + bool enabled; > +}; > + > +typedef struct _hypervisor_status_t hypervisor_status_t; > + > +static hypervisor_status_t hypervisor_list[] = { > + { "xen", true }, > + { "kvm", true }, > + { "lxc", true }, > + { NULL }, > +}; > + > +static bool get_hypervisor_enabled(const char *hypervisor) > +{ > + hypervisor_status_t *h; > + > + for (h =&hypervisor_list[0]; h != NULL; h++) { > + if (strncasecmp(hypervisor, h->name, strlen(h->name)) == 0) { > + return h->enabled; > + } > + } > + > + return false; > +} > + > +static void set_hypervisor_disabled(const char *hypervisor) > +{ > + hypervisor_status_t *h; > + > + for (h =&hypervisor_list[0]; h != NULL; h++) { > + if (strncasecmp(hypervisor, h->name, strlen(h->name)) == 0) { > + CU_DEBUG("Setting '%s' hypervisor as DISABLED", h->name); > + h->enabled = false; > + return; > + } > + } > +} > + > static const char *cn_to_uri(const char *classname) > { > if (STARTS_WITH(classname, "Xen")) > @@ -117,6 +158,9 @@ virConnectPtr connect_by_classname(const CMPIBroker *broker, > return NULL; > } > > + if (!get_hypervisor_enabled(classname)) > + return NULL; > + > CU_DEBUG("Connecting to libvirt with uri `%s'", uri); > > pthread_mutex_lock(&libvirt_mutex); > @@ -129,6 +173,10 @@ virConnectPtr connect_by_classname(const CMPIBroker *broker, > pthread_mutex_unlock(&libvirt_mutex); > > if (!conn) { > + virErrorPtr error = virGetLastError(); > + if (error->code == VIR_ERR_NO_CONNECT) > + set_hypervisor_disabled(classname); > + > CU_DEBUG("Unable to connect to `%s'", uri); > return NULL; > } -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From cvincent at linux.vnet.ibm.com Wed Nov 2 00:36:44 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 01 Nov 2011 20:36:44 -0400 Subject: [Libvirt-cim] cimtest errors Message-ID: <4EB0909C.6050505@linux.vnet.ibm.com> FYI - It's getting close to creating a new release and I'd like to get libvirt-cim and cimtest in sync. With the latest upstream libvirt-cim and cimtest, I'm seeing the follow unexpected[1] errors in cimtest: VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest with return code 1 ERROR - Unable to define procrasd_persist_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest with return code 1 ERROR - DefineSystem with (KiloBytes) units failed InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL ERROR - Exception: CreateSnapshot failed to return a CIM job inst ERROR - Failed to remove snapshot file for snapshot_vm A very quick peek at the code shows this message occurs when one tries to add a disk device with the same names as one that already exists. This is a no-no in cim. I'll dig into the root cause tomorrow and provide an update. [1] - I see several other typical errors that are either known issues or side-effects of a non-pristine system. Sadly, cimtest considers the default RHEL 6.1+ config not pristine and falsely fails due to some pre-configured pools. I plan to address this soon. -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From dpkshetty at gmail.com Wed Nov 2 12:35:13 2011 From: dpkshetty at gmail.com (Deepak Shetty) Date: Wed, 2 Nov 2011 18:05:13 +0530 Subject: [Libvirt-cim] Error doing make install for libvirt-cim In-Reply-To: References: <4EADFFB8.1040009@linux.vnet.ibm.com> Message-ID: Thanks Sharad... I was doing it on a fresh system itself :) I think the make install does not install the libVirt_VirtualSystemSnapshotService library, which is needed before the rest of the install works. Assumign make install is same on all platforms.. i wonder how it wud fail only for Ubuntu. On Tue, Nov 1, 2011 at 11:04 PM, Sharad Mishra wrote: > Deepak, > > I have not tried Ubuntu. But have used RH and SuSE, and never had to > do any of the manual steps you mentioned here. > I recommend, on a fresh system installing libcmpiutil and then get > libvirt-cim and run - > 1. autoconfiscate.sh > 2. configure > 3. make > > Let me know if that does not work for you. > > Regards, > Sharad Mishra > Open Virtualization > Linux Technology Center > IBM > > libvirt-cim-bounces at redhat.com wrote on 10/31/2011 01:21:26 AM: > > > Deepak Shetty > > Sent by: libvirt-cim-bounces at redhat.com > > > > 10/31/2011 01:21 AM > > > > Please respond to > > List for discussion and development of libvirt CIM > > > > > To > > > > Wayne Xia > > > > cc > > > > List for discussion and development of libvirt CIM > > > > > Subject > > > > Re: [Libvirt-cim] Error doing make install for libvirt-cim > > > > It looks like there is a bug in the ' make install' > > I had to manually do the steps below to copy the library onto the > > right path, before make install could succed > > Took clues from the libxkutil.a library install that happens just > > before this error. > > > > cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src/ > > > > 1) /usr/bin/install -c .libs/ > > libVirt_VirtualSystemSnapshotService.so.0.5.14 /home/dpkshetty/usr/ > > lib/cmpi/libVirt_VirtualSystemSnapshotService.so.0.5.14 > > 2) cd /home/dpkshetty/usr/lib/cmpi/ > > 3) ln -s -f libVirt_VirtualSystemSnapshotService.so.0.5.14 > > libVirt_VirtualSystemSnapshotService.so.0 > > 4) ln -s -f libVirt_VirtualSystemSnapshotService.so.0.5.14 > > libVirt_VirtualSystemSnapshotService.so > > 5) cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src/ > > 6) /usr/bin/install -c .libs/ > > libVirt_VirtualSystemSnapshotService.lai /home/dpkshetty/usr/lib/ > > cmpi/libVirt_VirtualSystemSnapshotService.la > > 7) /usr/bin/install -c .libs/libVirt_VirtualSystemSnapshotService.a > > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > > 8) chmod 644 /home/dpkshetty/usr/lib/cmpi/ > > libVirt_VirtualSystemSnapshotService.a > > 9) > ranlib /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > > 10) ldconfig -n /home/dpkshetty/usr/lib/cmpi > > > > After this 'make install' worked fine. > > > > > On Mon, Oct 31, 2011 at 10:45 AM, Deepak Shetty > wrote: > > Hello Wayne, > > Thanks for the pointer , will try. > > But i am on Ubuntu and did not understand why I should be doing a 'make > rpm'. > > Also i have sfcb ( Lite weight broker ) installed, will that not > > work with libvirt-cim ? Is CIMOM pegasus a must ? > > > > > On Mon, Oct 31, 2011 at 7:24 AM, Wayne Xia > wrote: > > pls have a try for following commands with CIMOM tog-pegasus installed: > > ./autoconfiscate.sh > > ./configure > > make rpm > > > > > > > > ? 2011-10-29 19:46, Deepak Shetty ??: > > Hi, > > I am getting the following error while doing ' make install' for > > libvirt-cim. Can someone pls help provide some pointers on what could be > > wrong here ? > > > > .... > > .... > > > > test -z "/home/dpkshetty/usr/lib/cmpi" || /bin/mkdir -p > > "/home/dpkshetty/usr/lib/cmpi" > > /bin/bash ../libtool --mode=install /usr/bin/install -c > > libVirt_ComputerSystem.la libVirt_Device.la libVirt_RASD.la > > libVirt_HostSystem.la libVirt_VSSD.la > > libVirt_EnabledLogicalElementCapabilities.la libVirt_DevicePool.la > > libVirt_RegisteredProfile.la libVirt_VSMigrationCapabilities.la > > libVirt_VSMigrationSettingData.la > > libVirt_VirtualSystemSnapshotServiceCapabilities.la > > libVirt_SystemDevice.la libVirt_ComputerSystemIndication.la > > libVirt_ResourceAllocationSettingDataIndication.la > > libVirt_SwitchService.la libVirt_ComputerSystemMigrationIndication.la > > libVirt_VirtualSystemManagementCapabilities.la > > libVirt_AllocationCapabilities.la libVirt_ReferencedProfile.la > > libVirt_VirtualSystemSnapshotService.la > > libVirt_VirtualSystemManagementService.la > > libVirt_ResourcePoolConfigurationService.la > > libVirt_ResourcePoolConfigurationCapabilities.la > > libVirt_VSMigrationService.la libVirt_ConsoleRedirectionService.la > > libVirt_ConsoleRedirectionServiceCapabilities.la > > libVirt_KVMRedirectionSAP.la libVirt_SettingsDefineCapabilities.la > > libVirt_HostedDependency.la libVirt_ElementConformsToProfile.la > > libVirt_HostedResourcePool.la libVirt_ElementCapabilities.la > > libVirt_VSSDComponent.la libVirt_SettingsDefineState.la > > libVirt_ResourceAllocationFromPool.la > > libVirt_ElementAllocatedFromPool.la libVirt_HostedService.la > > libVirt_ElementSettingData.la libVirt_ConcreteComponent.la > > libVirt_ServiceAffectsElement.la libVirt_HostedAccessPoint.la > > libVirt_ServiceAccessBySAP.la libVirt_SAPAvailableForElement.la > > libVirt_FilterList.la libVirt_FilterEntry.la > > libVirt_EntriesInFilterList.la libVirt_NestedFilterList.la > > libVirt_HostedFilterList.la libVirt_AppliedFilterList.la > > '/home/dpkshetty/usr/lib/cmpi' > > *libtool: install: warning: relinking `libVirt_ComputerSystem.la'* > > > > libtool: install: (cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src; > > /bin/bash /home/dpkshetty/work/libvirt-cim/libvirt-cim/libtool --silent > > --tag CC --mode=relink gcc -g -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE > > -D_LARGEFILE64_SOURCE -Wall -Wmissing-prototypes -Wmissing-declarations > > -Wstrict-prototypes -Wpointer-arith -Wformat=2 -Wformat-security > > -Wformat-nonliteral -Wno-format-y2k -Wcast-align -Wno-unused-value > > -DLIBVIRT_CIM_CS=\"2714b9a5e842\" -DLIBVIRT_CIM_RV=\"1151\" > > -I../libxkutil ../libxkutil/libxkutil.la > > > > -version-info 5:14:5 -L/home/dpkshetty/usr/lib -lvirt -ldl > > -L/home/dpkshetty/usr/lib -lcmpiutil -L/usr/lib/i386-linux-gnu -luuid -o > > libVirt_ComputerSystem.la -rpath /home/dpkshetty/usr/lib/cmpi > > Virt_ComputerSystem.lo -lVirt_VirtualSystemSnapshotService ) > > */usr/bin/ld: cannot find -lVirt_VirtualSystemSnapshotService* > > > > collect2: ld returned 1 exit status > > libtool: install: error: relink `libVirt_ComputerSystem.la' with the > > above command before installing it > > make[2]: *** [install-providerLTLIBRARIES] Error 1 > > make[2]: Leaving directory > > `/home/dpkshetty/work/libvirt-cim/libvirt-cim/src' > > make[1]: *** [install-am] Error 2 > > make[1]: Leaving directory > > `/home/dpkshetty/work/libvirt-cim/libvirt-cim/src' > > make: *** [install-recursive] Error 1 > > > > > > > _______________________________________________ > > Libvirt-cim mailing list > > Libvirt-cim at redhat.com > > https://www.redhat.com/mailman/listinfo/libvirt-cim > > > > > > -- > > Best Regards > > > > Wayne Xia > > mail:xiawenc at linux.vnet.ibm.com > > tel:86-010-82450803 > > > > > _______________________________________________ > > Libvirt-cim mailing list > > Libvirt-cim at redhat.com > > https://www.redhat.com/mailman/listinfo/libvirt-cim > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -------------- next part -------------- An HTML attachment was scrubbed... URL: From snmishra at us.ibm.com Wed Nov 2 16:43:55 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 2 Nov 2011 09:43:55 -0700 Subject: [Libvirt-cim] cimtest errors In-Reply-To: <4EB0909C.6050505@linux.vnet.ibm.com> References: <4EB0909C.6050505@linux.vnet.ibm.com> Message-ID: I ran cimtest on a RHEL 6 machine with latest libvirt-cim and cimtests. Following 2 tests failed - VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest with return code 1 ERROR - DefineSystem with (KiloBytes) units failed InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL ERROR - Exception: CreateSnapshot failed to return a CIM job inst ERROR - Failed to remove snapshot file for snapshot_vm Will do some investigation to figure out why they are failing. Regards, Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 11/01/2011 05:36:44 PM: > Chip Vincent > Sent by: libvirt-cim-bounces at redhat.com > > 11/01/11 05:36 PM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > Subject > > [Libvirt-cim] cimtest errors > > FYI - > > It's getting close to creating a new release and I'd like to get > libvirt-cim and cimtest in sync. With the latest upstream libvirt-cim > and cimtest, I'm seeing the follow unexpected[1] errors in cimtest: > > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest with return code 1 > ERROR - Unable to define procrasd_persist_dom > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest > -------------------------------------------------------------------- > VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest with return code 1 > ERROR - DefineSystem with (KiloBytes) units failed > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest > -------------------------------------------------------------------- > VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL > ERROR - Exception: CreateSnapshot failed to return a CIM job inst > ERROR - Failed to remove snapshot file for snapshot_vm > > A very quick peek at the code shows this message occurs when one tries > to add a disk device > with the same names as one that already exists. This is a no-no in cim. > I'll dig into the root cause tomorrow and provide an update. > > [1] - I see several other typical errors that are either known issues or > side-effects of a non-pristine system. Sadly, cimtest considers the > default RHEL 6.1+ config not pristine and falsely fails due > to some pre-configured pools. I plan to address this soon. > -- > > Chip Vincent > Open Virtualization > IBM Linux Technology Center > cvincent at linux.vnet.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From bestor at us.ibm.com Wed Nov 2 17:01:02 2011 From: bestor at us.ibm.com (Gareth S Bestor) Date: Wed, 2 Nov 2011 10:01:02 -0700 Subject: [Libvirt-cim] cimtest errors In-Reply-To: Message-ID: Another data point: VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL Worked for me on my RHEL6 box :-) VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL This one fails for me too. - G Dr. Gareth S. Bestor IBM Senior Software Engineer Systems & Technology Group - Systems Management Standards 971-285-6375 (mobile) bestor at us.ibm.com Re: [Libvirt-cim] cimtest errors Sharad Mishra to: List for discussion and development of libvirt CIM 11/02/11 09:47 AM Sent by: libvirt-cim-bounces at redhat.com Please respond to List for discussion and development of libvirt CIM I ran cimtest on a RHEL 6 machine with latest libvirt-cim and cimtests. Following 2 tests failed - VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest with return code 1 ERROR - DefineSystem with (KiloBytes) units failed InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL ERROR - Exception: CreateSnapshot failed to return a CIM job inst ERROR - Failed to remove snapshot file for snapshot_vm Will do some investigation to figure out why they are failing. Regards, Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 11/01/2011 05:36:44 PM: > Chip Vincent > Sent by: libvirt-cim-bounces at redhat.com > > 11/01/11 05:36 PM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > Subject > > [Libvirt-cim] cimtest errors > > FYI - > > It's getting close to creating a new release and I'd like to get > libvirt-cim and cimtest in sync. With the latest upstream libvirt-cim > and cimtest, I'm seeing the follow unexpected[1] errors in cimtest: > > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest with return code 1 > ERROR - Unable to define procrasd_persist_dom > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest > -------------------------------------------------------------------- > VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest with return code 1 > ERROR - DefineSystem with (KiloBytes) units failed > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest > -------------------------------------------------------------------- > VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL > ERROR - Exception: CreateSnapshot failed to return a CIM job inst > ERROR - Failed to remove snapshot file for snapshot_vm > > A very quick peek at the code shows this message occurs when one tries > to add a disk device > with the same names as one that already exists. This is a no-no in cim. > I'll dig into the root cause tomorrow and provide an update. > > [1] - I see several other typical errors that are either known issues or > side-effects of a non-pristine system. Sadly, cimtest considers the > default RHEL 6.1+ config not pristine and falsely fails due > to some pre-configured pools. I plan to address this soon. > -- > > Chip Vincent > Open Virtualization > IBM Linux Technology Center > cvincent at linux.vnet.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > _______________________________________________ Libvirt-cim mailing list Libvirt-cim at redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim -------------- next part -------------- An HTML attachment was scrubbed... URL: From snmishra at us.ibm.com Wed Nov 2 17:09:17 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Wed, 2 Nov 2011 10:09:17 -0700 Subject: [Libvirt-cim] cimtest errors In-Reply-To: References: <4EB0909C.6050505@linux.vnet.ibm.com> Message-ID: My bad. I pulled latest cimtest in one xterm and opened a new xterm and ran cimtest from it. New xterm was pointing to an older cimtest. Ignore my earlier cimtest results. Here are the one from latest cimtest - FAIL Test Summary: FilterList - 03_create.py: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL FilterList - 03_create.py: FAIL ERROR - Caught exception: (1, u'CIM_ERR_FAILED: Failed to update device') VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest with return code 1 ERROR - Unable to define procrasd_persist_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest with return code 1 ERROR - DefineSystem with (KiloBytes) units failed InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL ERROR - Exception: CreateSnapshot failed to return a CIM job inst ERROR - Failed to remove snapshot file for snapshot_vm Looks like "FilterList - 03_create.py" and "VirtualSystemManagementService - 09_procrasd_persist.py" are new failures. Regards, Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 11/02/2011 09:43:55 AM: > Sharad Mishra/Beaverton/IBM at IBMUS > Sent by: libvirt-cim-bounces at redhat.com > > 11/02/11 09:43 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > List for discussion and development of libvirt CIM > > cc > > Subject > > Re: [Libvirt-cim] cimtest errors > > I ran cimtest on a RHEL 6 machine with latest libvirt-cim and cimtests. > Following 2 tests failed - > > > VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest with return code 1 > ERROR - DefineSystem with (KiloBytes) units failed > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice property must be unique for each > DiskResourceAllocationSettingData in a single guest > > > VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL > ERROR - Exception: CreateSnapshot failed to return a CIM job inst > ERROR - Failed to remove snapshot file for snapshot_vm > > Will do some investigation to figure out why they are failing. > > Regards, > Sharad Mishra > Open Virtualization > Linux Technology Center > IBM > > libvirt-cim-bounces at redhat.com wrote on 11/01/2011 05:36:44 PM: > > > Chip Vincent > > Sent by: libvirt-cim-bounces at redhat.com > > > > 11/01/11 05:36 PM > > > > Please respond to > > List for discussion and development of libvirt CIM > > > > > To > > > > libvirt-cim at redhat.com > > > > cc > > > > Subject > > > > [Libvirt-cim] cimtest errors > > > > FYI - > > > > It's getting close to creating a new release and I'd like to get > > libvirt-cim and cimtest in sync. With the latest upstream libvirt-cim > > and cimtest, I'm seeing the follow unexpected[1] errors in cimtest: > > > > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: > > VirtualDevice property must be unique for each > > DiskResourceAllocationSettingData in a single guest with return code 1 > > ERROR - Unable to define procrasd_persist_dom > > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: > > VirtualDevice property must be unique for each > > DiskResourceAllocationSettingData in a single guest > > -------------------------------------------------------------------- > > VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL > > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: > > VirtualDevice property must be unique for each > > DiskResourceAllocationSettingData in a single guest with return code 1 > > ERROR - DefineSystem with (KiloBytes) units failed > > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: > > VirtualDevice property must be unique for each > > DiskResourceAllocationSettingData in a single guest > > -------------------------------------------------------------------- > > VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL > > ERROR - Exception: CreateSnapshot failed to return a CIM job inst > > ERROR - Failed to remove snapshot file for snapshot_vm > > > > A very quick peek at the code shows this message occurs when one tries > > to add a disk device > > with the same names as one that already exists. This is a no-no in cim. > > I'll dig into the root cause tomorrow and provide an update. > > > > [1] - I see several other typical errors that are either known issues or > > side-effects of a non-pristine system. Sadly, cimtest considers the > > default RHEL 6.1+ config not pristine and falsely fails due > > to some pre-configured pools. I plan to address this soon. > > -- > > > > Chip Vincent > > Open Virtualization > > IBM Linux Technology Center > > cvincent at linux.vnet.ibm.com > > > > _______________________________________________ > > Libvirt-cim mailing list > > Libvirt-cim at redhat.com > > https://www.redhat.com/mailman/listinfo/libvirt-cim > > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From eblima at linux.vnet.ibm.com Thu Nov 3 12:15:30 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 03 Nov 2011 10:15:30 -0200 Subject: [Libvirt-cim] cimtest errors In-Reply-To: References: <4EB0909C.6050505@linux.vnet.ibm.com> Message-ID: <4EB285E2.9020309@linux.vnet.ibm.com> On 11/02/2011 03:09 PM, Sharad Mishra wrote: > My bad. I pulled latest cimtest in one xterm and opened a new xterm and ran > cimtest from it. New xterm was pointing to an older cimtest. Ignore my > earlier cimtest results. Here are the one from latest cimtest - > > FAIL Test Summary: > FilterList - 03_create.py: FAIL > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL > VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL > Patch that fixesx 09 and 11 has been submitted to the list already. I have also pushed it to the 'for-review' branch of my cimtest clone in gitorious. https://www.redhat.com/archives/libvirt-cim/2011-October/msg00065.html Best regards, Eduardo -- Eduardo de Barros Lima Software Engineer, Open Virtualization Linux Technology Center - IBM/Brazil eblima at br.ibm.com From snmishra at us.ibm.com Thu Nov 3 16:41:41 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 09:41:41 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix VSMS 09_procrasd_persist and 11_define_memrasdunits In-Reply-To: <1319749650-29641-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1319749650-29641-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: +1 Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 10/27/2011 02:07:30 PM: > "Eduardo Lima (Etrunko)" > Sent by: libvirt-cim-bounces at redhat.com > > 10/27/2011 02:07 PM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > "Eduardo Lima \(Etrunko\)" > > Subject > > [Libvirt-cim] [PATCH] [TEST] Fix VSMS 09_procrasd_persist and > 11_define_memrasdunits > > From: Eduardo Lima (Etrunko) > > Both tests were failing due to reusing an instance of the class for defining > domains in a loop. The error message was the following: > > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: > VirtualDevice > property must be unique for each DiskResourceAllocationSettingData in a > single guest with return code 1 > > A recent change in XenKvmLib/vxml.py necessary for the new test > 32_modify_cdrom_media.py triggered this bug. To avoid this error we simply > create a new instance of that class in each iteration of the loop. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > .../09_procrasd_persist.py | 3 ++- > .../11_define_memrasdunits.py | 4 ++-- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/suites/libvirt-cim/cimtest/ > VirtualSystemManagementService/09_procrasd_persist.py b/suites/ > libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py > index 91415dd..a53c5ac 100644 > --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/ > 09_procrasd_persist.py > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/ > 09_procrasd_persist.py > @@ -119,11 +119,12 @@ def main(): > virt = options.virt > server = options.ip > > - cxml = get_class(virt)(test_dom) > + cxml = None > prasd_cn = get_typed_class(virt, "ProcResourceAllocationSettingData") > dom_define = dom_start = False > try: > for count in range(3): > + cxml = get_class(virt)(test_dom) > status = setup_guest(server, virt, cxml, prasd_cn) > if status != PASS: > return status > diff --git a/suites/libvirt-cim/cimtest/ > VirtualSystemManagementService/11_define_memrasdunits.py b/suites/ > libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py > index 8c032c2..3f54ff4 100644 > --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/ > 11_define_memrasdunits.py > +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/ > 11_define_memrasdunits.py > @@ -113,8 +113,7 @@ def check_value(options): > def main(): > options = main.options > > - cxml = get_class(options.virt)(default_dom) > - > + cxml = None > status = FAIL > guest_is_undefined = None > > @@ -123,6 +122,7 @@ def main(): > > value = mem_bytes >> shift > > + cxml = get_class(options.virt)(default_dom) > status = try_define(options, units, value, cxml) > if status != PASS: > break > -- > 1.7.4.4 > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From snmishra at us.ibm.com Thu Nov 3 16:44:57 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 09:44:57 -0700 Subject: [Libvirt-cim] cimtest errors In-Reply-To: <4EB285E2.9020309@linux.vnet.ibm.com> References: <4EB0909C.6050505@linux.vnet.ibm.com> <4EB285E2.9020309@linux.vnet.ibm.com> Message-ID: > "Eduardo Lima (Etrunko)" > 11/03/2011 05:15 AM > > Please respond to > eblima at br.ibm.com > > To > > List for discussion and development of libvirt CIM > > cc > > Sharad Mishra/Beaverton/IBM at IBMUS > > Subject > > Re: [Libvirt-cim] cimtest errors > > On 11/02/2011 03:09 PM, Sharad Mishra wrote: > > My bad. I pulled latest cimtest in one xterm and opened a new xterm and ran > > cimtest from it. New xterm was pointing to an older cimtest. Ignore my > > earlier cimtest results. Here are the one from latest cimtest - > > > > FAIL Test Summary: > > FilterList - 03_create.py: FAIL > > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > > VirtualSystemManagementService - 11_define_memrasdunits.py: FAIL After applying Eduardo's patch for 09_ and 11_, VSMS cimtests passed. But I still see both 03_ tests from FilterList and VirtaulSystemSanpshotService failing on RHEL 6 with latest upstream libvirt-cim. -Sharad > > VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL > > > > Patch that fixesx 09 and 11 has been submitted to the list already. I > have also pushed it to the 'for-review' branch of my cimtest clone in > gitorious. > > https://www.redhat.com/archives/libvirt-cim/2011-October/msg00065.html > > Best regards, Eduardo > > -- > Eduardo de Barros Lima > Software Engineer, Open Virtualization > Linux Technology Center - IBM/Brazil > eblima at br.ibm.com > From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:36 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:36 -0200 Subject: [Libvirt-cim] [PATCH 8/8] xmlgen: Avoid double-free In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1320342516-25150-9-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) As revealed by Coverity scan report: https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 Error: USE_AFTER_FREE: xmlgen.c:1271: freed_arg: "free" frees "string". xmlgen.c:1317: double_free: Calling "free" frees pointer "string" which has already been freed. Error: USE_AFTER_FREE: xmlgen.c:1288: freed_arg: "free" frees "string". xmlgen.c:1317: double_free: Calling "free" frees pointer "string" which has already been freed. Signed-off-by: Eduardo Lima (Etrunko) --- libxkutil/xmlgen.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c index ee20895..4cca75b 100644 --- a/libxkutil/xmlgen.c +++ b/libxkutil/xmlgen.c @@ -1292,6 +1292,7 @@ static const char *storage_vol_xml(xmlNodePtr root, goto out; free(string); + string = NULL; if (vol->cap_units != NULL) { xmlAttrPtr tmp = NULL; @@ -1309,6 +1310,7 @@ static const char *storage_vol_xml(xmlNodePtr root, goto out; free(string); + string = NULL; if (vol->cap_units != NULL) { xmlAttrPtr tmp = NULL; -- 1.7.4.4 From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:35 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:35 -0200 Subject: [Libvirt-cim] [PATCH 7/8] Fix possible use of uninitialized variables In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1320342516-25150-8-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) As revealed by Coverity scan report: https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 Error: UNINIT: Virt_ComputerSystemIndication.c:435: var_decl: Declaring variable "affected_inst" without initializer. Virt_ComputerSystemIndication.c:478: uninit_use: Using uninitialized value "affected_inst". Error: UNINIT: Virt_ElementCapabilities.c:86: var_decl: Declaring variable "_inst" without initializer. Virt_ElementCapabilities.c:117: uninit_use: Using uninitialized value "_inst". Error: UNINIT: Virt_ElementCapabilities.c:132: var_decl: Declaring variable "_inst" without initializer. Virt_ElementCapabilities.c:160: uninit_use: Using uninitialized value "_inst". Error: UNINIT: Virt_VirtualSystemManagementService.c:2516: var_decl: Declaring variable "s" without initializer. Virt_VirtualSystemManagementService.c:2619: uninit_use: Using uninitialized value "s": field "s".msg is uninitialized. Error: UNINIT: Virt_VirtualSystemSnapshotService.c:490: var_decl: Declaring variable "s" without initializer. Virt_VirtualSystemSnapshotService.c:509: uninit_use: Using uninitialized value "s": field "s".msg is uninitialized. Signed-off-by: Eduardo Lima (Etrunko) --- src/Virt_ComputerSystemIndication.c | 3 +++ src/Virt_ElementCapabilities.c | 4 ++-- src/Virt_VirtualSystemManagementService.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Virt_ComputerSystemIndication.c b/src/Virt_ComputerSystemIndication.c index 9b3b80b..a00444d 100644 --- a/src/Virt_ComputerSystemIndication.c +++ b/src/Virt_ComputerSystemIndication.c @@ -471,6 +471,9 @@ static bool async_ind(CMPIContext *context, CU_DEBUG("Could not recreate guest instance"); goto out; } + } else { + CU_DEBUG("Unrecognized indication type"); + goto out; } /* FIXME: We are unable to get the previous CS instance after it has diff --git a/src/Virt_ElementCapabilities.c b/src/Virt_ElementCapabilities.c index d74bf93..6bd846a 100644 --- a/src/Virt_ElementCapabilities.c +++ b/src/Virt_ElementCapabilities.c @@ -83,7 +83,7 @@ static CMPIStatus validate_caps_get_service_or_rp(const CMPIContext *context, CMPIInstance **inst) { CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIInstance *_inst; + CMPIInstance *_inst = NULL; char* classname; classname = class_base_name(CLASSNAME(ref)); @@ -129,7 +129,7 @@ static CMPIStatus validate_service_get_caps(const CMPIContext *context, CMPIInstance **inst) { CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIInstance *_inst; + CMPIInstance *_inst = NULL; char* classname; classname = class_base_name(CLASSNAME(ref)); diff --git a/src/Virt_VirtualSystemManagementService.c b/src/Virt_VirtualSystemManagementService.c index fa1e266..21979c3 100644 --- a/src/Virt_VirtualSystemManagementService.c +++ b/src/Virt_VirtualSystemManagementService.c @@ -387,7 +387,7 @@ static int bootord_vssd_to_domain(CMPIInstance *inst, CMPICount i; CMPICount bl_size; CMPIArray *bootlist; - CMPIStatus s; + CMPIStatus s = { CMPI_RC_OK, NULL }; CMPIData boot_elem; char **tmp_str_arr; @@ -2467,7 +2467,7 @@ static CMPIStatus _resource_dynamic(struct domain *dominfo, enum ResourceAction action, const char *refcn) { - CMPIStatus s; + CMPIStatus s = { CMPI_RC_OK, NULL }; virConnectPtr conn; virDomainPtr dom; int (*func)(virDomainPtr, struct virt_device *); -- 1.7.4.4 From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:28 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:28 -0200 Subject: [Libvirt-cim] Various fixes revealed by Coverity scan report Message-ID: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Hi all, The cool RedHat folks were kind enough to share a recent report generated by Coverity which exposes a lot of potential errors on libvirt-cim code. https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 I went through each one of them and fixed all of them that I considered it actually make sense to fix. There are a few false positives that were ignored. The result is this series of patches following. Finally, I have ran the cimtests with all these applied and they work as expected. Best regards, -- Eduardo de Barros Lima Software Engineer, Open Virtualization Linux Technology Center - IBM/Brazil eblima at br.ibm.com From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:29 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:29 -0200 Subject: [Libvirt-cim] [PATCH 1/8] acl_parsing: Avoid NULL dereference In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1320342516-25150-2-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) As revealed by Coverity scan report: https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 Error: REVERSE_INULL: acl_parsing.c:172: deref_ptr: Directly dereferencing pointer "filters". acl_parsing.c:174: check_after_deref: Dereferencing "filters" before a null check. Signed-off-by: Eduardo Lima (Etrunko) --- libxkutil/acl_parsing.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libxkutil/acl_parsing.c b/libxkutil/acl_parsing.c index 935e642..7cde1f0 100644 --- a/libxkutil/acl_parsing.c +++ b/libxkutil/acl_parsing.c @@ -151,11 +151,13 @@ void cleanup_filter(struct acl_filter *filter) void cleanup_filters(struct acl_filter **filters, int count) { int i; - struct acl_filter *_filters = *filters; + struct acl_filter *_filters; if((filters == NULL) || (*filters == NULL) || (count == 0)) return; + _filters = *filters; + for (i = 0; i < count; i++) cleanup_filter(&_filters[i]); -- 1.7.4.4 From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:34 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:34 -0200 Subject: [Libvirt-cim] [PATCH 6/8] Fix misuse of signed variables In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1320342516-25150-7-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) As revealed by Coverity scan report: https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 Error: NEGATIVE_RETURNS: infostore.c:183: negative_return_fn: Function "open(filename, 66, 384)" returns a negative number. infostore.c:183: var_assign: Assigning: signed variable "isc->fd" = "open". infostore.c:214: negative_returns: "isc->fd" is passed to a parameter that cannot be negative. infostore.c:53: neg_sink_parm_call: Passing "ctx->fd" to "close", which cannot accept a negative. Error: NEGATIVE_RETURNS: Virt_ComputerSystemIndication.c:518: negative_return_fn: Function "platform_from_class(args->classname)" returns a negative number. Virt_ComputerSystemIndication.c:503: return_negative_constant: Explicitly returning negative value "-1". Virt_ComputerSystemIndication.c:518: var_assign: Assigning: signed variable "platform" = "platform_from_class". Virt_ComputerSystemIndication.c:539: negative_returns: Using variable "platform" as an index to array "active_filters". Error: NEGATIVE_RETURNS: Virt_ComputerSystemIndication.c:518: negative_return_fn: Function "platform_from_class(args->classname)" returns a negative number. Virt_ComputerSystemIndication.c:503: return_negative_constant: Explicitly returning negative value "-1". Virt_ComputerSystemIndication.c:518: var_assign: Assigning: signed variable "platform" = "platform_from_class". Virt_ComputerSystemIndication.c:596: negative_returns: Using variable "platform" as an index to array "thread_id". Error: NEGATIVE_RETURNS: Virt_VSMigrationService.c:512: negative_return_fn: Function "mkstemp(filename)" returns a negative number. Virt_VSMigrationService.c:512: var_assign: Assigning: signed variable "fd" = "mkstemp". Virt_VSMigrationService.c:547: negative_returns: "fd" is passed to a parameter that cannot be negative. Signed-off-by: Eduardo Lima (Etrunko) --- libxkutil/infostore.c | 4 +++- src/Virt_ComputerSystemIndication.c | 12 +++++++++--- src/Virt_VSMigrationService.c | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/libxkutil/infostore.c b/libxkutil/infostore.c index 716dedd..dd1e38c 100644 --- a/libxkutil/infostore.c +++ b/libxkutil/infostore.c @@ -50,7 +50,9 @@ static void infostore_cleanup_ctx(struct infostore_ctx *ctx) { xmlXPathFreeContext(ctx->xpathctx); xmlFreeDoc(ctx->doc); - close(ctx->fd); + + if (ctx->fd >= 0) + close(ctx->fd); free(ctx); } diff --git a/src/Virt_ComputerSystemIndication.c b/src/Virt_ComputerSystemIndication.c index 337f20a..9b3b80b 100644 --- a/src/Virt_ComputerSystemIndication.c +++ b/src/Virt_ComputerSystemIndication.c @@ -518,11 +518,14 @@ static CMPI_THREAD_RETURN lifecycle_thread(void *params) char *prefix = class_prefix_name(args->classname); int platform = platform_from_class(args->classname); + if (prefix == NULL || platform == -1) + goto init_out; + conn = connect_by_classname(_BROKER, args->classname, &s); if (conn == NULL) { CU_DEBUG("Unable to start lifecycle thread: " "Failed to connect (cn: %s)", args->classname); - goto out; + goto conn_out; } pthread_mutex_lock(&lifecycle_mutex); @@ -591,16 +594,19 @@ static CMPI_THREAD_RETURN lifecycle_thread(void *params) } } - out: CU_DEBUG("Exiting CSI event loop (%s)", prefix); thread_id[platform] = 0; pthread_mutex_unlock(&lifecycle_mutex); stdi_free_ind_args(&args); - free(prefix); + + conn_out: virConnectClose(conn); + init_out: + free(prefix); + return NULL; } diff --git a/src/Virt_VSMigrationService.c b/src/Virt_VSMigrationService.c index 414feda..be9bb7c 100644 --- a/src/Virt_VSMigrationService.c +++ b/src/Virt_VSMigrationService.c @@ -544,7 +544,8 @@ static char *write_params(CMPIArray *array) if (file != NULL) fclose(file); - close(fd); + if (fd >= 0) + close(fd); return filename; } -- 1.7.4.4 From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:30 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:30 -0200 Subject: [Libvirt-cim] [PATCH 2/8] pool_parsing: Avoid NULL dereferences In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1320342516-25150-3-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) As revealed by Coverity scan report: https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 Error: REVERSE_INULL: pool_parsing.c:74: deref_ptr: Directly dereferencing pointer "pool". pool_parsing.c:76: check_after_deref: Dereferencing "pool" before a null check. Error: REVERSE_INULL: pool_parsing.c:99: deref_ptr: Directly dereferencing pointer "res". pool_parsing.c:101: check_after_deref: Dereferencing "res" before a null check. Signed-off-by: Eduardo Lima (Etrunko) --- libxkutil/pool_parsing.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libxkutil/pool_parsing.c b/libxkutil/pool_parsing.c index f7a5a2c..f73b0fd 100644 --- a/libxkutil/pool_parsing.c +++ b/libxkutil/pool_parsing.c @@ -71,11 +71,12 @@ static void cleanup_disk_pool(struct disk_pool pool) { void cleanup_virt_pool(struct virt_pool **pool) { - struct virt_pool *_pool = *pool; + struct virt_pool *_pool; if ((pool == NULL) || (*pool == NULL)) return; - + + _pool = *pool; if (_pool->type == CIM_RES_TYPE_NET) cleanup_net_pool(_pool->pool_info.net); else if (_pool->type == CIM_RES_TYPE_DISK) @@ -96,11 +97,13 @@ static void cleanup_image_res(struct storage_vol vol) void cleanup_virt_pool_res(struct virt_pool_res **res) { - struct virt_pool_res *_res = *res; + struct virt_pool_res *_res; if ((res == NULL) || (*res == NULL)) return; + _res = *res; + if (_res->type == CIM_RES_TYPE_IMAGE) cleanup_image_res(_res->res.storage_vol); -- 1.7.4.4 From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:33 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:33 -0200 Subject: [Libvirt-cim] [PATCH 5/8] Avoid NULL dereferences in various providers In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1320342516-25150-6-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) As revealed by Coverity scan report: https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 Error: FORWARD_NULL: Virt_DevicePool.c:999: var_compare_op: Comparing "netnames" to null implies that "netnames" might be null. Virt_DevicePool.c:1019: var_deref_op: Dereferencing null variable "netnames". Error: FORWARD_NULL: Virt_ComputerSystemIndication.c:259: var_compare_op: Comparing "ind" to null implies that "ind" might be null. Virt_ComputerSystemIndication.c:267: var_deref_op: Dereferencing null variable "ind". Error: FORWARD_NULL: Virt_ResourcePoolConfigurationService.c:759: var_compare_op: Comparing "op" to null implies that "op" might be null. Virt_ResourcePoolConfigurationService.c:779: var_deref_op: Dereferencing null variable "op". Error: FORWARD_NULL: Virt_ResourcePoolConfigurationService.c:1028: var_compare_op: Comparing "res" to null implies that "res" might be null. Virt_ResourcePoolConfigurationService.c:1035: var_deref_op: Dereferencing null variable "res". Error: FORWARD_NULL: Virt_VSMigrationService.c:766: var_compare_op: Comparing "ref" to null implies that "ref" might be null. Virt_VSMigrationService.c:796: var_deref_op: Dereferencing null variable "ref". Error: FORWARD_NULL: Virt_VirtualSystemManagementService.c:1274: var_compare_op: Comparing "op" to null implies that "op" might be null. Virt_VirtualSystemManagementService.c:1292: var_deref_op: Dereferencing null variable "op". Error: FORWARD_NULL: Virt_VirtualSystemSnapshotService.c:353: var_compare_op: Comparing "ctx" to null implies that "ctx" might be null. Virt_VirtualSystemSnapshotService.c:376: var_deref_model: Passing null variable "ctx" to function "snap_job_free", which dereferences it. Virt_VirtualSystemSnapshotService.c:66: deref_parm: Directly dereferencing parameter "ctx". Error: REVERSE_INULL: Virt_ResourcePoolConfigurationService.c:173: deref_ptr: Directly dereferencing pointer "path_list". Virt_ResourcePoolConfigurationService.c:174: check_after_deref: Dereferencing "path_list" before a null check. Signed-off-by: Eduardo Lima (Etrunko) --- src/Virt_ComputerSystemIndication.c | 1 + src/Virt_DevicePool.c | 8 +++++--- src/Virt_ResourcePoolConfigurationService.c | 6 +++--- src/Virt_VSMigrationService.c | 9 +++++++-- src/Virt_VirtualSystemManagementService.c | 2 +- src/Virt_VirtualSystemSnapshotService.c | 3 +++ 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Virt_ComputerSystemIndication.c b/src/Virt_ComputerSystemIndication.c index c057a0c..337f20a 100644 --- a/src/Virt_ComputerSystemIndication.c +++ b/src/Virt_ComputerSystemIndication.c @@ -262,6 +262,7 @@ static bool _do_indication(const CMPIBroker *broker, prefix, ind_type_name); ret = false; + goto out; } ind_op = CMGetObjectPath(ind, &s); diff --git a/src/Virt_DevicePool.c b/src/Virt_DevicePool.c index 7112a9d..a41a378 100644 --- a/src/Virt_DevicePool.c +++ b/src/Virt_DevicePool.c @@ -1015,9 +1015,11 @@ static CMPIStatus netpool_instance(virConnectPtr conn, } out: - for (i = 0; i < nets; i++) - free(netnames[i]); - free(netnames); + if (netnames != NULL) { + for (i = 0; i < nets; i++) + free(netnames[i]); + free(netnames); + } return s; } diff --git a/src/Virt_ResourcePoolConfigurationService.c b/src/Virt_ResourcePoolConfigurationService.c index 3908c9c..7e76032 100644 --- a/src/Virt_ResourcePoolConfigurationService.c +++ b/src/Virt_ResourcePoolConfigurationService.c @@ -171,7 +171,7 @@ static char *get_dev_paths(CMPIInstance *inst, return "Unable to get DevicePaths array count"; *path_list = calloc(ct, sizeof(char *)); - if (path_list == NULL) + if (*path_list == NULL) return "Failed to alloc space for device paths"; *count = ct; @@ -775,7 +775,7 @@ static const char *rasd_to_res(CMPIInstance *inst, msg = "This function does not support this resource type"; out: - if (msg) + if (msg && op) CU_DEBUG("rasd_to_res(%s): %s", CLASSNAME(op), msg); return msg; @@ -1025,7 +1025,7 @@ static CMPIStatus delete_resource_in_pool(CMPIMethodMI *self, goto out; res = CMGetObjectPath(resource, &s); - if ((res == NULL) && (s.rc != CMPI_RC_OK)) { + if ((res == NULL) || (s.rc != CMPI_RC_OK)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unable to get ObjectPath of Resource instance"); diff --git a/src/Virt_VSMigrationService.c b/src/Virt_VSMigrationService.c index ee79a96..414feda 100644 --- a/src/Virt_VSMigrationService.c +++ b/src/Virt_VSMigrationService.c @@ -761,10 +761,15 @@ static bool raise_indication(const CMPIContext *context, /* This is a workaround for Pegasus, it loses its objectpath by CMGetObjectPath. So set it back. */ - inst->ft->setObjectPath((CMPIInstance *)inst, ref); + if (ref != NULL) + inst->ft->setObjectPath((CMPIInstance *)inst, ref); if ((ref == NULL) || (s.rc != CMPI_RC_OK)) { CU_DEBUG("Failed to get job reference"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to get job reference"); + goto out; } else { s = get_host_system_properties(&host, &ccname, @@ -798,7 +803,7 @@ static bool raise_indication(const CMPIContext *context, s = stdi_raise_indication(_BROKER, context, type, ns, ind); free(type); - + out: return s.rc == CMPI_RC_OK; } diff --git a/src/Virt_VirtualSystemManagementService.c b/src/Virt_VirtualSystemManagementService.c index 5edc65f..fa1e266 100644 --- a/src/Virt_VirtualSystemManagementService.c +++ b/src/Virt_VirtualSystemManagementService.c @@ -1526,7 +1526,7 @@ static const char *rasd_to_vdev(CMPIInstance *inst, else msg = _sysvirt_rasd_to_vdev(inst, dev, type, ns); out: - if (msg) + if (msg && op) CU_DEBUG("rasd_to_vdev(%s): %s", CLASSNAME(op), msg); return msg; diff --git a/src/Virt_VirtualSystemSnapshotService.c b/src/Virt_VirtualSystemSnapshotService.c index e7789cb..898fa57 100644 --- a/src/Virt_VirtualSystemSnapshotService.c +++ b/src/Virt_VirtualSystemSnapshotService.c @@ -63,6 +63,9 @@ struct snap_context { static void snap_job_free(struct snap_context *ctx) { + if (ctx == NULL) + return; + free(ctx->domain); free(ctx->save_path); free(ctx->ref_ns); -- 1.7.4.4 From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:31 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:31 -0200 Subject: [Libvirt-cim] [PATCH 3/8] device_parsing: Avoid NULL dereferences In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1320342516-25150-4-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) As revealed by Coverity scan report: https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 Error: REVERSE_INULL: device_parsing.c:1153: deref_ptr: Directly dereferencing pointer "dominfo". device_parsing.c:1155: check_after_deref: Dereferencing "dominfo" before a null check. Error: FORWARD_NULL: device_parsing.c:226: assign_zero: Assigning: "ddev" = 0. device_parsing.c:284: var_deref_model: Passing null variable "ddev" to function "cleanup_disk_device", which dereferences it. device_parsing.c:54: deref_parm: Directly dereferencing parameter "dev". Error: FORWARD_NULL: device_parsing.c:170: assign_zero: Assigning: "ddev" = 0. device_parsing.c:217: var_deref_model: Passing null variable "ddev" to function "cleanup_disk_device", which dereferences it. device_parsing.c:54: deref_parm: Directly dereferencing parameter "dev". Error: FORWARD_NULL: device_parsing.c:457: assign_zero: Assigning: "edev" = 0. device_parsing.c:475: var_deref_model: Passing null variable "edev" to function "cleanup_emu_device", which dereferences it. device_parsing.c:88: deref_parm: Directly dereferencing parameter "dev". Error: FORWARD_NULL: device_parsing.c:516: assign_zero: Assigning: "gdev" = 0. device_parsing.c:579: var_deref_model: Passing null variable "gdev" to function "cleanup_graphics_device", which dereferences it. device_parsing.c:93: deref_parm: Directly dereferencing parameter "dev". Error: FORWARD_NULL: device_parsing.c:588: assign_zero: Assigning: "idev" = 0. device_parsing.c:615: var_deref_model: Passing null variable "idev" to function "cleanup_input_device", which dereferences it. device_parsing.c:102: deref_parm: Directly dereferencing parameter "dev". Error: FORWARD_NULL: device_parsing.c:310: var_compare_op: Comparing "vsi_dev" to null implies that "vsi_dev" might be null. device_parsing.c:344: var_deref_model: Passing null variable "vsi_dev" to function "cleanup_vsi_device", which dereferences it. device_parsing.c:66: deref_parm: Directly dereferencing parameter "dev". Error: FORWARD_NULL: device_parsing.c:352: assign_zero: Assigning: "ndev" = 0. device_parsing.c:416: var_deref_model: Passing null variable "ndev" to function "cleanup_net_device", which dereferences it. device_parsing.c:77: deref_parm: Directly dereferencing parameter "dev". Signed-off-by: Eduardo Lima (Etrunko) --- libxkutil/device_parsing.c | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-) diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c index d25461e..371838f 100644 --- a/libxkutil/device_parsing.c +++ b/libxkutil/device_parsing.c @@ -54,6 +54,9 @@ typedef int (*dev_parse_func_t)(xmlNode *, struct virt_device **); static void cleanup_disk_device(struct disk_device *dev) { + if (dev == NULL) + return; + free(dev->type); free(dev->device); free(dev->driver); @@ -66,6 +69,9 @@ static void cleanup_disk_device(struct disk_device *dev) static void cleanup_vsi_device(struct vsi_device *dev) { + if (dev == NULL) + return; + free(dev->vsi_type); free(dev->manager_id); free(dev->type_id); @@ -77,6 +83,9 @@ static void cleanup_vsi_device(struct vsi_device *dev) static void cleanup_net_device(struct net_device *dev) { + if (dev == NULL) + return; + free(dev->type); free(dev->mac); free(dev->source); @@ -88,6 +97,9 @@ static void cleanup_net_device(struct net_device *dev) static void cleanup_emu_device(struct emu_device *dev) { + if (dev == NULL) + return; + free(dev->path); } @@ -108,6 +120,9 @@ static void cleanup_sdl_device(struct graphics_device *dev) static void cleanup_graphics_device(struct graphics_device *dev) { + if (dev == NULL) + return; + if (STREQC(dev->type, "sdl")) { cleanup_sdl_device(dev); } @@ -119,6 +134,9 @@ static void cleanup_graphics_device(struct graphics_device *dev) static void cleanup_input_device(struct input_device *dev) { + if (dev == NULL) + return; + free(dev->type); free(dev->bus); } @@ -1207,11 +1225,12 @@ int get_dominfo(virDomainPtr dom, struct domain **dominfo) void cleanup_dominfo(struct domain **dominfo) { - struct domain *dom = *dominfo; + struct domain *dom; if ((dominfo == NULL) || (*dominfo == NULL)) return; + dom = *dominfo; free(dom->name); free(dom->uuid); free(dom->bootloader); -- 1.7.4.4 From eblima at linux.vnet.ibm.com Thu Nov 3 17:48:32 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 3 Nov 2011 15:48:32 -0200 Subject: [Libvirt-cim] [PATCH 4/8] ACL: Plug leaks In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1320342516-25150-5-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) As revealed by Coverity scan report https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 https://bugzilla.redhat.com/attachment.cgi?id=530435 This is the same case that was fixed in commit 57765ed. The function cleanup_filter() does not free the variable itself. In future uses, consider using cleanup_filters() instead. Signed-off-by: Eduardo Lima (Etrunko) --- libxkutil/acl_parsing.c | 5 ++++- src/Virt_AppliedFilterList.c | 8 ++++---- src/Virt_EntriesInFilterList.c | 2 +- src/Virt_FilterEntry.c | 2 +- src/Virt_FilterList.c | 6 +++--- src/Virt_NestedFilterList.c | 17 +++++++---------- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libxkutil/acl_parsing.c b/libxkutil/acl_parsing.c index 7cde1f0..5b6d7bb 100644 --- a/libxkutil/acl_parsing.c +++ b/libxkutil/acl_parsing.c @@ -357,8 +357,10 @@ static int parse_acl_filter(xmlNode *fnode, struct acl_filter *filter) if (parse_acl_rule(child, rule) == 0) goto err; - if (append_filter_rule(filter, rule) == 0) + if (append_filter_rule(filter, rule) == 0) { + cleanup_rule(rule); goto err; + } } else if (XSTREQ(child->name, "filterref")) { filter_ref = get_attr_value(child, "filter"); @@ -504,6 +506,7 @@ int get_filters( break; memcpy(&filters[i], filter, sizeof(*filter)); + free(filter); } *list = filters; diff --git a/src/Virt_AppliedFilterList.c b/src/Virt_AppliedFilterList.c index 6dad3cb..6567118 100644 --- a/src/Virt_AppliedFilterList.c +++ b/src/Virt_AppliedFilterList.c @@ -193,7 +193,7 @@ static CMPIStatus list_to_net( if (filter == NULL) goto out; - cleanup_filter(filter); + cleanup_filters(&filter, 1); /* get domains */ dcount = get_domain_list(conn, &doms); @@ -331,7 +331,7 @@ static CMPIStatus net_to_list( filter, &instance); - cleanup_filter(filter); + cleanup_filters(&filter, 1); if (instance != NULL) inst_list_add(list, instance); @@ -515,7 +515,7 @@ static CMPIStatus CreateInstance( free(domain_name); free(net_name); - cleanup_filter(filter); + cleanup_filters(&filter, 1); cleanup_virt_devices(&device, 1); virDomainFree(dom); @@ -625,7 +625,7 @@ static CMPIStatus DeleteInstance( free(domain_name); free(net_name); - cleanup_filter(filter); + cleanup_filters(&filter, 1); cleanup_virt_devices(&device, 1); virDomainFree(dom); diff --git a/src/Virt_EntriesInFilterList.c b/src/Virt_EntriesInFilterList.c index 5b95dd3..2c8ac47 100644 --- a/src/Virt_EntriesInFilterList.c +++ b/src/Virt_EntriesInFilterList.c @@ -83,7 +83,7 @@ static CMPIStatus list_to_rule( } } - cleanup_filter(filter); + cleanup_filters(&filter, 1); out: virConnectClose(conn); diff --git a/src/Virt_FilterEntry.c b/src/Virt_FilterEntry.c index ad87689..acc3d61 100644 --- a/src/Virt_FilterEntry.c +++ b/src/Virt_FilterEntry.c @@ -687,7 +687,7 @@ CMPIStatus get_rule_by_ref( &s); out: free(filter_name); - cleanup_filter(filter); + cleanup_filters(&filter, 1); virConnectClose(conn); return s; diff --git a/src/Virt_FilterList.c b/src/Virt_FilterList.c index 5df2a92..35d18a9 100644 --- a/src/Virt_FilterList.c +++ b/src/Virt_FilterList.c @@ -177,7 +177,7 @@ CMPIStatus get_filter_by_ref(const CMPIBroker *broker, s = instance_from_filter(broker, context, reference, filter, instance); out: - cleanup_filter(filter); + cleanup_filters(&filter, 1); virConnectClose(conn); return s; @@ -320,7 +320,7 @@ static CMPIStatus CreateInstance( CU_DEBUG("CreateInstance complete"); out: - cleanup_filter(filter); + cleanup_filters(&filter, 1); virConnectClose(conn); return s; @@ -361,7 +361,7 @@ static CMPIStatus DeleteInstance( delete_filter(conn, filter); out: - cleanup_filter(filter); + cleanup_filters(&filter, 1); virConnectClose(conn); return s; diff --git a/src/Virt_NestedFilterList.c b/src/Virt_NestedFilterList.c index a129f01..894cd7c 100644 --- a/src/Virt_NestedFilterList.c +++ b/src/Virt_NestedFilterList.c @@ -155,13 +155,11 @@ static CMPIStatus parent_to_child( inst_list_add(list, instance); } - cleanup_filter(child_filter); - - child_filter = NULL; + cleanup_filters(&child_filter, 1); instance = NULL; } - cleanup_filter(parent_filter); + cleanup_filters(&parent_filter, 1); out: virConnectClose(conn); @@ -223,10 +221,9 @@ static CMPIStatus child_to_parent( } - cleanup_filter(&_list[i]); } - free(_list); + cleanup_filters(&_list, count); out: virConnectClose(conn); @@ -390,8 +387,8 @@ static CMPIStatus CreateInstance( CU_DEBUG("CreateInstance completed"); out: - cleanup_filter(parent_filter); - cleanup_filter(child_filter); + cleanup_filters(&parent_filter, 1); + cleanup_filters(&child_filter, 1); virConnectClose(conn); return s; @@ -481,8 +478,8 @@ static CMPIStatus DeleteInstance( CU_DEBUG("CreateInstance completed"); out: - cleanup_filter(parent_filter); - cleanup_filter(child_filter); + cleanup_filters(&parent_filter, 1); + cleanup_filters(&child_filter, 1); virConnectClose(conn); return s; -- 1.7.4.4 From eblima at linux.vnet.ibm.com Thu Nov 3 17:52:17 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Thu, 03 Nov 2011 15:52:17 -0200 Subject: [Libvirt-cim] cimtest errors In-Reply-To: References: <4EB0909C.6050505@linux.vnet.ibm.com> <4EB285E2.9020309@linux.vnet.ibm.com> Message-ID: <4EB2D4D1.70502@linux.vnet.ibm.com> On 11/03/2011 02:44 PM, Sharad Mishra wrote: [snip] > > After applying Eduardo's patch for 09_ and 11_, VSMS cimtests passed. > But I still see both 03_ tests from FilterList and > VirtaulSystemSanpshotService failing on RHEL 6 with latest upstream > libvirt-cim. Hooray! FilterList 03 is expected, Chip is taking care of it. I will take a look on the VirtualSystemSnapshotService to see if I can find something. Best regards -- Eduardo de Barros Lima Software Engineer, Open Virtualization Linux Technology Center - IBM/Brazil eblima at br.ibm.com From snmishra at us.ibm.com Thu Nov 3 20:02:46 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 13:02:46 -0700 Subject: [Libvirt-cim] cimtest errors In-Reply-To: <4EB2D4D1.70502@linux.vnet.ibm.com> References: <4EB0909C.6050505@linux.vnet.ibm.com> <4EB285E2.9020309@linux.vnet.ibm.com> <4EB2D4D1.70502@linux.vnet.ibm.com> Message-ID: > "Eduardo Lima (Etrunko)" > 11/03/2011 10:52 AM > > Please respond to > eblima at br.ibm.com > > To > > Sharad Mishra/Beaverton/IBM at IBMUS > > cc > > eblima at br.ibm.com, List for discussion and development of libvirt > CIM > > Subject > > Re: [Libvirt-cim] cimtest errors > > On 11/03/2011 02:44 PM, Sharad Mishra wrote: > [snip] > > > > After applying Eduardo's patch for 09_ and 11_, VSMS cimtests passed. > > But I still see both 03_ tests from FilterList and > > VirtaulSystemSanpshotService failing on RHEL 6 with latest upstream > > libvirt-cim. > > Hooray! FilterList 03 is expected, Chip is taking care of it. I will > take a look on the VirtualSystemSnapshotService to see if I can find > something. Yep, We are getting there. -Sharad > > Best regards > > -- > Eduardo de Barros Lima > Software Engineer, Open Virtualization > Linux Technology Center - IBM/Brazil > eblima at br.ibm.com > From snmishra at us.ibm.com Thu Nov 3 22:31:20 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 15:31:20 -0700 Subject: [Libvirt-cim] [PATCH 8/8] xmlgen: Avoid double-free In-Reply-To: <1320342516-25150-9-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-9-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: > "Eduardo Lima (Etrunko)" > Sent by: libvirt-cim-bounces at redhat.com > > 11/03/2011 10:48 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > "Eduardo Lima \(Etrunko\)" > > Subject > > [Libvirt-cim] [PATCH 8/8] xmlgen: Avoid double-free > > From: Eduardo Lima (Etrunko) > > As revealed by Coverity scan report: > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > Error: USE_AFTER_FREE: > xmlgen.c:1271: freed_arg: "free" frees "string". > xmlgen.c:1317: double_free: Calling "free" frees pointer "string" which has > already been freed. > > Error: USE_AFTER_FREE: > xmlgen.c:1288: freed_arg: "free" frees "string". > xmlgen.c:1317: double_free: Calling "free" frees pointer "string" which has > already been freed. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > libxkutil/xmlgen.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c > index ee20895..4cca75b 100644 > --- a/libxkutil/xmlgen.c > +++ b/libxkutil/xmlgen.c > @@ -1292,6 +1292,7 @@ static const char *storage_vol_xml(xmlNodePtr root, > goto out; > > free(string); > + string = NULL; shouldn't you be removing the free? > > if (vol->cap_units != NULL) { > xmlAttrPtr tmp = NULL; > @@ -1309,6 +1310,7 @@ static const char *storage_vol_xml(xmlNodePtr root, > goto out; > > free(string); > + string = NULL; same here. -Sharad > > if (vol->cap_units != NULL) { > xmlAttrPtr tmp = NULL; > -- > 1.7.4.4 > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From snmishra at us.ibm.com Thu Nov 3 22:34:37 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 15:34:37 -0700 Subject: [Libvirt-cim] [PATCH 7/8] Fix possible use of uninitialized variables In-Reply-To: <1320342516-25150-8-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-8-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: Looks good except for the indentation. > "Eduardo Lima (Etrunko)" > Sent by: libvirt-cim-bounces at redhat.com > > 11/03/2011 10:48 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > "Eduardo Lima \(Etrunko\)" > > Subject > > [Libvirt-cim] [PATCH 7/8] Fix possible use of uninitialized variables > > From: Eduardo Lima (Etrunko) > > As revealed by Coverity scan report: > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > Error: UNINIT: > Virt_ComputerSystemIndication.c:435: var_decl: Declaring variable > "affected_inst" without initializer. > Virt_ComputerSystemIndication.c:478: uninit_use: Using uninitialized value > "affected_inst". > > Error: UNINIT: > Virt_ElementCapabilities.c:86: var_decl: Declaring variable "_inst" without > initializer. > Virt_ElementCapabilities.c:117: uninit_use: Using uninitialized value "_inst". > > Error: UNINIT: > Virt_ElementCapabilities.c:132: var_decl: Declaring variable "_inst" without > initializer. > Virt_ElementCapabilities.c:160: uninit_use: Using uninitialized value "_inst". > > Error: UNINIT: > Virt_VirtualSystemManagementService.c:2516: var_decl: Declaring variable "s" > without initializer. > Virt_VirtualSystemManagementService.c:2619: uninit_use: Using uninitialized > value "s": field "s".msg is > uninitialized. > > Error: UNINIT: > Virt_VirtualSystemSnapshotService.c:490: var_decl: Declaring variable "s" > without initializer. > Virt_VirtualSystemSnapshotService.c:509: uninit_use: Using uninitialized value > "s": field "s".msg is uninitialized. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > src/Virt_ComputerSystemIndication.c | 3 +++ > src/Virt_ElementCapabilities.c | 4 ++-- > src/Virt_VirtualSystemManagementService.c | 4 ++-- > 3 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/src/Virt_ComputerSystemIndication.c b/src/ > Virt_ComputerSystemIndication.c > index 9b3b80b..a00444d 100644 > --- a/src/Virt_ComputerSystemIndication.c > +++ b/src/Virt_ComputerSystemIndication.c > @@ -471,6 +471,9 @@ static bool async_ind(CMPIContext *context, > CU_DEBUG("Could not recreate guest instance"); > goto out; > } > + } else { > + CU_DEBUG("Unrecognized indication type"); > + goto out; > } > > /* FIXME: We are unable to get the previous CS instance after it has > diff --git a/src/Virt_ElementCapabilities.c b/src/Virt_ElementCapabilities.c > index d74bf93..6bd846a 100644 > --- a/src/Virt_ElementCapabilities.c > +++ b/src/Virt_ElementCapabilities.c > @@ -83,7 +83,7 @@ static CMPIStatus validate_caps_get_service_or_rp > (const CMPIContext *context, > CMPIInstance **inst) > { > CMPIStatus s = {CMPI_RC_OK, NULL}; > - CMPIInstance *_inst; > + CMPIInstance *_inst = NULL; > char* classname; > > classname = class_base_name(CLASSNAME(ref)); > @@ -129,7 +129,7 @@ static CMPIStatus validate_service_get_caps > (const CMPIContext *context, > CMPIInstance **inst) > { > CMPIStatus s = {CMPI_RC_OK, NULL}; > - CMPIInstance *_inst; > + CMPIInstance *_inst = NULL; indentation > char* classname; > > classname = class_base_name(CLASSNAME(ref)); > diff --git a/src/Virt_VirtualSystemManagementService.c b/src/ > Virt_VirtualSystemManagementService.c > index fa1e266..21979c3 100644 > --- a/src/Virt_VirtualSystemManagementService.c > +++ b/src/Virt_VirtualSystemManagementService.c > @@ -387,7 +387,7 @@ static int bootord_vssd_to_domain(CMPIInstance *inst, > CMPICount i; > CMPICount bl_size; > CMPIArray *bootlist; > - CMPIStatus s; > + CMPIStatus s = { CMPI_RC_OK, NULL }; > CMPIData boot_elem; > char **tmp_str_arr; > > @@ -2467,7 +2467,7 @@ static CMPIStatus _resource_dynamic(struct > domain *dominfo, > enum ResourceAction action, > const char *refcn) > { > - CMPIStatus s; > + CMPIStatus s = { CMPI_RC_OK, NULL }; > virConnectPtr conn; > virDomainPtr dom; > int (*func)(virDomainPtr, struct virt_device *); > -- > 1.7.4.4 > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From snmishra at us.ibm.com Thu Nov 3 22:37:12 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 15:37:12 -0700 Subject: [Libvirt-cim] [PATCH 6/8] Fix misuse of signed variables In-Reply-To: <1320342516-25150-7-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-7-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: +1 > "Eduardo Lima (Etrunko)" > Sent by: libvirt-cim-bounces at redhat.com > > 11/03/2011 10:48 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > "Eduardo Lima \(Etrunko\)" > > Subject > > [Libvirt-cim] [PATCH 6/8] Fix misuse of signed variables > > From: Eduardo Lima (Etrunko) > > As revealed by Coverity scan report: > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > Error: NEGATIVE_RETURNS: > infostore.c:183: negative_return_fn: Function "open(filename, 66, > 384)" returns > a negative number. > infostore.c:183: var_assign: Assigning: signed variable "isc->fd" = "open". > infostore.c:214: negative_returns: "isc->fd" is passed to a parameter that > cannot be negative. > infostore.c:53: neg_sink_parm_call: Passing "ctx->fd" to "close", which cannot > accept a negative. > > Error: NEGATIVE_RETURNS: > Virt_ComputerSystemIndication.c:518: negative_return_fn: Function > "platform_from_class(args-> classname)" > returns a negative number. > Virt_ComputerSystemIndication.c:503: return_negative_constant: Explicitly > returning negative value "-1". > Virt_ComputerSystemIndication.c:518: var_assign: Assigning: signed variable > "platform" = "platform_from_class". > Virt_ComputerSystemIndication.c:539: negative_returns: Using > variable "platform" > as an index to array "active_filters". > > Error: NEGATIVE_RETURNS: > Virt_ComputerSystemIndication.c:518: negative_return_fn: Function > "platform_from_class(args-> classname)" > returns a negative number. > Virt_ComputerSystemIndication.c:503: return_negative_constant: Explicitly > returning negative value "-1". > Virt_ComputerSystemIndication.c:518: var_assign: Assigning: signed variable > "platform" = "platform_from_class". > Virt_ComputerSystemIndication.c:596: negative_returns: Using > variable "platform" > as an index to array "thread_id". > > Error: NEGATIVE_RETURNS: > Virt_VSMigrationService.c:512: negative_return_fn: Function "mkstemp > (filename)" > returns a negative number. > Virt_VSMigrationService.c:512: var_assign: Assigning: signed variable > "fd" = "mkstemp". > Virt_VSMigrationService.c:547: negative_returns: "fd" is passed to aparameter > that cannot be negative. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > libxkutil/infostore.c | 4 +++- > src/Virt_ComputerSystemIndication.c | 12 +++++++++--- > src/Virt_VSMigrationService.c | 3 ++- > 3 files changed, 14 insertions(+), 5 deletions(-) > > diff --git a/libxkutil/infostore.c b/libxkutil/infostore.c > index 716dedd..dd1e38c 100644 > --- a/libxkutil/infostore.c > +++ b/libxkutil/infostore.c > @@ -50,7 +50,9 @@ static void infostore_cleanup_ctx(struct infostore_ctx *ctx) > { > xmlXPathFreeContext(ctx->xpathctx); > xmlFreeDoc(ctx->doc); > - close(ctx->fd); > + > + if (ctx->fd >= 0) > + close(ctx->fd); > > free(ctx); > } > diff --git a/src/Virt_ComputerSystemIndication.c b/src/ > Virt_ComputerSystemIndication.c > index 337f20a..9b3b80b 100644 > --- a/src/Virt_ComputerSystemIndication.c > +++ b/src/Virt_ComputerSystemIndication.c > @@ -518,11 +518,14 @@ static CMPI_THREAD_RETURN lifecycle_thread(void *params) > char *prefix = class_prefix_name(args->classname); > int platform = platform_from_class(args->classname); > > + if (prefix == NULL || platform == -1) > + goto init_out; > + > conn = connect_by_classname(_BROKER, args->classname, &s); > if (conn == NULL) { > CU_DEBUG("Unable to start lifecycle thread: " > "Failed to connect (cn: %s)", args->classname); > - goto out; > + goto conn_out; > } > > pthread_mutex_lock(&lifecycle_mutex); > @@ -591,16 +594,19 @@ static CMPI_THREAD_RETURN lifecycle_thread(void *params) > } > } > > - out: > CU_DEBUG("Exiting CSI event loop (%s)", prefix); > > thread_id[platform] = 0; > > pthread_mutex_unlock(&lifecycle_mutex); > stdi_free_ind_args(&args); > - free(prefix); > + > + conn_out: > virConnectClose(conn); > > + init_out: > + free(prefix); > + > return NULL; > } > > diff --git a/src/Virt_VSMigrationService.c b/src/Virt_VSMigrationService.c > index 414feda..be9bb7c 100644 > --- a/src/Virt_VSMigrationService.c > +++ b/src/Virt_VSMigrationService.c > @@ -544,7 +544,8 @@ static char *write_params(CMPIArray *array) > if (file != NULL) > fclose(file); > > - close(fd); > + if (fd >= 0) > + close(fd); > > return filename; > } > -- > 1.7.4.4 > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From snmishra at us.ibm.com Thu Nov 3 22:39:43 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 15:39:43 -0700 Subject: [Libvirt-cim] [PATCH 3/8] device_parsing: Avoid NULL dereferences In-Reply-To: <1320342516-25150-4-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-4-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: +1 Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 11/03/2011 10:48:31 AM: > "Eduardo Lima (Etrunko)" > Sent by: libvirt-cim-bounces at redhat.com > > 11/03/2011 10:48 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > "Eduardo Lima \(Etrunko\)" > > Subject > > [Libvirt-cim] [PATCH 3/8] device_parsing: Avoid NULL dereferences > > From: Eduardo Lima (Etrunko) > > As revealed by Coverity scan report: > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > Error: REVERSE_INULL: > device_parsing.c:1153: deref_ptr: Directly dereferencing pointer "dominfo". > device_parsing.c:1155: check_after_deref: Dereferencing "dominfo" > before a null > check. > > Error: FORWARD_NULL: > device_parsing.c:226: assign_zero: Assigning: "ddev" = 0. > device_parsing.c:284: var_deref_model: Passing null variable "ddev" > to function > "cleanup_disk_device", which dereferences it. > device_parsing.c:54: deref_parm: Directly dereferencing parameter "dev". > > Error: FORWARD_NULL: > device_parsing.c:170: assign_zero: Assigning: "ddev" = 0. > device_parsing.c:217: var_deref_model: Passing null variable "ddev" > to function > "cleanup_disk_device", which dereferences it. > device_parsing.c:54: deref_parm: Directly dereferencing parameter "dev". > > Error: FORWARD_NULL: > device_parsing.c:457: assign_zero: Assigning: "edev" = 0. > device_parsing.c:475: var_deref_model: Passing null variable "edev" > to function > "cleanup_emu_device", which dereferences it. > device_parsing.c:88: deref_parm: Directly dereferencing parameter "dev". > > Error: FORWARD_NULL: > device_parsing.c:516: assign_zero: Assigning: "gdev" = 0. > device_parsing.c:579: var_deref_model: Passing null variable "gdev" > to function > "cleanup_graphics_device", which dereferences it. > device_parsing.c:93: deref_parm: Directly dereferencing parameter "dev". > > Error: FORWARD_NULL: > device_parsing.c:588: assign_zero: Assigning: "idev" = 0. > device_parsing.c:615: var_deref_model: Passing null variable "idev" > to function > "cleanup_input_device", which dereferences it. > device_parsing.c:102: deref_parm: Directly dereferencing parameter "dev". > > Error: FORWARD_NULL: > device_parsing.c:310: var_compare_op: Comparing "vsi_dev" to null implies that > "vsi_dev" might be null. > device_parsing.c:344: var_deref_model: Passing null variable "vsi_dev" to > function "cleanup_vsi_device", which dereferences it. > device_parsing.c:66: deref_parm: Directly dereferencing parameter "dev". > > Error: FORWARD_NULL: > device_parsing.c:352: assign_zero: Assigning: "ndev" = 0. > device_parsing.c:416: var_deref_model: Passing null variable "ndev" > to function > "cleanup_net_device", which dereferences it. > device_parsing.c:77: deref_parm: Directly dereferencing parameter "dev". > > Signed-off-by: Eduardo Lima (Etrunko) > --- > libxkutil/device_parsing.c | 21 ++++++++++++++++++++- > 1 files changed, 20 insertions(+), 1 deletions(-) > > diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c > index d25461e..371838f 100644 > --- a/libxkutil/device_parsing.c > +++ b/libxkutil/device_parsing.c > @@ -54,6 +54,9 @@ typedef int (*dev_parse_func_t)(xmlNode *, struct > virt_device **); > > static void cleanup_disk_device(struct disk_device *dev) > { > + if (dev == NULL) > + return; > + > free(dev->type); > free(dev->device); > free(dev->driver); > @@ -66,6 +69,9 @@ static void cleanup_disk_device(struct disk_device *dev) > > static void cleanup_vsi_device(struct vsi_device *dev) > { > + if (dev == NULL) > + return; > + > free(dev->vsi_type); > free(dev->manager_id); > free(dev->type_id); > @@ -77,6 +83,9 @@ static void cleanup_vsi_device(struct vsi_device *dev) > > static void cleanup_net_device(struct net_device *dev) > { > + if (dev == NULL) > + return; > + > free(dev->type); > free(dev->mac); > free(dev->source); > @@ -88,6 +97,9 @@ static void cleanup_net_device(struct net_device *dev) > > static void cleanup_emu_device(struct emu_device *dev) > { > + if (dev == NULL) > + return; > + > free(dev->path); > } > > @@ -108,6 +120,9 @@ static void cleanup_sdl_device(struct > graphics_device *dev) > > static void cleanup_graphics_device(struct graphics_device *dev) > { > + if (dev == NULL) > + return; > + > if (STREQC(dev->type, "sdl")) { > cleanup_sdl_device(dev); > } > @@ -119,6 +134,9 @@ static void cleanup_graphics_device(struct > graphics_device *dev) > > static void cleanup_input_device(struct input_device *dev) > { > + if (dev == NULL) > + return; > + > free(dev->type); > free(dev->bus); > } > @@ -1207,11 +1225,12 @@ int get_dominfo(virDomainPtr dom, struct > domain **dominfo) > > void cleanup_dominfo(struct domain **dominfo) > { > - struct domain *dom = *dominfo; > + struct domain *dom; > > if ((dominfo == NULL) || (*dominfo == NULL)) > return; > > + dom = *dominfo; > free(dom->name); > free(dom->uuid); > free(dom->bootloader); > -- > 1.7.4.4 > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From snmishra at us.ibm.com Thu Nov 3 22:41:14 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 15:41:14 -0700 Subject: [Libvirt-cim] [PATCH 2/8] pool_parsing: Avoid NULL dereferences In-Reply-To: <1320342516-25150-3-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-3-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: +1 Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 11/03/2011 10:48:30 AM: > "Eduardo Lima (Etrunko)" > Sent by: libvirt-cim-bounces at redhat.com > > 11/03/2011 10:48 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > "Eduardo Lima \(Etrunko\)" > > Subject > > [Libvirt-cim] [PATCH 2/8] pool_parsing: Avoid NULL dereferences > > From: Eduardo Lima (Etrunko) > > As revealed by Coverity scan report: > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > Error: REVERSE_INULL: > pool_parsing.c:74: deref_ptr: Directly dereferencing pointer "pool". > pool_parsing.c:76: check_after_deref: Dereferencing "pool" before a > null check. > > Error: REVERSE_INULL: > pool_parsing.c:99: deref_ptr: Directly dereferencing pointer "res". > pool_parsing.c:101: check_after_deref: Dereferencing "res" before a > null check. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > libxkutil/pool_parsing.c | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/libxkutil/pool_parsing.c b/libxkutil/pool_parsing.c > index f7a5a2c..f73b0fd 100644 > --- a/libxkutil/pool_parsing.c > +++ b/libxkutil/pool_parsing.c > @@ -71,11 +71,12 @@ static void cleanup_disk_pool(struct disk_pool pool) { > > void cleanup_virt_pool(struct virt_pool **pool) > { > - struct virt_pool *_pool = *pool; > + struct virt_pool *_pool; > > if ((pool == NULL) || (*pool == NULL)) > return; > - > + > + _pool = *pool; > if (_pool->type == CIM_RES_TYPE_NET) > cleanup_net_pool(_pool->pool_info.net); > else if (_pool->type == CIM_RES_TYPE_DISK) > @@ -96,11 +97,13 @@ static void cleanup_image_res(struct storage_vol vol) > > void cleanup_virt_pool_res(struct virt_pool_res **res) > { > - struct virt_pool_res *_res = *res; > + struct virt_pool_res *_res; > > if ((res == NULL) || (*res == NULL)) > return; > > + _res = *res; > + > if (_res->type == CIM_RES_TYPE_IMAGE) > cleanup_image_res(_res->res.storage_vol); > > -- > 1.7.4.4 > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From snmishra at us.ibm.com Thu Nov 3 22:41:38 2011 From: snmishra at us.ibm.com (Sharad Mishra) Date: Thu, 3 Nov 2011 15:41:38 -0700 Subject: [Libvirt-cim] [PATCH 1/8] acl_parsing: Avoid NULL dereference In-Reply-To: <1320342516-25150-2-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-2-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: +1 Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces at redhat.com wrote on 11/03/2011 10:48:29 AM: > "Eduardo Lima (Etrunko)" > Sent by: libvirt-cim-bounces at redhat.com > > 11/03/2011 10:48 AM > > Please respond to > List for discussion and development of libvirt CIM > > To > > libvirt-cim at redhat.com > > cc > > "Eduardo Lima \(Etrunko\)" > > Subject > > [Libvirt-cim] [PATCH 1/8] acl_parsing: Avoid NULL dereference > > From: Eduardo Lima (Etrunko) > > As revealed by Coverity scan report: > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > Error: REVERSE_INULL: > acl_parsing.c:172: deref_ptr: Directly dereferencing pointer "filters". > acl_parsing.c:174: check_after_deref: Dereferencing "filters" before a null > check. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > libxkutil/acl_parsing.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/libxkutil/acl_parsing.c b/libxkutil/acl_parsing.c > index 935e642..7cde1f0 100644 > --- a/libxkutil/acl_parsing.c > +++ b/libxkutil/acl_parsing.c > @@ -151,11 +151,13 @@ void cleanup_filter(struct acl_filter *filter) > void cleanup_filters(struct acl_filter **filters, int count) > { > int i; > - struct acl_filter *_filters = *filters; > + struct acl_filter *_filters; > > if((filters == NULL) || (*filters == NULL) || (count == 0)) > return; > > + _filters = *filters; > + > for (i = 0; i < count; i++) > cleanup_filter(&_filters[i]); > > -- > 1.7.4.4 > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > From xiawenc at linux.vnet.ibm.com Fri Nov 4 01:37:33 2011 From: xiawenc at linux.vnet.ibm.com (Wayne Xia) Date: Fri, 04 Nov 2011 09:37:33 +0800 Subject: [Libvirt-cim] Error doing make install for libvirt-cim In-Reply-To: References: <4EADFFB8.1040009@linux.vnet.ibm.com> Message-ID: <4EB341DD.7030502@linux.vnet.ibm.com> Sorry for response late, been busy in coding a patch these days. It is nice to know you have installed the libvirt-cim on Ubuntu successfully. Also a "make postinstall" is needed to register the classes. Have u tried to make a call for this provider such as wbemcli -nl ein http://root:123456xwc at localhost:5988/root/virt:KVM_ComputerSystem if it returns the instance of VMs you created by libvirt or virt-manager, then the package works in the right way. Look at the rpm making script I think it only works with tog-pegasus, but I have not tried to "make install" it with sfcb instead of tog-pegasus. ? 2011-10-31 16:21, Deepak Shetty ??: > It looks like there is a bug in the ' make install' > I had to manually do the steps below to copy the library onto the right > path, before make install could succed > Took clues from the libxkutil.a library install that happens just before > this error. > > cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src/ > > 1) /usr/bin/install -c > .libs/libVirt_VirtualSystemSnapshotService.so.0.5.14 > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.so.0.5.14 > 2) cd /home/dpkshetty/usr/lib/cmpi/ > 3) ln -s -f libVirt_VirtualSystemSnapshotService.so.0.5.14 > libVirt_VirtualSystemSnapshotService.so.0 > 4) ln -s -f libVirt_VirtualSystemSnapshotService.so.0.5.14 > libVirt_VirtualSystemSnapshotService.so > 5) cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src/ > 6) /usr/bin/install -c .libs/libVirt_VirtualSystemSnapshotService.lai > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.la > 7) /usr/bin/install -c .libs/libVirt_VirtualSystemSnapshotService.a > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > 8) chmod 644 > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > 9) ranlib > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > 10) ldconfig -n /home/dpkshetty/usr/lib/cmpi > > After this 'make install' worked fine. > > > On Mon, Oct 31, 2011 at 10:45 AM, Deepak Shetty > wrote: > > Hello Wayne, > Thanks for the pointer , will try. > But i am on Ubuntu and did not understand why I should be doing a > 'make rpm'. > Also i have sfcb ( Lite weight broker ) installed, will that not > work with libvirt-cim ? Is CIMOM pegasus a must ? > > > On Mon, Oct 31, 2011 at 7:24 AM, Wayne Xia > > wrote: > > pls have a try for following commands with CIMOM tog-pegasus > installed: > ./autoconfiscate.sh > ./configure > make rpm > > > > ? 2011-10-29 19:46, Deepak Shetty ??: > > Hi, > I am getting the following error while doing ' make > install' for > libvirt-cim. Can someone pls help provide some pointers on > what could be > wrong here ? > > .... > .... > > test -z "/home/dpkshetty/usr/lib/cmpi" || /bin/mkdir -p > "/home/dpkshetty/usr/lib/cmpi" > /bin/bash ../libtool --mode=install /usr/bin/install -c > libVirt_ComputerSystem.la libVirt_Device.la libVirt_RASD.la > libVirt_HostSystem.la libVirt_VSSD.la > libVirt_ EnabledLogicalElementCapabilit ies.la > libVirt_DevicePool.la > libVirt_RegisteredProfile.la libVirt_ VSMigrationCapabilities.la > libVirt_ VSMigrationSettingData.la > libVirt_ VirtualSystemSnapshotServiceCa pabilities.la > > libVirt_SystemDevice.la libVirt_ ComputerSystemIndication.la > libVirt_ ResourceAllocationSettingDataI ndication.la > > libVirt_SwitchService.la libVirt_ > ComputerSystemMigrationIndicat ion.la > libVirt_ VirtualSystemManagementCapabil ities.la > > libVirt_ AllocationCapabilities.la libVirt_ReferencedProfile.la > libVirt_ VirtualSystemSnapshotService. la > libVirt_ VirtualSystemManagementService .la > libVirt_ ResourcePoolConfigurationServi ce.la > libVirt_ ResourcePoolConfigurationCapab ilities.la > > libVirt_VSMigrationService.la libVirt_ > ConsoleRedirectionService.la > libVirt_ ConsoleRedirectionServiceCapab ilities.la > > libVirt_KVMRedirectionSAP.la libVirt_ > SettingsDefineCapabilities.la > libVirt_HostedDependency.la libVirt_ ElementConformsToProfile.la > libVirt_HostedResourcePool.la libVirt_ElementCapabilities.la > libVirt_VSSDComponent.la libVirt_SettingsDefineState.la > libVirt_ ResourceAllocationFromPool.la > libVirt_ ElementAllocatedFromPool.la libVirt_HostedService.la > libVirt_ElementSettingData.la libVirt_ConcreteComponent.la > libVirt_ServiceAffectsElement. la libVirt_HostedAccessPoint.la > libVirt_ServiceAccessBySAP.la libVirt_ SAPAvailableForElement.la > libVirt_FilterList.la libVirt_FilterEntry.la > libVirt_EntriesInFilterList.la libVirt_NestedFilterList.la > libVirt_HostedFilterList.la libVirt_AppliedFilterList.la > '/home/dpkshetty/usr/lib/cmpi' > *libtool: install: warning: relinking > `libVirt_ComputerSystem.la'* > > libtool: install: (cd /home/dpkshetty/work/libvirt- > cim/libvirt-cim/src; > /bin/bash /home/dpkshetty/work/libvirt- > cim/libvirt-cim/libtool --silent > --tag CC --mode=relink gcc -g -O2 -D_FORTIFY_SOURCE=2 > -D_GNU_SOURCE > -D_LARGEFILE64_SOURCE -Wall -Wmissing-prototypes > -Wmissing-declarations > -Wstrict-prototypes -Wpointer-arith -Wformat=2 -Wformat-security > -Wformat-nonliteral -Wno-format-y2k -Wcast-align > -Wno-unused-value > -DLIBVIRT_CIM_CS=\" 2714b9a5e842\" -DLIBVIRT_CIM_RV=\"1151\" > -I../libxkutil ../libxkutil/libxkutil.la > > > -version-info 5:14:5 -L/home/dpkshetty/usr/lib -lvirt -ldl > -L/home/dpkshetty/usr/lib -lcmpiutil > -L/usr/lib/i386-linux-gnu -luuid -o > libVirt_ComputerSystem.la -rpath /home/dpkshetty/usr/lib/cmpi > Virt_ComputerSystem.lo -lVirt_ VirtualSystemSnapshotService ) > */usr/bin/ld: cannot find -lVirt_ VirtualSystemSnapshotService* > > collect2: ld returned 1 exit status > libtool: install: error: relink `libVirt_ComputerSystem.la' > with the > above command before installing it > make[2]: *** [install-providerLTLIBRARIES] Error 1 > make[2]: Leaving directory > `/home/dpkshetty/work/libvirt- cim/libvirt-cim/src' > make[1]: *** [install-am] Error 2 > make[1]: Leaving directory > `/home/dpkshetty/work/libvirt- cim/libvirt-cim/src' > make: *** [install-recursive] Error 1 > > > > ______________________________ _________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/ mailman/listinfo/libvirt-cim > > > > > -- > Best Regards > > Wayne Xia > mail:xiawenc at linux.vnet.ibm. com > > tel:86-010-82450803 > > > -- Best Regards Wayne Xia mail:xiawenc at linux.vnet.ibm.com tel:86-010-82450803 From dpkshetty at gmail.com Fri Nov 4 09:22:41 2011 From: dpkshetty at gmail.com (Deepak Shetty) Date: Fri, 4 Nov 2011 14:52:41 +0530 Subject: [Libvirt-cim] Error doing make install for libvirt-cim In-Reply-To: <4EB341DD.7030502@linux.vnet.ibm.com> References: <4EADFFB8.1040009@linux.vnet.ibm.com> <4EB341DD.7030502@linux.vnet.ibm.com> Message-ID: Yes, the wbemcli works fine after make postinstall, i tried ecn (enumerate class names) and it did show the libvirt classes, so I assume its working fine. Also another thing i noticed is that as part of building libvirt-cim, i think it auto wget's and installs sfcb, so i did not ever had the need to look out for pegasus. But i still feel there is a problem with the make install as I saw originally ( see the start of this post)... wondering why you or others don't see it ? I did not do anythign specific to ubuntu in my build process 2011/11/4 Wayne Xia > Sorry for response late, been busy in coding a patch these days. > > It is nice to know you have installed the libvirt-cim on Ubuntu > successfully. Also a "make postinstall" is needed to register the > classes. Have u tried to make a call for this provider such as > > wbemcli -nl ein > http://root:123456xwc at localhost:5988/root/virt:KVM_ComputerSystem > > if it returns the instance of VMs you created by libvirt or > virt-manager, then the package works in the right way. > Look at the rpm making script I think it only works with tog-pegasus, > but I have not tried to "make install" it with sfcb instead of > tog-pegasus. > > ? 2011-10-31 16:21, Deepak Shetty ??: > > It looks like there is a bug in the ' make install' > > I had to manually do the steps below to copy the library onto the right > > path, before make install could succed > > Took clues from the libxkutil.a library install that happens just before > > this error. > > > > cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src/ > > > > 1) /usr/bin/install -c > > .libs/libVirt_VirtualSystemSnapshotService.so.0.5.14 > > > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.so.0.5.14 > > 2) cd /home/dpkshetty/usr/lib/cmpi/ > > 3) ln -s -f libVirt_VirtualSystemSnapshotService.so.0.5.14 > > libVirt_VirtualSystemSnapshotService.so.0 > > 4) ln -s -f libVirt_VirtualSystemSnapshotService.so.0.5.14 > > libVirt_VirtualSystemSnapshotService.so > > 5) cd /home/dpkshetty/work/libvirt-cim/libvirt-cim/src/ > > 6) /usr/bin/install -c .libs/libVirt_VirtualSystemSnapshotService.lai > > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.la > > 7) /usr/bin/install -c .libs/libVirt_VirtualSystemSnapshotService.a > > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > > 8) chmod 644 > > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > > 9) ranlib > > /home/dpkshetty/usr/lib/cmpi/libVirt_VirtualSystemSnapshotService.a > > 10) ldconfig -n /home/dpkshetty/usr/lib/cmpi > > > > After this 'make install' worked fine. > > > > > > On Mon, Oct 31, 2011 at 10:45 AM, Deepak Shetty > > wrote: > > > > Hello Wayne, > > Thanks for the pointer , will try. > > But i am on Ubuntu and did not understand why I should be doing a > > 'make rpm'. > > Also i have sfcb ( Lite weight broker ) installed, will that not > > work with libvirt-cim ? Is CIMOM pegasus a must ? > > > > > > On Mon, Oct 31, 2011 at 7:24 AM, Wayne Xia > > > > wrote: > > > > pls have a try for following commands with CIMOM tog-pegasus > > installed: > > ./autoconfiscate.sh > > ./configure > > make rpm > > > > > > > > ? 2011-10-29 19:46, Deepak Shetty ??: > > > > Hi, > > I am getting the following error while doing ' make > > install' for > > libvirt-cim. Can someone pls help provide some pointers on > > what could be > > wrong here ? > > > > .... > > .... > > > > test -z "/home/dpkshetty/usr/lib/cmpi" || /bin/mkdir -p > > "/home/dpkshetty/usr/lib/cmpi" > > /bin/bash ../libtool --mode=install /usr/bin/install -c > > libVirt_ComputerSystem.la libVirt_Device.la libVirt_RASD.la > > libVirt_HostSystem.la libVirt_VSSD.la > > libVirt_ EnabledLogicalElementCapabilit ies.la > > libVirt_DevicePool.la > > libVirt_RegisteredProfile.la libVirt_ > VSMigrationCapabilities.la > > libVirt_ VSMigrationSettingData.la > > libVirt_ VirtualSystemSnapshotServiceCa pabilities.la > > > > libVirt_SystemDevice.la libVirt_ ComputerSystemIndication.la > > libVirt_ ResourceAllocationSettingDataI ndication.la > > > > libVirt_SwitchService.la libVirt_ > > ComputerSystemMigrationIndicat ion.la > > libVirt_ VirtualSystemManagementCapabil ities.la > > > > libVirt_ AllocationCapabilities.la > libVirt_ReferencedProfile.la > > libVirt_ VirtualSystemSnapshotService. la > > libVirt_ VirtualSystemManagementService .la > > libVirt_ ResourcePoolConfigurationServi ce.la > > libVirt_ ResourcePoolConfigurationCapab ilities.la > > > > libVirt_VSMigrationService.la libVirt_ > > ConsoleRedirectionService.la > > libVirt_ ConsoleRedirectionServiceCapab ilities.la > > > > libVirt_KVMRedirectionSAP.la libVirt_ > > SettingsDefineCapabilities.la > > libVirt_HostedDependency.la libVirt_ > ElementConformsToProfile.la > > libVirt_HostedResourcePool.la libVirt_ElementCapabilities.la > > libVirt_VSSDComponent.la libVirt_SettingsDefineState.la > > libVirt_ ResourceAllocationFromPool.la > > libVirt_ ElementAllocatedFromPool.la libVirt_HostedService.la > > libVirt_ElementSettingData.la libVirt_ConcreteComponent.la > > libVirt_ServiceAffectsElement. la > libVirt_HostedAccessPoint.la > > libVirt_ServiceAccessBySAP.la libVirt_ > SAPAvailableForElement.la > > libVirt_FilterList.la libVirt_FilterEntry.la > > libVirt_EntriesInFilterList.la libVirt_NestedFilterList.la > > libVirt_HostedFilterList.la libVirt_AppliedFilterList.la > > '/home/dpkshetty/usr/lib/cmpi' > > *libtool: install: warning: relinking > > `libVirt_ComputerSystem.la'* > > > > libtool: install: (cd /home/dpkshetty/work/libvirt- > > cim/libvirt-cim/src; > > /bin/bash /home/dpkshetty/work/libvirt- > > cim/libvirt-cim/libtool --silent > > --tag CC --mode=relink gcc -g -O2 -D_FORTIFY_SOURCE=2 > > -D_GNU_SOURCE > > -D_LARGEFILE64_SOURCE -Wall -Wmissing-prototypes > > -Wmissing-declarations > > -Wstrict-prototypes -Wpointer-arith -Wformat=2 > -Wformat-security > > -Wformat-nonliteral -Wno-format-y2k -Wcast-align > > -Wno-unused-value > > -DLIBVIRT_CIM_CS=\" 2714b9a5e842\" -DLIBVIRT_CIM_RV=\"1151\" > > -I../libxkutil ../libxkutil/libxkutil.la > > > > > > -version-info 5:14:5 -L/home/dpkshetty/usr/lib -lvirt -ldl > > -L/home/dpkshetty/usr/lib -lcmpiutil > > -L/usr/lib/i386-linux-gnu -luuid -o > > libVirt_ComputerSystem.la -rpath /home/dpkshetty/usr/lib/cmpi > > Virt_ComputerSystem.lo -lVirt_ VirtualSystemSnapshotService ) > > */usr/bin/ld: cannot find -lVirt_ > VirtualSystemSnapshotService* > > > > collect2: ld returned 1 exit status > > libtool: install: error: relink `libVirt_ComputerSystem.la' > > with the > > above command before installing it > > make[2]: *** [install-providerLTLIBRARIES] Error 1 > > make[2]: Leaving directory > > `/home/dpkshetty/work/libvirt- cim/libvirt-cim/src' > > make[1]: *** [install-am] Error 2 > > make[1]: Leaving directory > > `/home/dpkshetty/work/libvirt- cim/libvirt-cim/src' > > make: *** [install-recursive] Error 1 > > > > > > > > ______________________________ _________________ > > Libvirt-cim mailing list > > Libvirt-cim at redhat.com > > https://www.redhat.com/ mailman/listinfo/libvirt-cim > > > > > > > > > > -- > > Best Regards > > > > Wayne Xia > > mail:xiawenc at linux.vnet.ibm. com > > > > tel:86-010-82450803 > > > > > > > > > -- > Best Regards > > Wayne Xia > mail:xiawenc at linux.vnet.ibm.com > tel:86-010-82450803 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eblima at linux.vnet.ibm.com Fri Nov 4 11:05:12 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Fri, 04 Nov 2011 09:05:12 -0200 Subject: [Libvirt-cim] [PATCH 8/8] xmlgen: Avoid double-free In-Reply-To: References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-9-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EB3C6E8.4070106@linux.vnet.ibm.com> On 11/03/2011 08:31 PM, Sharad Mishra wrote: [snip] >> diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c >> index ee20895..4cca75b 100644 >> --- a/libxkutil/xmlgen.c >> +++ b/libxkutil/xmlgen.c >> @@ -1292,6 +1292,7 @@ static const char *storage_vol_xml(xmlNodePtr root, >> goto out; >> >> free(string); >> + string = NULL; > > shouldn't you be removing the free? > >> >> if (vol->cap_units != NULL) { >> xmlAttrPtr tmp = NULL; >> @@ -1309,6 +1310,7 @@ static const char *storage_vol_xml(xmlNodePtr root, >> goto out; >> >> free(string); >> + string = NULL; > > same here. > My understanding is that in error cases, the code will end up calling free(string) again in the "out" block. Thus setting the variable string to NULL after each free() call actually protects against double free. -- Eduardo de Barros Lima Software Engineer, Open Virtualization Linux Technology Center - IBM/Brazil eblima at br.ibm.com From eblima at linux.vnet.ibm.com Fri Nov 4 11:08:40 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Fri, 04 Nov 2011 09:08:40 -0200 Subject: [Libvirt-cim] [PATCH 7/8] Fix possible use of uninitialized variables In-Reply-To: References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-8-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EB3C7B8.1090302@linux.vnet.ibm.com> On 11/03/2011 08:34 PM, Sharad Mishra wrote: [snip] >> @@ -129,7 +129,7 @@ static CMPIStatus validate_service_get_caps >> (const CMPIContext *context, >> CMPIInstance **inst) >> { >> CMPIStatus s = {CMPI_RC_OK, NULL}; >> - CMPIInstance *_inst; >> + CMPIInstance *_inst = NULL; > > indentation Thanks. Pushed this fix to my clone already. -- Eduardo de Barros Lima Software Engineer, Open Virtualization Linux Technology Center - IBM/Brazil eblima at br.ibm.com From eblima at linux.vnet.ibm.com Fri Nov 4 11:16:04 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Fri, 04 Nov 2011 09:16:04 -0200 Subject: [Libvirt-cim] Error doing make install for libvirt-cim In-Reply-To: References: <4EADFFB8.1040009@linux.vnet.ibm.com> <4EB341DD.7030502@linux.vnet.ibm.com> Message-ID: <4EB3C974.2030909@linux.vnet.ibm.com> On 11/04/2011 07:22 AM, Deepak Shetty wrote: > Yes, the wbemcli works fine after make postinstall, i tried ecn > (enumerate class names) and it did show the libvirt classes, so I assume > its working fine. > Also another thing i noticed is that as part of building libvirt-cim, i > think it auto wget's and installs sfcb, so i did not ever had the need > to look out for pegasus. But i still feel there is a problem with the > make install as I saw originally ( see the start of this post)... > wondering why you or others don't see it ? > I did not do anythign specific to ubuntu in my build process > Well, it looks like the RPM build actually works by chance. We should always ensure that 'make distcheck' gives no errors, which is not the case at the moment (and has not been for quite some time). I am quite sure if that gets fixed you will be able to build the source code without errors. -- Eduardo de Barros Lima Software Engineer, Open Virtualization Linux Technology Center - IBM/Brazil eblima at br.ibm.com From dpkshetty at gmail.com Fri Nov 4 11:22:11 2011 From: dpkshetty at gmail.com (Deepak Shetty) Date: Fri, 4 Nov 2011 16:52:11 +0530 Subject: [Libvirt-cim] Error doing make install for libvirt-cim In-Reply-To: <4EB3C974.2030909@linux.vnet.ibm.com> References: <4EADFFB8.1040009@linux.vnet.ibm.com> <4EB341DD.7030502@linux.vnet.ibm.com> <4EB3C974.2030909@linux.vnet.ibm.com> Message-ID: Again, I don't know how its related, since i am on ubuntu, i never have a need to do make rpm. was i supposed to do a make deb or something ? It looks like as part of 'make' one of the library (see my original post - error msg) is probably not copied and/or linked appropraitely, hence make install fails or probably make install has issue in setting up that library correctly and when it tries to relink some other lib with that lib, it fails. 2011/11/4 Eduardo Lima (Etrunko) > On 11/04/2011 07:22 AM, Deepak Shetty wrote: > > Yes, the wbemcli works fine after make postinstall, i tried ecn > > (enumerate class names) and it did show the libvirt classes, so I assume > > its working fine. > > Also another thing i noticed is that as part of building libvirt-cim, i > > think it auto wget's and installs sfcb, so i did not ever had the need > > to look out for pegasus. But i still feel there is a problem with the > > make install as I saw originally ( see the start of this post)... > > wondering why you or others don't see it ? > > I did not do anythign specific to ubuntu in my build process > > > > Well, it looks like the RPM build actually works by chance. We should > always ensure that 'make distcheck' gives no errors, which is not the > case at the moment (and has not been for quite some time). I am quite > sure if that gets fixed you will be able to build the source code > without errors. > > -- > Eduardo de Barros Lima > Software Engineer, Open Virtualization > Linux Technology Center - IBM/Brazil > eblima at br.ibm.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eblima at linux.vnet.ibm.com Mon Nov 7 13:07:43 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Mon, 7 Nov 2011 11:07:43 -0200 Subject: [Libvirt-cim] [PATCH] Fix include path Message-ID: <1320671263-3971-1-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) $(top_builddir) is intended to be used for install paths, while $(top_srcdir) whenever trying to reference source code path. Signed-off-by: Eduardo Lima (Etrunko) --- src/Makefile.am | 2 +- src/Virt_VSMigrationService.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 53e3c65..e4e8aa1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,7 +29,7 @@ noinst_HEADERS = profiles.h svpc_types.h \ XKUADD = $(top_builddir)/libxkutil/libxkutil.la -CFLAGS += -I$(top_builddir)/libxkutil $(CFLAGS_STRICT) +CFLAGS += -I$(top_srcdir)/libxkutil $(CFLAGS_STRICT) AM_LDFLAGS = $(XKUADD) \ -version-info @VERSION_INFO@ diff --git a/src/Virt_VSMigrationService.c b/src/Virt_VSMigrationService.c index be9bb7c..4f48a68 100644 --- a/src/Virt_VSMigrationService.c +++ b/src/Virt_VSMigrationService.c @@ -48,7 +48,7 @@ #include "Virt_ComputerSystem.h" #include "Virt_VSMigrationSettingData.h" #include "svpc_types.h" -#include "libxkutil/infostore.h" +#include "infostore.h" #include "config.h" -- 1.7.4.4 From cvincent at linux.vnet.ibm.com Tue Nov 15 14:04:18 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 15 Nov 2011 09:04:18 -0500 Subject: [Libvirt-cim] [PATCH 5/8] Avoid NULL dereferences in various providers In-Reply-To: <1320342516-25150-6-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-6-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EC27162.1000303@linux.vnet.ibm.com> +1 On 11/03/2011 01:48 PM, Eduardo Lima (Etrunko) wrote: > From: Eduardo Lima (Etrunko) > > As revealed by Coverity scan report: > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > Error: FORWARD_NULL: > Virt_DevicePool.c:999: var_compare_op: Comparing "netnames" to null implies that > "netnames" might be null. > Virt_DevicePool.c:1019: var_deref_op: Dereferencing null variable "netnames". > > Error: FORWARD_NULL: > Virt_ComputerSystemIndication.c:259: var_compare_op: Comparing "ind" to null > implies that "ind" might be null. > Virt_ComputerSystemIndication.c:267: var_deref_op: Dereferencing null variable > "ind". > > Error: FORWARD_NULL: > Virt_ResourcePoolConfigurationService.c:759: var_compare_op: Comparing "op" to > null implies that "op" might be > null. > Virt_ResourcePoolConfigurationService.c:779: var_deref_op: Dereferencing null > variable "op". > > Error: FORWARD_NULL: > Virt_ResourcePoolConfigurationService.c:1028: var_compare_op: Comparing "res" to > null implies that "res" might be > null. > Virt_ResourcePoolConfigurationService.c:1035: var_deref_op: Dereferencing null > variable "res". > > Error: FORWARD_NULL: > Virt_VSMigrationService.c:766: var_compare_op: Comparing "ref" to null implies > that "ref" might be null. > Virt_VSMigrationService.c:796: var_deref_op: Dereferencing null variable "ref". > > Error: FORWARD_NULL: > Virt_VirtualSystemManagementService.c:1274: var_compare_op: Comparing "op" to > null implies that "op" might be > null. > Virt_VirtualSystemManagementService.c:1292: var_deref_op: Dereferencing null > variable "op". > > Error: FORWARD_NULL: > Virt_VirtualSystemSnapshotService.c:353: var_compare_op: Comparing "ctx" to null > implies that "ctx" might be null. > Virt_VirtualSystemSnapshotService.c:376: var_deref_model: Passing null variable > "ctx" to function "snap_job_free", > which dereferences it. > Virt_VirtualSystemSnapshotService.c:66: deref_parm: Directly dereferencing > parameter "ctx". > > Error: REVERSE_INULL: > Virt_ResourcePoolConfigurationService.c:173: deref_ptr: Directly dereferencing > pointer "path_list". > Virt_ResourcePoolConfigurationService.c:174: check_after_deref: Dereferencing > "path_list" before a null check. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > src/Virt_ComputerSystemIndication.c | 1 + > src/Virt_DevicePool.c | 8 +++++--- > src/Virt_ResourcePoolConfigurationService.c | 6 +++--- > src/Virt_VSMigrationService.c | 9 +++++++-- > src/Virt_VirtualSystemManagementService.c | 2 +- > src/Virt_VirtualSystemSnapshotService.c | 3 +++ > 6 files changed, 20 insertions(+), 9 deletions(-) > > diff --git a/src/Virt_ComputerSystemIndication.c b/src/Virt_ComputerSystemIndication.c > index c057a0c..337f20a 100644 > --- a/src/Virt_ComputerSystemIndication.c > +++ b/src/Virt_ComputerSystemIndication.c > @@ -262,6 +262,7 @@ static bool _do_indication(const CMPIBroker *broker, > prefix, > ind_type_name); > ret = false; > + goto out; > } > > ind_op = CMGetObjectPath(ind,&s); > diff --git a/src/Virt_DevicePool.c b/src/Virt_DevicePool.c > index 7112a9d..a41a378 100644 > --- a/src/Virt_DevicePool.c > +++ b/src/Virt_DevicePool.c > @@ -1015,9 +1015,11 @@ static CMPIStatus netpool_instance(virConnectPtr conn, > } > > out: > - for (i = 0; i< nets; i++) > - free(netnames[i]); > - free(netnames); > + if (netnames != NULL) { > + for (i = 0; i< nets; i++) > + free(netnames[i]); > + free(netnames); > + } > > return s; > } > diff --git a/src/Virt_ResourcePoolConfigurationService.c b/src/Virt_ResourcePoolConfigurationService.c > index 3908c9c..7e76032 100644 > --- a/src/Virt_ResourcePoolConfigurationService.c > +++ b/src/Virt_ResourcePoolConfigurationService.c > @@ -171,7 +171,7 @@ static char *get_dev_paths(CMPIInstance *inst, > return "Unable to get DevicePaths array count"; > > *path_list = calloc(ct, sizeof(char *)); > - if (path_list == NULL) > + if (*path_list == NULL) > return "Failed to alloc space for device paths"; > > *count = ct; > @@ -775,7 +775,7 @@ static const char *rasd_to_res(CMPIInstance *inst, > msg = "This function does not support this resource type"; > > out: > - if (msg) > + if (msg&& op) > CU_DEBUG("rasd_to_res(%s): %s", CLASSNAME(op), msg); > > return msg; > @@ -1025,7 +1025,7 @@ static CMPIStatus delete_resource_in_pool(CMPIMethodMI *self, > goto out; > > res = CMGetObjectPath(resource,&s); > - if ((res == NULL)&& (s.rc != CMPI_RC_OK)) { > + if ((res == NULL) || (s.rc != CMPI_RC_OK)) { > cu_statusf(_BROKER,&s, > CMPI_RC_ERR_FAILED, > "Unable to get ObjectPath of Resource instance"); > diff --git a/src/Virt_VSMigrationService.c b/src/Virt_VSMigrationService.c > index ee79a96..414feda 100644 > --- a/src/Virt_VSMigrationService.c > +++ b/src/Virt_VSMigrationService.c > @@ -761,10 +761,15 @@ static bool raise_indication(const CMPIContext *context, > > /* This is a workaround for Pegasus, it loses its objectpath by > CMGetObjectPath. So set it back. */ > - inst->ft->setObjectPath((CMPIInstance *)inst, ref); > + if (ref != NULL) > + inst->ft->setObjectPath((CMPIInstance *)inst, ref); > > if ((ref == NULL) || (s.rc != CMPI_RC_OK)) { > CU_DEBUG("Failed to get job reference"); > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_FAILED, > + "Failed to get job reference"); > + goto out; > } else { > s = get_host_system_properties(&host, > &ccname, > @@ -798,7 +803,7 @@ static bool raise_indication(const CMPIContext *context, > s = stdi_raise_indication(_BROKER, context, type, ns, ind); > > free(type); > - > + out: > return s.rc == CMPI_RC_OK; > } > > diff --git a/src/Virt_VirtualSystemManagementService.c b/src/Virt_VirtualSystemManagementService.c > index 5edc65f..fa1e266 100644 > --- a/src/Virt_VirtualSystemManagementService.c > +++ b/src/Virt_VirtualSystemManagementService.c > @@ -1526,7 +1526,7 @@ static const char *rasd_to_vdev(CMPIInstance *inst, > else > msg = _sysvirt_rasd_to_vdev(inst, dev, type, ns); > out: > - if (msg) > + if (msg&& op) > CU_DEBUG("rasd_to_vdev(%s): %s", CLASSNAME(op), msg); > > return msg; > diff --git a/src/Virt_VirtualSystemSnapshotService.c b/src/Virt_VirtualSystemSnapshotService.c > index e7789cb..898fa57 100644 > --- a/src/Virt_VirtualSystemSnapshotService.c > +++ b/src/Virt_VirtualSystemSnapshotService.c > @@ -63,6 +63,9 @@ struct snap_context { > > static void snap_job_free(struct snap_context *ctx) > { > + if (ctx == NULL) > + return; > + > free(ctx->domain); > free(ctx->save_path); > free(ctx->ref_ns); -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From cvincent at linux.vnet.ibm.com Tue Nov 15 14:05:22 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 15 Nov 2011 09:05:22 -0500 Subject: [Libvirt-cim] [PATCH 4/8] ACL: Plug leaks In-Reply-To: <1320342516-25150-5-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> <1320342516-25150-5-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EC271A2.4020308@linux.vnet.ibm.com> +1 On 11/03/2011 01:48 PM, Eduardo Lima (Etrunko) wrote: > From: Eduardo Lima (Etrunko) > > As revealed by Coverity scan report > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > This is the same case that was fixed in commit 57765ed. The function > cleanup_filter() does not free the variable itself. In future uses, consider > using cleanup_filters() instead. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > libxkutil/acl_parsing.c | 5 ++++- > src/Virt_AppliedFilterList.c | 8 ++++---- > src/Virt_EntriesInFilterList.c | 2 +- > src/Virt_FilterEntry.c | 2 +- > src/Virt_FilterList.c | 6 +++--- > src/Virt_NestedFilterList.c | 17 +++++++---------- > 6 files changed, 20 insertions(+), 20 deletions(-) > > diff --git a/libxkutil/acl_parsing.c b/libxkutil/acl_parsing.c > index 7cde1f0..5b6d7bb 100644 > --- a/libxkutil/acl_parsing.c > +++ b/libxkutil/acl_parsing.c > @@ -357,8 +357,10 @@ static int parse_acl_filter(xmlNode *fnode, struct acl_filter *filter) > if (parse_acl_rule(child, rule) == 0) > goto err; > > - if (append_filter_rule(filter, rule) == 0) > + if (append_filter_rule(filter, rule) == 0) { > + cleanup_rule(rule); > goto err; > + } > } > else if (XSTREQ(child->name, "filterref")) { > filter_ref = get_attr_value(child, "filter"); > @@ -504,6 +506,7 @@ int get_filters( > break; > > memcpy(&filters[i], filter, sizeof(*filter)); > + free(filter); > } > > *list = filters; > diff --git a/src/Virt_AppliedFilterList.c b/src/Virt_AppliedFilterList.c > index 6dad3cb..6567118 100644 > --- a/src/Virt_AppliedFilterList.c > +++ b/src/Virt_AppliedFilterList.c > @@ -193,7 +193,7 @@ static CMPIStatus list_to_net( > if (filter == NULL) > goto out; > > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > > /* get domains */ > dcount = get_domain_list(conn,&doms); > @@ -331,7 +331,7 @@ static CMPIStatus net_to_list( > filter, > &instance); > > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > > if (instance != NULL) > inst_list_add(list, instance); > @@ -515,7 +515,7 @@ static CMPIStatus CreateInstance( > free(domain_name); > free(net_name); > > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > cleanup_virt_devices(&device, 1); > > virDomainFree(dom); > @@ -625,7 +625,7 @@ static CMPIStatus DeleteInstance( > free(domain_name); > free(net_name); > > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > cleanup_virt_devices(&device, 1); > > virDomainFree(dom); > diff --git a/src/Virt_EntriesInFilterList.c b/src/Virt_EntriesInFilterList.c > index 5b95dd3..2c8ac47 100644 > --- a/src/Virt_EntriesInFilterList.c > +++ b/src/Virt_EntriesInFilterList.c > @@ -83,7 +83,7 @@ static CMPIStatus list_to_rule( > } > } > > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > > out: > virConnectClose(conn); > diff --git a/src/Virt_FilterEntry.c b/src/Virt_FilterEntry.c > index ad87689..acc3d61 100644 > --- a/src/Virt_FilterEntry.c > +++ b/src/Virt_FilterEntry.c > @@ -687,7 +687,7 @@ CMPIStatus get_rule_by_ref( > &s); > out: > free(filter_name); > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > virConnectClose(conn); > > return s; > diff --git a/src/Virt_FilterList.c b/src/Virt_FilterList.c > index 5df2a92..35d18a9 100644 > --- a/src/Virt_FilterList.c > +++ b/src/Virt_FilterList.c > @@ -177,7 +177,7 @@ CMPIStatus get_filter_by_ref(const CMPIBroker *broker, > s = instance_from_filter(broker, context, reference, filter, instance); > > out: > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > virConnectClose(conn); > > return s; > @@ -320,7 +320,7 @@ static CMPIStatus CreateInstance( > CU_DEBUG("CreateInstance complete"); > > out: > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > virConnectClose(conn); > > return s; > @@ -361,7 +361,7 @@ static CMPIStatus DeleteInstance( > delete_filter(conn, filter); > > out: > - cleanup_filter(filter); > + cleanup_filters(&filter, 1); > virConnectClose(conn); > > return s; > diff --git a/src/Virt_NestedFilterList.c b/src/Virt_NestedFilterList.c > index a129f01..894cd7c 100644 > --- a/src/Virt_NestedFilterList.c > +++ b/src/Virt_NestedFilterList.c > @@ -155,13 +155,11 @@ static CMPIStatus parent_to_child( > inst_list_add(list, instance); > } > > - cleanup_filter(child_filter); > - > - child_filter = NULL; > + cleanup_filters(&child_filter, 1); > instance = NULL; > } > > - cleanup_filter(parent_filter); > + cleanup_filters(&parent_filter, 1); > > out: > virConnectClose(conn); > @@ -223,10 +221,9 @@ static CMPIStatus child_to_parent( > > } > > - cleanup_filter(&_list[i]); > } > > - free(_list); > + cleanup_filters(&_list, count); > > out: > virConnectClose(conn); > @@ -390,8 +387,8 @@ static CMPIStatus CreateInstance( > CU_DEBUG("CreateInstance completed"); > > out: > - cleanup_filter(parent_filter); > - cleanup_filter(child_filter); > + cleanup_filters(&parent_filter, 1); > + cleanup_filters(&child_filter, 1); > virConnectClose(conn); > > return s; > @@ -481,8 +478,8 @@ static CMPIStatus DeleteInstance( > CU_DEBUG("CreateInstance completed"); > > out: > - cleanup_filter(parent_filter); > - cleanup_filter(child_filter); > + cleanup_filters(&parent_filter, 1); > + cleanup_filters(&child_filter, 1); > virConnectClose(conn); > > return s; -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From cvincent at linux.vnet.ibm.com Tue Nov 15 14:14:00 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 15 Nov 2011 09:14:00 -0500 Subject: [Libvirt-cim] Various fixes revealed by Coverity scan report In-Reply-To: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320342516-25150-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EC273A8.5050704@linux.vnet.ibm.com> My cimtests ran as expected after this series was applied. Pushed. Thank you. On 11/03/2011 01:48 PM, Eduardo Lima (Etrunko) wrote: > Hi all, > > The cool RedHat folks were kind enough to share a recent report generated by > Coverity which exposes a lot of potential errors on libvirt-cim code. > > https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8 > https://bugzilla.redhat.com/attachment.cgi?id=530435 > > I went through each one of them and fixed all of them that I considered it > actually make sense to fix. There are a few false positives that were ignored. > The result is this series of patches following. > > Finally, I have ran the cimtests with all these applied and they work as > expected. > > Best regards, > > -- > Eduardo de Barros Lima > Software Engineer, Open Virtualization > Linux Technology Center - IBM/Brazil > eblima at br.ibm.com > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From cvincent at linux.vnet.ibm.com Tue Nov 15 14:21:23 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Tue, 15 Nov 2011 09:21:23 -0500 Subject: [Libvirt-cim] [PATCH] Fix include path In-Reply-To: <1320671263-3971-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1320671263-3971-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EC27563.2070909@linux.vnet.ibm.com> Yep. Good catch. +1 and pushed. Thanks. On 11/07/2011 08:07 AM, Eduardo Lima (Etrunko) wrote: > From: Eduardo Lima (Etrunko) > > $(top_builddir) is intended to be used for install paths, while $(top_srcdir) > whenever trying to reference source code path. > > Signed-off-by: Eduardo Lima (Etrunko) > --- > src/Makefile.am | 2 +- > src/Virt_VSMigrationService.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/Makefile.am b/src/Makefile.am > index 53e3c65..e4e8aa1 100644 > --- a/src/Makefile.am > +++ b/src/Makefile.am > @@ -29,7 +29,7 @@ noinst_HEADERS = profiles.h svpc_types.h \ > > XKUADD = $(top_builddir)/libxkutil/libxkutil.la > > -CFLAGS += -I$(top_builddir)/libxkutil $(CFLAGS_STRICT) > +CFLAGS += -I$(top_srcdir)/libxkutil $(CFLAGS_STRICT) > > AM_LDFLAGS = $(XKUADD) \ > -version-info @VERSION_INFO@ > diff --git a/src/Virt_VSMigrationService.c b/src/Virt_VSMigrationService.c > index be9bb7c..4f48a68 100644 > --- a/src/Virt_VSMigrationService.c > +++ b/src/Virt_VSMigrationService.c > @@ -48,7 +48,7 @@ > #include "Virt_ComputerSystem.h" > #include "Virt_VSMigrationSettingData.h" > #include "svpc_types.h" > -#include "libxkutil/infostore.h" > +#include "infostore.h" > > #include "config.h" > -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From cvincent at linux.vnet.ibm.com Thu Nov 17 20:31:41 2011 From: cvincent at linux.vnet.ibm.com (Chip Vincent) Date: Thu, 17 Nov 2011 15:31:41 -0500 Subject: [Libvirt-cim] [PATCH] [TEST] Fix VSMS 09_procrasd_persist and 11_define_memrasdunits In-Reply-To: References: <1319749650-29641-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <4EC56F2D.3080003@linux.vnet.ibm.com> Missed this one. Thanks. Pushed. On 11/03/2011 12:41 PM, Sharad Mishra wrote: > +1 > > Sharad Mishra > Open Virtualization > Linux Technology Center > IBM > > libvirt-cim-bounces at redhat.com wrote on 10/27/2011 02:07:30 PM: > >> "Eduardo Lima (Etrunko)" >> Sent by: libvirt-cim-bounces at redhat.com >> >> 10/27/2011 02:07 PM >> >> Please respond to >> List for discussion and development of libvirt CIM > >> To >> >> libvirt-cim at redhat.com >> >> cc >> >> "Eduardo Lima \(Etrunko\)" >> >> Subject >> >> [Libvirt-cim] [PATCH] [TEST] Fix VSMS 09_procrasd_persist and >> 11_define_memrasdunits >> >> From: Eduardo Lima (Etrunko) >> >> Both tests were failing due to reusing an instance of the class for > defining >> domains in a loop. The error message was the following: >> >> ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: >> VirtualDevice >> property must be unique for each DiskResourceAllocationSettingData in > a >> single guest with return code 1 >> >> A recent change in XenKvmLib/vxml.py necessary for the new test >> 32_modify_cdrom_media.py triggered this bug. To avoid this error we > simply >> create a new instance of that class in each iteration of the loop. >> >> Signed-off-by: Eduardo Lima (Etrunko) >> --- >> .../09_procrasd_persist.py | 3 ++- >> .../11_define_memrasdunits.py | 4 ++-- >> 2 files changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/suites/libvirt-cim/cimtest/ >> VirtualSystemManagementService/09_procrasd_persist.py b/suites/ >> libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py >> index 91415dd..a53c5ac 100644 >> --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/ >> 09_procrasd_persist.py >> +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/ >> 09_procrasd_persist.py >> @@ -119,11 +119,12 @@ def main(): >> virt = options.virt >> server = options.ip >> >> - cxml = get_class(virt)(test_dom) >> + cxml = None >> prasd_cn = get_typed_class(virt, > "ProcResourceAllocationSettingData") >> dom_define = dom_start = False >> try: >> for count in range(3): >> + cxml = get_class(virt)(test_dom) >> status = setup_guest(server, virt, cxml, prasd_cn) >> if status != PASS: >> return status >> diff --git a/suites/libvirt-cim/cimtest/ >> VirtualSystemManagementService/11_define_memrasdunits.py b/suites/ >> > libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py > >> index 8c032c2..3f54ff4 100644 >> --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/ >> 11_define_memrasdunits.py >> +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/ >> 11_define_memrasdunits.py >> @@ -113,8 +113,7 @@ def check_value(options): >> def main(): >> options = main.options >> >> - cxml = get_class(options.virt)(default_dom) >> - >> + cxml = None >> status = FAIL >> guest_is_undefined = None >> >> @@ -123,6 +122,7 @@ def main(): >> >> value = mem_bytes>> shift >> >> + cxml = get_class(options.virt)(default_dom) >> status = try_define(options, units, value, cxml) >> if status != PASS: >> break >> -- >> 1.7.4.4 >> >> _______________________________________________ >> Libvirt-cim mailing list >> Libvirt-cim at redhat.com >> https://www.redhat.com/mailman/listinfo/libvirt-cim >> > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Chip Vincent Open Virtualization IBM Linux Technology Center cvincent at linux.vnet.ibm.com From eblima at linux.vnet.ibm.com Tue Nov 22 18:10:11 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Tue, 22 Nov 2011 16:10:11 -0200 Subject: [Libvirt-cim] Comply with make distcheck Message-ID: <1321985413-28025-1-git-send-email-eblima@linux.vnet.ibm.com> This is a simple patch series that makes the build pass make distcheck. I tried (not much) to make the tests at least build, without success. This way I simply considered them broken and removed from the source tree. Best regards, Etrunko From eblima at linux.vnet.ibm.com Tue Nov 22 18:10:13 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Tue, 22 Nov 2011 16:10:13 -0200 Subject: [Libvirt-cim] [PATCH 2/2] Build: Make 'make distcheck' happy In-Reply-To: <1321985413-28025-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1321985413-28025-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1321985413-28025-3-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) Signed-off-by: Eduardo Lima (Etrunko) --- Makefile.am | 302 +++++++++++++++++++++++++++--------------------------- doc/Makefile.am | 4 + 2 files changed, 155 insertions(+), 151 deletions(-) diff --git a/Makefile.am b/Makefile.am index 5f004ec..94dc5f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,171 +4,171 @@ AUTOMAKE_OPTIONS=dist-bzip2 SUBDIRS = libxkutil src doc base_schema MOFS = \ - schema/ComputerSystem.mof \ - schema/LogicalDisk.mof \ - schema/NetworkPort.mof \ - schema/Memory.mof \ - schema/Processor.mof \ - schema/SystemDevice.mof \ - schema/Virt_VSSD.mof \ - schema/VSSD.mof \ - schema/HostSystem.mof \ - schema/HostedDependency.mof \ - schema/VirtualSystemManagementService.mof \ - schema/VirtualSystemManagementCapabilities.mof \ - schema/EnabledLogicalElementCapabilities.mof \ - schema/AllocationCapabilities.mof \ - schema/SettingsDefineCapabilities.mof \ - schema/MemoryPool.mof \ - schema/ElementCapabilities.mof \ - schema/ProcessorPool.mof \ - schema/DiskPool.mof \ - schema/HostedResourcePool.mof \ - schema/RegisteredProfile.mof \ - schema/ElementConformsToProfile.mof \ - schema/ComputerSystemIndication.mof \ - schema/ResourceAllocationSettingDataIndication.mof \ - schema/SwitchService.mof \ - schema/ComputerSystemMigrationIndication.mof \ - schema/Virt_ResourceAllocationSettingData.mof \ - schema/ResourceAllocationSettingData.mof \ - schema/ResourcePoolConfigurationService.mof \ - schema/ResourcePoolConfigurationCapabilities.mof \ - schema/VSSDComponent.mof \ - schema/SettingsDefineState.mof \ - schema/NetPool.mof \ - schema/ResourceAllocationFromPool.mof \ - schema/ElementAllocatedFromPool.mof \ - schema/HostedService.mof \ - schema/ElementSettingData.mof \ - schema/VSMigrationCapabilities.mof \ - schema/VSMigrationService.mof \ - schema/VSMigrationSettingData.mof \ - schema/VirtualSystemSnapshotService.mof \ - schema/VirtualSystemSnapshotServiceCapabilities.mof \ - schema/ConcreteComponent.mof \ - schema/ConsoleRedirectionService.mof \ - schema/ConsoleRedirectionServiceCapabilities.mof \ - schema/ServiceAffectsElement.mof \ - schema/KVMRedirectionSAP.mof \ - schema/DisplayController.mof \ - schema/PointingDevice.mof \ - schema/GraphicsPool.mof \ - schema/InputPool.mof \ - schema/HostedAccessPoint.mof \ - schema/ServiceAccessBySAP.mof \ - schema/SAPAvailableForElement.mof \ - schema/FilterEntry.mof \ - schema/FilterList.mof \ - schema/EntriesInFilterList.mof \ - schema/NestedFilterList.mof \ - schema/AppliedFilterList.mof \ - schema/HostedFilterList.mof + $(top_srcdir)/schema/ComputerSystem.mof \ + $(top_srcdir)/schema/LogicalDisk.mof \ + $(top_srcdir)/schema/NetworkPort.mof \ + $(top_srcdir)/schema/Memory.mof \ + $(top_srcdir)/schema/Processor.mof \ + $(top_srcdir)/schema/SystemDevice.mof \ + $(top_srcdir)/schema/Virt_VSSD.mof \ + $(top_srcdir)/schema/VSSD.mof \ + $(top_srcdir)/schema/HostSystem.mof \ + $(top_srcdir)/schema/HostedDependency.mof \ + $(top_srcdir)/schema/VirtualSystemManagementService.mof \ + $(top_srcdir)/schema/VirtualSystemManagementCapabilities.mof \ + $(top_srcdir)/schema/EnabledLogicalElementCapabilities.mof \ + $(top_srcdir)/schema/AllocationCapabilities.mof \ + $(top_srcdir)/schema/SettingsDefineCapabilities.mof \ + $(top_srcdir)/schema/MemoryPool.mof \ + $(top_srcdir)/schema/ElementCapabilities.mof \ + $(top_srcdir)/schema/ProcessorPool.mof \ + $(top_srcdir)/schema/DiskPool.mof \ + $(top_srcdir)/schema/HostedResourcePool.mof \ + $(top_srcdir)/schema/RegisteredProfile.mof \ + $(top_srcdir)/schema/ElementConformsToProfile.mof \ + $(top_srcdir)/schema/ComputerSystemIndication.mof \ + $(top_srcdir)/schema/ResourceAllocationSettingDataIndication.mof \ + $(top_srcdir)/schema/SwitchService.mof \ + $(top_srcdir)/schema/ComputerSystemMigrationIndication.mof \ + $(top_srcdir)/schema/Virt_ResourceAllocationSettingData.mof \ + $(top_srcdir)/schema/ResourceAllocationSettingData.mof \ + $(top_srcdir)/schema/ResourcePoolConfigurationService.mof \ + $(top_srcdir)/schema/ResourcePoolConfigurationCapabilities.mof \ + $(top_srcdir)/schema/VSSDComponent.mof \ + $(top_srcdir)/schema/SettingsDefineState.mof \ + $(top_srcdir)/schema/NetPool.mof \ + $(top_srcdir)/schema/ResourceAllocationFromPool.mof \ + $(top_srcdir)/schema/ElementAllocatedFromPool.mof \ + $(top_srcdir)/schema/HostedService.mof \ + $(top_srcdir)/schema/ElementSettingData.mof \ + $(top_srcdir)/schema/VSMigrationCapabilities.mof \ + $(top_srcdir)/schema/VSMigrationService.mof \ + $(top_srcdir)/schema/VSMigrationSettingData.mof \ + $(top_srcdir)/schema/VirtualSystemSnapshotService.mof \ + $(top_srcdir)/schema/VirtualSystemSnapshotServiceCapabilities.mof \ + $(top_srcdir)/schema/ConcreteComponent.mof \ + $(top_srcdir)/schema/ConsoleRedirectionService.mof \ + $(top_srcdir)/schema/ConsoleRedirectionServiceCapabilities.mof \ + $(top_srcdir)/schema/ServiceAffectsElement.mof \ + $(top_srcdir)/schema/KVMRedirectionSAP.mof \ + $(top_srcdir)/schema/DisplayController.mof \ + $(top_srcdir)/schema/PointingDevice.mof \ + $(top_srcdir)/schema/GraphicsPool.mof \ + $(top_srcdir)/schema/InputPool.mof \ + $(top_srcdir)/schema/HostedAccessPoint.mof \ + $(top_srcdir)/schema/ServiceAccessBySAP.mof \ + $(top_srcdir)/schema/SAPAvailableForElement.mof \ + $(top_srcdir)/schema/FilterEntry.mof \ + $(top_srcdir)/schema/FilterList.mof \ + $(top_srcdir)/schema/EntriesInFilterList.mof \ + $(top_srcdir)/schema/NestedFilterList.mof \ + $(top_srcdir)/schema/AppliedFilterList.mof \ + $(top_srcdir)/schema/HostedFilterList.mof INTEROP_MOFS = \ - schema/ComputerSystem.mof \ - schema/HostSystem.mof \ - schema/RegisteredProfile.mof \ - schema/DiskPool.mof \ - schema/MemoryPool.mof \ - schema/NetPool.mof \ - schema/ProcessorPool.mof \ - schema/VSMigrationService.mof \ - schema/ElementConformsToProfile.mof \ - schema/ReferencedProfile.mof \ - schema/AllocationCapabilities.mof + $(top_srcdir)/schema/ComputerSystem.mof \ + $(top_srcdir)/schema/HostSystem.mof \ + $(top_srcdir)/schema/RegisteredProfile.mof \ + $(top_srcdir)/schema/DiskPool.mof \ + $(top_srcdir)/schema/MemoryPool.mof \ + $(top_srcdir)/schema/NetPool.mof \ + $(top_srcdir)/schema/ProcessorPool.mof \ + $(top_srcdir)/schema/VSMigrationService.mof \ + $(top_srcdir)/schema/ElementConformsToProfile.mof \ + $(top_srcdir)/schema/ReferencedProfile.mof \ + $(top_srcdir)/schema/AllocationCapabilities.mof PGINTEROP_MOFS = \ - schema/RegisteredProfile.mof \ - schema/ElementConformsToProfile.mof \ - schema/ReferencedProfile.mof + $(top_srcdir)/schema/RegisteredProfile.mof \ + $(top_srcdir)/schema/ElementConformsToProfile.mof \ + $(top_srcdir)/schema/ReferencedProfile.mof CIMV2_MOFS = \ - schema/HostedResourcePool.mof \ - schema/ElementCapabilities.mof \ - schema/HostedService.mof \ - schema/HostedDependency.mof \ - schema/RegisteredProfile.mof \ - schema/ComputerSystem.mof \ - schema/ElementConformsToProfile.mof \ - schema/HostedAccessPoint.mof + $(top_srcdir)/schema/HostedResourcePool.mof \ + $(top_srcdir)/schema/ElementCapabilities.mof \ + $(top_srcdir)/schema/HostedService.mof \ + $(top_srcdir)/schema/HostedDependency.mof \ + $(top_srcdir)/schema/RegisteredProfile.mof \ + $(top_srcdir)/schema/ComputerSystem.mof \ + $(top_srcdir)/schema/ElementConformsToProfile.mof \ + $(top_srcdir)/schema/HostedAccessPoint.mof REGS = \ - schema/ComputerSystem.registration \ - schema/LogicalDisk.registration \ - schema/NetworkPort.registration \ - schema/Memory.registration \ - schema/Processor.registration \ - schema/SystemDevice.registration \ - schema/VSSD.registration \ - schema/HostSystem.registration \ - schema/HostedDependency.registration \ - schema/VirtualSystemManagementService.registration \ - schema/VirtualSystemManagementCapabilities.registration \ - schema/EnabledLogicalElementCapabilities.registration \ - schema/AllocationCapabilities.registration \ - schema/SettingsDefineCapabilities.registration \ - schema/MemoryPool.registration \ - schema/ElementCapabilities.registration \ - schema/ProcessorPool.registration \ - schema/DiskPool.registration \ - schema/HostedResourcePool.registration \ - schema/ComputerSystemIndication.registration \ - schema/ResourceAllocationSettingDataIndication.registration \ - schema/SwitchService.registration \ - schema/ComputerSystemMigrationIndication.registration \ - schema/ResourceAllocationSettingData.registration \ - schema/ResourcePoolConfigurationService.registration \ - schema/ResourcePoolConfigurationCapabilities.registration \ - schema/VSSDComponent.registration \ - schema/SettingsDefineState.registration \ - schema/NetPool.registration \ - schema/ResourceAllocationFromPool.registration \ - schema/ElementAllocatedFromPool.registration \ - schema/HostedService.registration \ - schema/ElementSettingData.registration \ - schema/VSMigrationCapabilities.registration \ - schema/VSMigrationService.registration \ - schema/ElementConformsToProfile.registration \ - schema/VSMigrationSettingData.registration \ - schema/VirtualSystemSnapshotService.registration \ - schema/VirtualSystemSnapshotServiceCapabilities.registration \ - schema/ConcreteComponent.registration \ - schema/ConsoleRedirectionService.registration \ - schema/ConsoleRedirectionServiceCapabilities.registration \ - schema/ServiceAffectsElement.registration \ - schema/KVMRedirectionSAP.registration \ - schema/DisplayController.registration \ - schema/PointingDevice.registration \ - schema/GraphicsPool.registration \ - schema/InputPool.registration \ - schema/HostedAccessPoint.registration \ - schema/ServiceAccessBySAP.registration \ - schema/SAPAvailableForElement.registration \ - schema/FilterEntry.registration \ - schema/FilterList.registration \ - schema/EntriesInFilterList.registration \ - schema/NestedFilterList.registration \ - schema/AppliedFilterList.registration \ - schema/HostedFilterList.registration + $(top_srcdir)/schema/ComputerSystem.registration \ + $(top_srcdir)/schema/LogicalDisk.registration \ + $(top_srcdir)/schema/NetworkPort.registration \ + $(top_srcdir)/schema/Memory.registration \ + $(top_srcdir)/schema/Processor.registration \ + $(top_srcdir)/schema/SystemDevice.registration \ + $(top_srcdir)/schema/VSSD.registration \ + $(top_srcdir)/schema/HostSystem.registration \ + $(top_srcdir)/schema/HostedDependency.registration \ + $(top_srcdir)/schema/VirtualSystemManagementService.registration \ + $(top_srcdir)/schema/VirtualSystemManagementCapabilities.registration \ + $(top_srcdir)/schema/EnabledLogicalElementCapabilities.registration \ + $(top_srcdir)/schema/AllocationCapabilities.registration \ + $(top_srcdir)/schema/SettingsDefineCapabilities.registration \ + $(top_srcdir)/schema/MemoryPool.registration \ + $(top_srcdir)/schema/ElementCapabilities.registration \ + $(top_srcdir)/schema/ProcessorPool.registration \ + $(top_srcdir)/schema/DiskPool.registration \ + $(top_srcdir)/schema/HostedResourcePool.registration \ + $(top_srcdir)/schema/ComputerSystemIndication.registration \ + $(top_srcdir)/schema/ResourceAllocationSettingDataIndication.registration \ + $(top_srcdir)/schema/SwitchService.registration \ + $(top_srcdir)/schema/ComputerSystemMigrationIndication.registration \ + $(top_srcdir)/schema/ResourceAllocationSettingData.registration \ + $(top_srcdir)/schema/ResourcePoolConfigurationService.registration \ + $(top_srcdir)/schema/ResourcePoolConfigurationCapabilities.registration \ + $(top_srcdir)/schema/VSSDComponent.registration \ + $(top_srcdir)/schema/SettingsDefineState.registration \ + $(top_srcdir)/schema/NetPool.registration \ + $(top_srcdir)/schema/ResourceAllocationFromPool.registration \ + $(top_srcdir)/schema/ElementAllocatedFromPool.registration \ + $(top_srcdir)/schema/HostedService.registration \ + $(top_srcdir)/schema/ElementSettingData.registration \ + $(top_srcdir)/schema/VSMigrationCapabilities.registration \ + $(top_srcdir)/schema/VSMigrationService.registration \ + $(top_srcdir)/schema/ElementConformsToProfile.registration \ + $(top_srcdir)/schema/VSMigrationSettingData.registration \ + $(top_srcdir)/schema/VirtualSystemSnapshotService.registration \ + $(top_srcdir)/schema/VirtualSystemSnapshotServiceCapabilities.registration \ + $(top_srcdir)/schema/ConcreteComponent.registration \ + $(top_srcdir)/schema/ConsoleRedirectionService.registration \ + $(top_srcdir)/schema/ConsoleRedirectionServiceCapabilities.registration \ + $(top_srcdir)/schema/ServiceAffectsElement.registration \ + $(top_srcdir)/schema/KVMRedirectionSAP.registration \ + $(top_srcdir)/schema/DisplayController.registration \ + $(top_srcdir)/schema/PointingDevice.registration \ + $(top_srcdir)/schema/GraphicsPool.registration \ + $(top_srcdir)/schema/InputPool.registration \ + $(top_srcdir)/schema/HostedAccessPoint.registration \ + $(top_srcdir)/schema/ServiceAccessBySAP.registration \ + $(top_srcdir)/schema/SAPAvailableForElement.registration \ + $(top_srcdir)/schema/FilterEntry.registration \ + $(top_srcdir)/schema/FilterList.registration \ + $(top_srcdir)/schema/EntriesInFilterList.registration \ + $(top_srcdir)/schema/NestedFilterList.registration \ + $(top_srcdir)/schema/AppliedFilterList.registration \ + $(top_srcdir)/schema/HostedFilterList.registration INTEROP_REGS = \ - schema/RegisteredProfile.registration \ - schema/ElementConformsToProfile.registration \ - schema/ReferencedProfile.registration + $(top_srcdir)/schema/RegisteredProfile.registration \ + $(top_srcdir)/schema/ElementConformsToProfile.registration \ + $(top_srcdir)/schema/ReferencedProfile.registration PGINTEROP_REGS = \ - schema/RegisteredProfile.registration \ - schema/ElementConformsToProfile.registration \ - schema/ReferencedProfile.registration + $(top_srcdir)/schema/RegisteredProfile.registration \ + $(top_srcdir)/schema/ElementConformsToProfile.registration \ + $(top_srcdir)/schema/ReferencedProfile.registration CIMV2_REGS = \ - schema/HostedResourcePool.registration \ - schema/ElementCapabilities.registration \ - schema/HostedService.registration \ - schema/HostedDependency.registration \ - schema/ElementConformsToProfile.registration \ - schema/HostedAccessPoint.registration + $(top_srcdir)/schema/HostedResourcePool.registration \ + $(top_srcdir)/schema/ElementCapabilities.registration \ + $(top_srcdir)/schema/HostedService.registration \ + $(top_srcdir)/schema/HostedDependency.registration \ + $(top_srcdir)/schema/ElementConformsToProfile.registration \ + $(top_srcdir)/schema/HostedAccessPoint.registration pkgdata_SCRIPTS = provider-register.sh diff --git a/doc/Makefile.am b/doc/Makefile.am index 222f192..cd9232c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -20,4 +20,8 @@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) @INSTALL@ -m 0644 $(srcdir)/*.html $(DESTDIR)$(HTML_DIR) +uninstall-local: + rm -f $(DESTDIR)$(HTML_DIR)/*.html + rmdir $(DESTDIR)$(HTML_DIR) + all: $(WEB_PAGES) -- 1.7.4.4 From eblima at linux.vnet.ibm.com Tue Nov 22 18:10:12 2011 From: eblima at linux.vnet.ibm.com (Eduardo Lima (Etrunko)) Date: Tue, 22 Nov 2011 16:10:12 -0200 Subject: [Libvirt-cim] [PATCH 1/2] Build: Remove tests subdirs from source In-Reply-To: <1321985413-28025-1-git-send-email-eblima@linux.vnet.ibm.com> References: <1321985413-28025-1-git-send-email-eblima@linux.vnet.ibm.com> Message-ID: <1321985413-28025-2-git-send-email-eblima@linux.vnet.ibm.com> From: Eduardo Lima (Etrunko) This is the first step trying to comply with make distcheck. Those files don't even compile for quite some time, I wonder if they are used by anyone. Signed-off-by: Eduardo Lima (Etrunko) --- configure.ac | 2 - libxkutil/Makefile.am | 1 - libxkutil/tests/Makefile.am | 10 -- libxkutil/tests/infostore.c | 80 ----------- libxkutil/tests/xml_devices.c | 293 ----------------------------------------- libxkutil/tests/xml_dominfo.c | 73 ---------- libxkutil/tests/xml_tag.c | 95 ------------- libxkutil/tests/xmlgen.c | 58 -------- src/Makefile.am | 1 - src/tests/Makefile.am | 6 - src/tests/test_link.sh | 17 --- 11 files changed, 0 insertions(+), 636 deletions(-) delete mode 100644 libxkutil/tests/Makefile.am delete mode 100644 libxkutil/tests/infostore.c delete mode 100644 libxkutil/tests/xml_devices.c delete mode 100644 libxkutil/tests/xml_dominfo.c delete mode 100644 libxkutil/tests/xml_tag.c delete mode 100644 libxkutil/tests/xmlgen.c delete mode 100644 src/tests/Makefile.am delete mode 100644 src/tests/test_link.sh diff --git a/configure.ac b/configure.ac index 3a7bcff..a1dc3ca 100644 --- a/configure.ac +++ b/configure.ac @@ -141,9 +141,7 @@ AC_CONFIG_FILES([ base_schema/install_base_schema.sh base_schema/Makefile libxkutil/Makefile - libxkutil/tests/Makefile src/Makefile - src/tests/Makefile doc/Makefile Makefile ]) diff --git a/libxkutil/Makefile.am b/libxkutil/Makefile.am index f6abce5..f1adc03 100644 --- a/libxkutil/Makefile.am +++ b/libxkutil/Makefile.am @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -SUBDIRS = tests AM_CFLAGS = $(CFLAGS_STRICT) \ -DLIBVIRTCIM_CONF=\"@sysconfdir@/@PACKAGE at .conf\" diff --git a/libxkutil/tests/Makefile.am b/libxkutil/tests/Makefile.am deleted file mode 100644 index 7c0cdc6..0000000 --- a/libxkutil/tests/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright IBM Corp. 2007 -TESTS = xml_tag.test xml_devices.test xmlgen.test xml_dominfo.test infostore.test - -CFLAGS += -g - -%.test: %.c - $(CC) -o $@ $^ $(CFLAGS) -lvirt `xml2-config --libs` -L../.libs -lxkutil - -clean-local: - rm -f *.test diff --git a/libxkutil/tests/infostore.c b/libxkutil/tests/infostore.c deleted file mode 100644 index df625bb..0000000 --- a/libxkutil/tests/infostore.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright IBM Corp. 2008 - * - * Authors: - * Dan Smith - * - * 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 - */ - -#include -#include - -#include - -#include "../infostore.h" - -int main(int argc, char **argv) -{ - struct infostore_ctx *ctx = NULL; - virConnectPtr conn = NULL; - virDomainPtr dom = NULL; - - if (argc != 2) { - printf("Usage: %s \n", argv[0]); - return 1; - } - - conn = virConnectOpen(NULL); - if (conn == NULL) { - printf("Unable to open connection\n"); - goto out; - } - - dom = virDomainLookupByName(conn, argv[1]); - if (dom == NULL) { - printf("Unable to lookup domain `%s'\n", argv[1]); - goto out; - } - - ctx = infostore_open(dom); - if (ctx == NULL) { - printf("Unable to open infostore for `%s'\n", argv[1]); - goto out; - } - - printf("Foo: %" PRIu64 "\n", infostore_get_u64(ctx, "foo")); - - infostore_set_u64(ctx, "foo", 321); - infostore_set_u64(ctx, "bar", 987); - printf("Should be (null): %s\n", infostore_get_str(ctx, "baz")); - - out: - infostore_close(ctx); - virDomainFree(dom); - virConnectClose(conn); - - return 0; -} - -/* - * Local Variables: - * mode: C - * c-set-style: "K&R" - * tab-width: 8 - * c-basic-offset: 8 - * indent-tabs-mode: nil - * End: - */ diff --git a/libxkutil/tests/xml_devices.c b/libxkutil/tests/xml_devices.c deleted file mode 100644 index 08b9f04..0000000 --- a/libxkutil/tests/xml_devices.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright IBM Corp. 2007 - * - * Authors: - * Dan Smith - * Zhengang Li - * - * 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 - */ -#include - -#include "../device_parsing.h" -#include "../device_parsing.c" - -#define STREQ(x, y) (strcmp(x, y) == 0) - -static void print_disk(struct disk_device *dev) -{ - fprintf(stderr, - "type: %s\n" - "device: %s\n" - "driver: %s\n" - "source: %s\n" - "vdev: %s\n", - dev->type, dev->device, dev->driver, - dev->source, dev->virtual_dev); -} - -static void print_net(struct net_device *dev) -{ - fprintf(stderr, - "type: %s\n" - "mac: %s\n", - dev->type, dev->mac); -} - -static void print_dev(struct virt_device *dev) -{ - if (dev->type == VIRT_DEV_DISK) - print_disk(&dev->dev.disk); - else if (dev->type == VIRT_DEV_NET) - print_net(&dev->dev.net); - else - printf("ERROR: Unknown device type %i\n", dev->type); -} - -int main(int argc, char **argv) -{ - struct virt_device *devs; - int count; - char *conf1 = - "\n" - " sles10foo\n" - " 7c42b545ffc4eb4441d1be3936516de3\n" - " /usr/lib/xen/boot/domUloader.py\n" - " \n" - " linux\n" - " /var/lib/xen/tmp/kernel.0F29se\n" - " /var/lib/xen/tmp/ramdisk.qGK5v5\n" - " TERM=xterm \n" - " \n" - " 524288\n" - " 1\n" - " destroy\n" - " restart\n" - " destroy\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n"; - char *conf2 = - "\n" - " sles10foo\n" - " 7c42b545ffc4eb4441d1be3936516de3\n" - " /usr/lib/xen/boot/domUloader.py\n" - " \n" - " linux\n" - " /var/lib/xen/tmp/kernel.0F29se\n" - " /var/lib/xen/tmp/ramdisk.qGK5v5\n" - " TERM=xterm \n" - " \n" - " 524288\n" - " 1\n" - " destroy\n" - " restart\n" - " destroy\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n"; - char *conf3 = "snarf"; - char *conf4 = - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n"; - - count = parse_devices(conf1, &devs, VIRT_DEV_DISK); - if (count != 1) { - fprintf(stderr, "Failed to find disk in config\n"); - return 1; - } - - if (! (STREQ(devs->dev.disk.type, "file") && - STREQ(devs->dev.disk.device, "disk") && - STREQ(devs->dev.disk.driver, "file") && - STREQ(devs->dev.disk.source, "/var/lib/xen/images/sles10/disk0") && - STREQ(devs->dev.disk.virtual_dev, "xvda"))) { - fprintf(stderr, "Failed to validate domain contents:\n"); - print_dev(devs); - return 1; - } - - cleanup_virt_device(devs); - free(devs); - - count = parse_devices(conf2, &devs, VIRT_DEV_DISK); - if (count != 2) { - fprintf(stderr, "Failed to find both disks in config\n"); - return 1; - } - - if (! (STREQ(devs[0].dev.disk.type, "file") && - STREQ(devs[0].dev.disk.device, "disk") && - STREQ(devs[0].dev.disk.driver, "file") && - STREQ(devs[0].dev.disk.source, "/var/lib/xen/images/foo/bar") && - STREQ(devs[0].dev.disk.virtual_dev, "xvdb"))) { - fprintf(stderr, "Failed to validate domain contents:\n"); - print_dev(&devs[0]); - return 1; - } - - if (! (STREQ(devs[1].dev.disk.type, "file") && - STREQ(devs[1].dev.disk.device, "disk") && - STREQ(devs[1].dev.disk.driver, "file") && - STREQ(devs[1].dev.disk.source, "/var/lib/xen/images/sles10/disk0") && - STREQ(devs[1].dev.disk.virtual_dev, "xvda"))) { - fprintf(stderr, "Failed to validate domain contents:\n"); - print_dev(&devs[1]); - return 1; - } - - cleanup_virt_devices(&devs, count); - free(devs); - - count = parse_devices(conf4, &devs, VIRT_DEV_DISK); - if (count != 1) { - fprintf(stderr, "Failed to bypass non-valid disk node.%d\n", count); - return 1; - } - - if (! (STREQ(devs[0].dev.disk.type, "file") && - STREQ(devs[0].dev.disk.device, "disk") && - STREQ(devs[0].dev.disk.driver, "file") && - STREQ(devs[0].dev.disk.source, "/disk0") && - STREQ(devs[0].dev.disk.virtual_dev, "xvda"))) { - fprintf(stderr, "Failed to validate valide disk info:\n"); - print_dev(&devs[0]); - return 1; - } - - cleanup_virt_devices(&devs, count); - free(devs); - - count = parse_devices(conf3, &devs, VIRT_DEV_DISK); - if ((count != 0) || (devs != NULL)) { - fprintf(stderr, "Failed to fail on bad config string\n"); - return 1; - } - - - count = parse_devices(conf1, &devs, VIRT_DEV_NET); - if (count != 1) { - fprintf(stderr, "Failed to find interface in config\n"); - return 1; - } - - if (! (STREQ(devs->dev.net.type, "ethernet") && - STREQ(devs->dev.net.mac, "00:16:3e:62:d1:bd"))) { - fprintf(stderr, "Failed to validate interface config:\n"); - print_dev(devs); - } - - cleanup_virt_device(devs); - free(devs); - - count = parse_devices(conf2, &devs, VIRT_DEV_NET); - if (count != 2) { - fprintf(stderr, "Failed to find both interfaces in config\n"); - return 1; - } - - if (! (STREQ(devs[0].dev.net.type, "ethernet") && - STREQ(devs[0].dev.net.mac, "00:16:3e:62:d1:bd"))) { - fprintf(stderr, "Failed to validate interface config:\n"); - print_dev(&devs[0]); - return 1; - } - - if (! (STREQ(devs[1].dev.net.type, "ethernet") && - STREQ(devs[1].dev.net.mac, "00:11:22:33:44:55"))) { - fprintf(stderr, "Failed to validate interface config:\n"); - print_dev(&devs[1]); - return 1; - } - - cleanup_virt_devices(&devs, count); - free(devs); - - count = parse_devices(conf4, &devs, VIRT_DEV_NET); - if (count !=1) { - fprintf(stderr, "Failed to bypass non-valid interface info.\n"); - return 1; - } - - if (! (STREQ(devs[0].dev.net.type, "ethernet") && - STREQ(devs[0].dev.net.mac, "00:16:3e:62:d1:bd"))) { - fprintf(stderr, "Failed to validate interface config:\n"); - print_dev(&devs[0]); - return 1; - } - cleanup_virt_devices(&devs, count); - free(devs); - - count = parse_devices(conf3, &devs, VIRT_DEV_NET); - if ((count != 0) || (devs != NULL)) { - fprintf(stderr, "Failed to fail on bad config string\n"); - return 1; - } - - return 0; -} - -/* - * Local Variables: - * mode: C - * c-set-style: "K&R" - * tab-width: 8 - * c-basic-offset: 8 - * indent-tabs-mode: nil - * End: - */ diff --git a/libxkutil/tests/xml_dominfo.c b/libxkutil/tests/xml_dominfo.c deleted file mode 100644 index eb39a84..0000000 --- a/libxkutil/tests/xml_dominfo.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright IBM Corp. 2007 - * - * Authors: - * Dan Smith - * - * 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 - */ -#include "../device_parsing.h" -#include "../device_parsing.c" - -const char *xml = -"" -" pv1" -" a3be4e7c539a3fb734648b11819bd9c3" -" /usr/lib/xen/boot/domUloader.py" -" --entry=xvda2:/boot/vmlinuz-xen,/boot/initrd-xen" -" " -" linux" -" /var/lib/xen/tmp/kernel.5ihM-L" -" /var/lib/xen/tmp/ramdisk.G2vsaq" -" TERM=xterm " -" " -" 524288" -" 1" -" destroy" -" restart" -" destroy" -" " -" " -" " -"