From deeptik at linux.vnet.ibm.com Tue Aug 4 05:42:58 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 03 Aug 2009 22:42:58 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing HostSystem/03_hs_to_settdefcap.py Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1249311520 25200 # Node ID c869eed16f8e6a01400f876c9f40ef22535975d7 # Parent e4d3d6799e9c73a7a68393782a4292187b777b01 [TEST] Fixing HostSystem/03_hs_to_settdefcap.py Tested with KVM on F10 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r e4d3d6799e9c -r c869eed16f8e suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py --- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Thu Jul 30 04:40:58 2009 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Mon Aug 03 07:58:40 2009 -0700 @@ -48,11 +48,12 @@ from XenKvmLib.vxml import XenXML, KVMXML, get_class from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES -from XenKvmLib.const import do_main +from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.test_xml import testxml from XenKvmLib.test_doms import destroy_and_undefine_all -from XenKvmLib.rasd import get_exp_template_rasd_len +from XenKvmLib.rasd import get_exp_template_rasd_len, \ + libvirt_rasd_storagepool_changes sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst_test" @@ -203,13 +204,20 @@ rtype = { "%s_MemResourceAllocationSettingData" % virt : 4 } else: rtype = { - "%s_DiskResourceAllocationSettingData" % virt : 17, \ - "%s_DiskPoolResourceAllocationSettingData" % virt : 17, \ - "%s_MemResourceAllocationSettingData" % virt : 4, \ - "%s_NetResourceAllocationSettingData" % virt : 10, \ - "%s_NetPoolResourceAllocationSettingData" % virt : 10, \ + "%s_DiskResourceAllocationSettingData" % virt : 17, + "%s_DiskPoolResourceAllocationSettingData" % virt : 17, + "%s_MemResourceAllocationSettingData" % virt : 4, + "%s_NetResourceAllocationSettingData" % virt : 10, + "%s_NetPoolResourceAllocationSettingData" % virt : 10, "%s_ProcResourceAllocationSettingData" % virt : 3 } + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev >= libvirt_rasd_storagepool_changes: + sto_vol_cn = 'StorageVolumeResourceAllocationSettingData' + storagevol_rasd_cn = get_typed_class(virt, sto_vol_cn) + rtype[storagevol_rasd_cn] = 32768 + try: for ap in alloccap: assoc_info = Associators(server, diff -r e4d3d6799e9c -r c869eed16f8e suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Thu Jul 30 04:40:58 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Aug 03 07:58:40 2009 -0700 @@ -47,6 +47,8 @@ dccn = 'DisplayController' pdcn = 'PointingDevice' +libvirt_rasd_storagepool_changes = 934 + def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): """ Creating the lists that will be used for comparisons. @@ -319,6 +321,8 @@ exp_base_num = 4 exp_cdrom = 4 + # StoragePoolRASD record 1 for each of Min, Max, Default, and Incr + exp_storagepool_rasd = 4 exp_len = exp_base_num if id == "DiskPool/0": @@ -351,6 +355,9 @@ volumes = enum_volumes(virt, ip, id[1]) exp_len = (volumes * exp_base_num) + exp_cdrom + if rev >= libvirt_rasd_storagepool_changes: + exp_len += exp_storagepool_rasd + return exp_len def get_exp_net_rasd_len(virt, rev, id): From deeptik at linux.vnet.ibm.com Tue Aug 4 06:13:54 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 04 Aug 2009 11:43:54 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing HostSystem/03_hs_to_settdefcap.py In-Reply-To: References: Message-ID: <4A77D1A2.1030601@linux.vnet.ibm.com> Please ignore this patch. Will resend this patch again. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Aug 4 06:24:35 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 03 Aug 2009 23:24:35 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Modifying rasd.py to include support for StoragevolRASD. Message-ID: From deeptik at linux.vnet.ibm.com Tue Aug 4 06:24:36 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 03 Aug 2009 23:24:36 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST] Modifying rasd.py lib to support StorageVolRASD In-Reply-To: References: Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1249366441 25200 # Node ID a95d4b521cf64765ef1f441d9cdb0f82fd6c37b2 # Parent c1d8168e6ff0a7883fac582d19af5e68ad979bbc [TEST] Modifying rasd.py lib to support StorageVolRASD. Tested with KVM on F10 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r c1d8168e6ff0 -r a95d4b521cf6 suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Thu Jul 30 22:40:39 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Aug 03 23:14:01 2009 -0700 @@ -47,6 +47,8 @@ dccn = 'DisplayController' pdcn = 'PointingDevice' +libvirt_rasd_storagepool_changes = 934 + def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): """ Creating the lists that will be used for comparisons. @@ -319,6 +321,8 @@ exp_base_num = 4 exp_cdrom = 4 + # StoragePoolRASD record 1 for each of Min, Max, Default, and Incr + exp_storagevol_rasd = 4 exp_len = exp_base_num if id == "DiskPool/0": @@ -351,6 +355,9 @@ volumes = enum_volumes(virt, ip, id[1]) exp_len = (volumes * exp_base_num) + exp_cdrom + if rev >= libvirt_rasd_storagepool_changes and virt != 'LXC': + exp_len += exp_storagevol_rasd + return exp_len def get_exp_net_rasd_len(virt, rev, id): From deeptik at linux.vnet.ibm.com Tue Aug 4 06:24:37 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 03 Aug 2009 23:24:37 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] Fixing HostSystem/03_hs_to_settdefcap.py In-Reply-To: References: Message-ID: <99510f152e670db0948e.1249367077@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1249366870 25200 # Node ID 99510f152e670db0948e26add79869f266b826e5 # Parent a95d4b521cf64765ef1f441d9cdb0f82fd6c37b2 [TEST] Fixing HostSystem/03_hs_to_settdefcap.py Tested with KVM on F10 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r a95d4b521cf6 -r 99510f152e67 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py --- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Mon Aug 03 23:14:01 2009 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Mon Aug 03 23:21:10 2009 -0700 @@ -48,11 +48,12 @@ from XenKvmLib.vxml import XenXML, KVMXML, get_class from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES -from XenKvmLib.const import do_main +from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.test_xml import testxml from XenKvmLib.test_doms import destroy_and_undefine_all -from XenKvmLib.rasd import get_exp_template_rasd_len +from XenKvmLib.rasd import get_exp_template_rasd_len, \ + libvirt_rasd_storagepool_changes sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst_test" @@ -203,13 +204,20 @@ rtype = { "%s_MemResourceAllocationSettingData" % virt : 4 } else: rtype = { - "%s_DiskResourceAllocationSettingData" % virt : 17, \ - "%s_DiskPoolResourceAllocationSettingData" % virt : 17, \ - "%s_MemResourceAllocationSettingData" % virt : 4, \ - "%s_NetResourceAllocationSettingData" % virt : 10, \ - "%s_NetPoolResourceAllocationSettingData" % virt : 10, \ + "%s_DiskResourceAllocationSettingData" % virt : 17, + "%s_DiskPoolResourceAllocationSettingData" % virt : 17, + "%s_MemResourceAllocationSettingData" % virt : 4, + "%s_NetResourceAllocationSettingData" % virt : 10, + "%s_NetPoolResourceAllocationSettingData" % virt : 10, "%s_ProcResourceAllocationSettingData" % virt : 3 } + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev >= libvirt_rasd_storagepool_changes: + sto_vol_cn = 'StorageVolumeResourceAllocationSettingData' + storagevol_rasd_cn = get_typed_class(virt, sto_vol_cn) + rtype[storagevol_rasd_cn] = 32768 + try: for ap in alloccap: assoc_info = Associators(server, @@ -244,7 +252,8 @@ def check_rasd_vals(inst, rt): try: if inst['ResourceType'] != rt: - logger.error("In ResourceType for %s ", rt) + logger.error("ResourceType Mismatch, Got '%s' Expected '%s' ", + inst['ResourceType'], rt) return FAIL except Exception, detail: logger.error("Error checking RASD attribute values %s", detail) From deeptik at linux.vnet.ibm.com Tue Aug 4 06:24:38 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 03 Aug 2009 23:24:38 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] Fixing SettingsDefineCapabilities/01_forward.py In-Reply-To: References: Message-ID: <09572d5c821abbe37abd.1249367078@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1249366976 25200 # Node ID 09572d5c821abbe37abd9f9a773345c4fe6266aa # Parent 99510f152e670db0948e26add79869f266b826e5 [TEST] Fixing SettingsDefineCapabilities/01_forward.py Tested with KVM on F10 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r 99510f152e67 -r 09572d5c821a suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Mon Aug 03 23:21:10 2009 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Mon Aug 03 23:22:56 2009 -0700 @@ -59,11 +59,13 @@ from XenKvmLib import enumclass from XenKvmLib.xm_virt_util import virsh_version from CimTest.ReturnCodes import PASS, FAIL, SKIP -from CimTest.Globals import logger, CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS -from XenKvmLib.const import do_main, default_pool_name, default_network_name +from CimTest.Globals import logger, CIM_ERROR_GETINSTANCE, \ + CIM_ERROR_ASSOCIATORS +from XenKvmLib.const import do_main, default_pool_name, default_network_name, \ + get_provider_version from XenKvmLib.classes import get_typed_class -from XenKvmLib.common_util import print_field_error -from XenKvmLib.rasd import get_exp_template_rasd_len +from XenKvmLib.rasd import get_exp_template_rasd_len, \ + libvirt_rasd_storagepool_changes platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -86,7 +88,7 @@ sys.exit(FAIL) return instance -def init_list(virt, pool): +def init_list(virt, server, pool): """ Creating the lists that will be used for comparisons. """ @@ -98,7 +100,6 @@ if virt == 'LXC': instlist = [ pool[1].InstanceID ] - cllist = [ memrasd ] rtype = { memrasd : 4 } else: instlist = [ @@ -107,20 +108,27 @@ pool[2].InstanceID, pool[3].InstanceID ] - cllist = [ diskrasd, memrasd, netrasd, procrasd ] + rtype = { diskrasd : 17, memrasd : 4, netrasd : 10, procrasd : 3 } + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev >= libvirt_rasd_storagepool_changes: + sto_vol_cn = 'StorageVolumeResourceAllocationSettingData' + storagevol_rasd_cn = get_typed_class(virt, sto_vol_cn) + rtype[storagevol_rasd_cn] = 32768 + rangelist = { "Default" : 0, "Minimum" : 1, "Maximum" : 2, "Increment" : 3 } - return instlist, cllist, rtype, rangelist + return instlist, rtype, rangelist def get_pool_info(virt, server, devid, poolname=""): pool_cname = get_typed_class(virt, poolname) @@ -147,21 +155,21 @@ return PASS, pool_set -def verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist): +def verify_rasd_fields(assoc_info, rtype, rangelist): for inst in assoc_info: - if inst.classname != cllist[loop]: - print_field_error("Classname", inst.classname, cllist[loop]) + if not inst.classname in rtype.keys(): + logger.error("Classname Mismatch, '%s' not in '%s'", + inst.classname, rtype.keys()) return FAIL - if inst['ResourceType'] != rtype[cllist[loop]]: - print_field_error("ResourceType", inst['ResourceType'], - rtype[cllist[loop]]) + if inst['ResourceType'] != rtype[inst.classname]: + logger.error("ResourceType Mismatch, got '%s' expected '%s'", + inst['ResourceType'], rtype[inst.classname]) return FAIL return PASS def verify_sdc_with_ac(virt, server, pool): - loop = 0 - instlist, cllist, rtype, rangelist = init_list(virt, pool) + instlist, rtype, rangelist = init_list(virt, server, pool) assoc_cname = get_typed_class(virt, "SettingsDefineCapabilities") cn = get_typed_class(virt, "AllocationCapabilities") for instid in sorted(instlist): @@ -176,12 +184,9 @@ " of %i", assoc_cname, len(assoc_info), exp_len) status = FAIL break - status = verify_rasd_fields(loop, assoc_info, cllist, rtype, - rangelist) + status = verify_rasd_fields(assoc_info, rtype, rangelist) if status != PASS: break - else: - loop = loop + 1 except Exception, detail: logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) From deeptik at linux.vnet.ibm.com Tue Aug 4 10:18:09 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 04 Aug 2009 15:48:09 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Jul 27 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb In-Reply-To: <4A703780.4060005@linux.vnet.ibm.com> References: <4A701A61.8010407@linux.vnet.ibm.com> <4A703780.4060005@linux.vnet.ibm.com> Message-ID: <4A780AE1.9060802@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Deepti B Kalakeri wrote: >> ================================================= >> Test Run Summary (Jul 27 2009): KVM on SUSE Linux Enterprise Server >> 11 (i586) with sfcb >> ================================================= >> Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae >> libvirt: 0.4.6 >> Hypervisor: QEMU 0.9.1 >> CIMOM: sfcb sfcbd 1.3.2 >> Libvirt-cim revision: 934 >> Libvirt-cim changeset: ba165481b932+ >> Cimtest revision: 739 >> Cimtest changeset: ad67e5d20ee2 >> ================================================= >> FAIL : 4 >> XFAIL : 5 >> SKIP : 10 >> PASS : 146 >> ----------------- >> Total : 165 >> ================================================= >> FAIL Test Summary: >> ComputerSystemIndication - 01_created_indication.py: FAIL > DestroySystem() does not generate an indication hence the test fails. > Have reported this problem. >> HostSystem - 03_hs_to_settdefcap.py: FAIL > Needs tc update. >> SettingsDefineCapabilities - 01_forward.py: FAIL > Needs tc update. The patches for these are submitted for review. >> VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL > Test case problem, Patch for this is sent for review. > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Aug 4 10:34:13 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 04 Aug 2009 16:04:13 +0530 Subject: [Libvirt-cim] Test Run Summary (Aug 04 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb Message-ID: <4A780EA5.5090300@linux.vnet.ibm.com> ================================================= Test Run Summary (Aug 04 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb ================================================= Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae libvirt: 0.4.6 Hypervisor: QEMU 0.9.1 CIMOM: sfcb sfcbd 1.3.2 Libvirt-cim revision: 937 Libvirt-cim changeset: 02bb726b1ed3+ Cimtest revision: 746 Cimtest changeset: 09572d5c821a ================================================= FAIL : 3 XFAIL : 5 SKIP : 10 PASS : 147 ----------------- Total : 165 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL VirtualSystemManagementService - 08_modifyresource.py: FAIL VirtualSystemManagementService - 12_referenced_config.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: PASS -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for define indication ERROR - Waited too long for start indication ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: PASS -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: PASS -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: PASS -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: PASS -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: PASS -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: PASS -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: PASS -------------------------------------------------------------------- Processor - 01_processor.py: PASS -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: PASS -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: PASS -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: PASS -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: PASS -------------------------------------------------------------------- RASD - 02_enum.py: PASS -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: PASS -------------------------------------------------------------------- SystemDevice - 02_reverse.py: PASS -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: PASS -------------------------------------------------------------------- VSSD - 01_enum.py: PASS -------------------------------------------------------------------- VSSD - 02_bootldr.py: SKIP -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: PASS -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: FAIL ERROR - Error invoking ModifyRS: mod_net_res ERROR - (1, u'Modify resource failed: Conflicting MAC Addresses') InvokeMethod(ModifyResourceSettings): Modify resource failed: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: FAIL ERROR - 00:16:3e:28:ff:83 has unexpected mac value, exp: aa:aa:aa:00:00:00 11:22:33:aa:bb:cc -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Error invoking AddRS: add_net_res ERROR - (1, u'Unable to change (0) device: Error 0') ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): Unable to change (0) device: Error 0 Bug:<00015> -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Aug 4 10:31:17 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 04 Aug 2009 03:31:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSMS/08_modifyresource.py Message-ID: <041ca9e51d68b680d8d6.1249381877@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1249381865 25200 # Node ID 041ca9e51d68b680d8d647f322040d297ba7a1c0 # Parent c1d8168e6ff0a7883fac582d19af5e68ad979bbc [TEST] Fixing VSMS/08_modifyresource.py Verified changes on SLES11 and F10 with KVM and current sources. Signed-off-by: Deepti B. Kalakeri diff -r c1d8168e6ff0 -r 041ca9e51d68 suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Thu Jul 30 22:40:39 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Tue Aug 04 03:31:05 2009 -0700 @@ -24,6 +24,7 @@ import sys import pywbem +from random import randint from pywbem.cim_obj import CIMInstanceName from VirtLib import utils from XenKvmLib.xm_virt_util import network_by_bridge @@ -41,6 +42,8 @@ cpu = 2 ncpu = 1 nmem = 256 +new_int = randint(10, 99) +new_mac = "11:%s:22:%s:33:%s" % (new_int, new_int, new_int) def cleanup_env(ip, virt, cxml): cxml.destroy(ip) @@ -104,6 +107,7 @@ if status != PASS: break + nasd.Address = new_mac status = vsms_util.mod_net_res(options.ip, service, options.virt, cxml, nasd, ntype, default_network_name) if status != PASS: From deeptik at linux.vnet.ibm.com Tue Aug 4 12:21:28 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 04 Aug 2009 05:21:28 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSMS/12_referenced_config.py Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1249388441 25200 # Node ID cb9ab2702c7b693c334bc6709fd71833e7fa843f # Parent 041ca9e51d68b680d8d647f322040d297ba7a1c0 [TEST] Fixing VSMS/12_referenced_config.py . Verified changes on SLES11 and F10 with KVM and current sources. Signed-off-by: Deepti B. Kalakeri diff -r 041ca9e51d68 -r cb9ab2702c7b suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py Tue Aug 04 03:31:05 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py Tue Aug 04 05:20:41 2009 -0700 @@ -33,7 +33,7 @@ import sys from XenKvmLib.common_util import get_cs_instance from CimTest.Globals import logger -from XenKvmLib.const import do_main +from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import FAIL, PASS from XenKvmLib.classes import get_typed_class, inst_to_mof from XenKvmLib.assoc import AssociatorNames @@ -44,8 +44,8 @@ sup_types = ['Xen', 'XenFV', 'KVM'] test_dom = 'rstest_domain' test_dom2 = 'rstest_domain2' - mac = "aa:aa:aa:00:00:00" +libvirt_mac_ref_changes = 935 def setup_first_guest(ip, virt, cxml): ret = cxml.cim_define(ip) @@ -153,10 +153,16 @@ raise Exception("%s has %d macs, expected 2" % (test_dom2, len(dom2_mac_list))) - for item in dom2_mac_list: - if item != mac and item != dom1_mac_list[0]: - raise Exception("%s has unexpected mac value, exp: %s %s" % \ - (item, mac, dom1_mac_list[0])) + curr_cim_rev, changeset = get_provider_version(virt, ip) + if curr_cim_rev < libvirt_mac_ref_changes: + for item in dom2_mac_list: + if item != mac and item != dom1_mac_list[0]: + raise Exception("%s has unexpected mac value, exp: %s %s" \ + % (item, mac, dom1_mac_list[0])) + elif curr_cim_rev >= libvirt_mac_ref_changes: + if not mac in dom2_mac_list: + raise Exception("Did not find the mac information given to "\ + "the domain '%s'" % test_dom2) status = PASS From deeptik at linux.vnet.ibm.com Tue Aug 4 12:29:59 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 04 Aug 2009 17:59:59 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 04 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb In-Reply-To: <4A780EA5.5090300@linux.vnet.ibm.com> References: <4A780EA5.5090300@linux.vnet.ibm.com> Message-ID: <4A7829C7.2020209@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > ================================================= > Test Run Summary (Aug 04 2009): KVM on SUSE Linux Enterprise Server > 11 (i586) with sfcb > ================================================= > Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae > libvirt: 0.4.6 > Hypervisor: QEMU 0.9.1 > CIMOM: sfcb sfcbd 1.3.2 > Libvirt-cim revision: 937 > Libvirt-cim changeset: 02bb726b1ed3+ > Cimtest revision: 746 > Cimtest changeset: 09572d5c821a > ================================================= > FAIL : 3 > XFAIL : 5 > SKIP : 10 > PASS : 147 > ----------------- > Total : 165 > ================================================= > FAIL Test Summary: > ComputerSystemIndication - 01_created_indication.py: FAIL Known issue. > VirtualSystemManagementService - 08_modifyresource.py: FAIL Test case needs updation , patch submitted for review. > VirtualSystemManagementService - 12_referenced_config.py: FAIL > Test case needs updation , patch submitted for review. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Aug 4 23:04:22 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 04 Aug 2009 16:04:22 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] Fixing HostSystem/03_hs_to_settdefcap.py In-Reply-To: <99510f152e670db0948e.1249367077@elm3a148.beaverton.ibm.com> References: <99510f152e670db0948e.1249367077@elm3a148.beaverton.ibm.com> Message-ID: <4A78BE76.2060103@linux.vnet.ibm.com> > } > + > + curr_cim_rev, changeset = get_provider_version(virt, server) > + if curr_cim_rev >= libvirt_rasd_storagepool_changes: > + sto_vol_cn = 'StorageVolumeResourceAllocationSettingData' > + storagevol_rasd_cn = get_typed_class(virt, sto_vol_cn) > + rtype[storagevol_rasd_cn] = 32768 Instead of setting the value 32768 here, can you create a variable in const.py, that way this value has more meaning. We should have done the same for the other values, but that's something we can clean up later. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Aug 4 23:05:53 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 04 Aug 2009 16:05:53 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] Fixing SettingsDefineCapabilities/01_forward.py In-Reply-To: <09572d5c821abbe37abd.1249367078@elm3a148.beaverton.ibm.com> References: <09572d5c821abbe37abd.1249367078@elm3a148.beaverton.ibm.com> Message-ID: <4A78BED1.7050605@linux.vnet.ibm.com> > + > + curr_cim_rev, changeset = get_provider_version(virt, server) > + if curr_cim_rev >= libvirt_rasd_storagepool_changes: > + sto_vol_cn = 'StorageVolumeResourceAllocationSettingData' > + storagevol_rasd_cn = get_typed_class(virt, sto_vol_cn) > + rtype[storagevol_rasd_cn] = 32768 Same here, can you use a const value? > @@ -176,12 +184,9 @@ > " of %i", assoc_cname, len(assoc_info), exp_len) > status = FAIL > break > - status = verify_rasd_fields(loop, assoc_info, cllist, rtype, > - rangelist) > + status = verify_rasd_fields(assoc_info, rtype, rangelist) > if status != PASS: > break > - else: > - loop = loop + 1 > > except Exception, detail: > logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) > I like the changes here to get rid of the loop. Make the test a little cleaner I think. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Wed Aug 5 05:05:48 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 05 Aug 2009 02:05:48 -0300 Subject: [Libvirt-cim] [PATCH] (#2) VirtualDevice default value for a cdrom template rasd changed from hda to hdc Message-ID: <23c0707da946c185f438.1249448748@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1249448730 10800 # Node ID 23c0707da946c185f4387a13276b0c9fbf084da2 # Parent bdf6eda6765f09c27f7306cd8c074ca5acda38a6 (#2) VirtualDevice default value for a cdrom template rasd changed from hda to hdc #2: Fixed patch submission date Signed-off-by: Richard Maciel diff -r bdf6eda6765f -r 23c0707da946 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Jul 30 15:59:26 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Aug 05 02:05:30 2009 -0300 @@ -782,13 +782,6 @@ CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; - if (type == DOMAIN_LXC) { - dev = "/lxc_mnt/tmp"; - } - else { - dev = "hda"; - } - inst = sdc_rasd_inst(&s, ref, CIM_RES_TYPE_DISK, DEVICE_RASD); if ((inst == NULL) || (s.rc != CMPI_RC_OK)) goto out; @@ -798,12 +791,11 @@ (CMPIValue *)"MegaBytes", CMPI_chars); CMSetProperty(inst, "Address", (CMPIValue *)disk_path, CMPI_chars); - if (type == DOMAIN_LXC) + if (type == DOMAIN_LXC) { + dev = "/lxc_mnt/tmp"; CMSetProperty(inst, "MountPoint", (CMPIValue *)dev, CMPI_chars); - else { - if (emu_type == 0) - CMSetProperty(inst, "VirtualQuantity", - (CMPIValue *)&disk_size, CMPI_uint64); + } else { + dev = "hda"; if (type == DOMAIN_XENPV) { dev = "xvda"; @@ -813,6 +805,13 @@ CMSetProperty(inst, "Caption", (CMPIValue *)"FV disk", CMPI_chars); } + + if (emu_type == 0) { + CMSetProperty(inst, "VirtualQuantity", + (CMPIValue *)&disk_size, CMPI_uint64); + } else if (emu_type == 1) { + dev = "hdc"; + } CMSetProperty(inst, "VirtualDevice", (CMPIValue *)dev, CMPI_chars); From rmaciel at linux.vnet.ibm.com Wed Aug 5 05:08:02 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 05 Aug 2009 02:08:02 -0300 Subject: [Libvirt-cim] [PATCH] (#2) Add check to catch duplicated VirtualDevice parameter in DiskRASDs Message-ID: <3eebf7d2c4ebb1f4fdc1.1249448882@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1249448787 10800 # Node ID 3eebf7d2c4ebb1f4fdc17173c0b12cb34496c32e # Parent 23c0707da946c185f4387a13276b0c9fbf084da2 (#2) Add check to catch duplicated VirtualDevice parameter in DiskRASDs At the moment of creation of a guest, it is necessary to check if its DiskRASDs all have unique (among themselves) VirtualDevice parameters #2: Fixed patch submission date Signed-off-by: Richard Maciel diff -r 23c0707da946 -r 3eebf7d2c4eb src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 05 02:05:30 2009 -0300 +++ b/src/Virt_VirtualSystemManagementService.c Wed Aug 05 02:06:27 2009 -0300 @@ -1011,6 +1011,11 @@ for (i = 0; i < *index; i++) { struct virt_device *ptr = &list[i]; + + if (STREQC(ptr->dev.disk.virtual_dev, dev->dev.disk.virtual_dev)) + return "VirtualDevice property must be unique for each " + "DiskResourceAllocationSettingData in a single " + "guest"; if (STREQC(ptr->id, dev->id)) { CU_DEBUG("Overriding device %s from refconf", ptr->id); From deeptik at linux.vnet.ibm.com Wed Aug 5 10:24:41 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 05 Aug 2009 03:24:41 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Modifying rasd.py and vsms.py to include support for StoragevolRASD Message-ID: From deeptik at linux.vnet.ibm.com Wed Aug 5 10:24:43 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 05 Aug 2009 03:24:43 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST]#2 Fixing HostSystem/03_hs_to_settdefcap.py In-Reply-To: References: Message-ID: <86053a515f379c660de7.1249467883@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1249463466 25200 # Node ID 86053a515f379c660de7755fac3dba19209ce373 # Parent 4ab4184ab2998f32f5cd369fd39fed01917ba5e1 [TEST]#2 Fixing HostSystem/03_hs_to_settdefcap.py Patch 2: -------- Using the constants defined in rasd.py and vsms.py Tested with KVM on F10 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r 4ab4184ab299 -r 86053a515f37 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py --- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Wed Aug 05 02:07:44 2009 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Wed Aug 05 02:11:06 2009 -0700 @@ -45,14 +45,16 @@ from VirtLib.live import full_hostname from XenKvmLib.common_util import get_host_info from XenKvmLib.assoc import Associators -from XenKvmLib.vxml import XenXML, KVMXML, get_class +from XenKvmLib.vxml import get_class from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES -from XenKvmLib.const import do_main +from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import PASS, FAIL -from XenKvmLib.test_xml import testxml -from XenKvmLib.test_doms import destroy_and_undefine_all -from XenKvmLib.rasd import get_exp_template_rasd_len +from XenKvmLib.rasd import get_exp_template_rasd_len, dasd_cn, masd_cn,\ + pasd_cn, nasd_cn, dpasd_cn, npasd_cn, svrasd_cn ,\ + libvirt_rasd_storagepool_changes +from XenKvmLib.vsms import RASD_TYPE_DISK, RASD_TYPE_MEM, RASD_TYPE_NET_ETHER, \ + RASD_TYPE_PROC, RASD_TYPE_STOREVOL sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst_test" @@ -60,7 +62,6 @@ def setup_env(server, virt="Xen"): status = PASS - destroy_and_undefine_all(server) if virt == 'LXC': vsxml = get_class(virt)(test_dom) else: @@ -156,12 +157,12 @@ filter = {"key" : "ResourceType"} if virt == 'LXC': - ccnlist = { '%s_MemoryPool' % virt : 4 } + ccnlist = { '%s_MemoryPool' % virt : RASD_TYPE_MEM } else: - ccnlist = { '%s_ProcessorPool' % virt: 3, - '%s_MemoryPool' % virt : 4, - '%s_DiskPool' % virt : 17 , - '%s_NetworkPool' % virt : 10 } + ccnlist = { '%s_ProcessorPool' % virt: RASD_TYPE_PROC, + '%s_MemoryPool' % virt : RASD_TYPE_MEM, + '%s_DiskPool' % virt : RASD_TYPE_DISK , + '%s_NetworkPool' % virt : RASD_TYPE_NET_ETHER } for inst in devpool: try: @@ -198,18 +199,20 @@ status = PASS ccn = get_typed_class(virt, 'AllocationCapabilities') an = get_typed_class(virt, 'SettingsDefineCapabilities') - - if virt == 'LXC': - rtype = { "%s_MemResourceAllocationSettingData" % virt : 4 } - else: - rtype = { - "%s_DiskResourceAllocationSettingData" % virt : 17, \ - "%s_DiskPoolResourceAllocationSettingData" % virt : 17, \ - "%s_MemResourceAllocationSettingData" % virt : 4, \ - "%s_NetResourceAllocationSettingData" % virt : 10, \ - "%s_NetPoolResourceAllocationSettingData" % virt : 10, \ - "%s_ProcResourceAllocationSettingData" % virt : 3 - } + mrasd_cn = get_typed_class(virt, masd_cn) + rtype = { mrasd_cn : RASD_TYPE_MEM } + if virt != 'LXC': + rtype[get_typed_class(virt, pasd_cn)] = RASD_TYPE_PROC + rtype[get_typed_class(virt, dasd_cn)] = RASD_TYPE_DISK + rtype[get_typed_class(virt, dpasd_cn)] = RASD_TYPE_DISK + rtype[get_typed_class(virt, nasd_cn)] = RASD_TYPE_NET_ETHER + rtype[get_typed_class(virt, npasd_cn)] = RASD_TYPE_NET_ETHER + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev >= libvirt_rasd_storagepool_changes: + storagevol_rasd_cn = get_typed_class(virt, svrasd_cn) + rtype[storagevol_rasd_cn] = RASD_TYPE_STOREVOL + try: for ap in alloccap: assoc_info = Associators(server, @@ -244,7 +247,8 @@ def check_rasd_vals(inst, rt): try: if inst['ResourceType'] != rt: - logger.error("In ResourceType for %s ", rt) + logger.error("ResourceType Mismatch, Got '%s' Expected '%s' ", + inst['ResourceType'], rt) return FAIL except Exception, detail: logger.error("Error checking RASD attribute values %s", detail) From deeptik at linux.vnet.ibm.com Wed Aug 5 10:24:42 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 05 Aug 2009 03:24:42 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [TEST] #2 Modifying rasd.py and vsms.py lib to support StorageVolRASD In-Reply-To: References: Message-ID: <4ab4184ab2998f32f5cd.1249467882@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B.Kalakeri # Date 1249463264 25200 # Node ID 4ab4184ab2998f32f5cd369fd39fed01917ba5e1 # Parent cb9ab2702c7b693c334bc6709fd71833e7fa843f [TEST] #2 Modifying rasd.py and vsms.py lib to support StorageVolRASD. patch 2: -------- 1) Added the RType constant in the vsms.py 2) Added diskpoolrasd, netpoolrasd, storagevolrasd cn in rasd.py Tested with KVM on F10 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r cb9ab2702c7b -r 4ab4184ab299 suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Aug 04 05:20:41 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Aug 05 02:07:44 2009 -0700 @@ -40,6 +40,11 @@ masd_cn = 'MemResourceAllocationSettingData' dcrasd_cn = 'GraphicsResourceAllocationSettingData' irasd_cn = 'InputResourceAllocationSettingData' +dpasd_cn = 'DiskPoolResourceAllocationSettingData' +npasd_cn = 'NetPoolResourceAllocationSettingData' +svrasd_cn = 'StorageVolumeResourceAllocationSettingData' + + proccn = 'Processor' memcn = 'Memory' netcn = 'NetworkPort' @@ -47,6 +52,8 @@ dccn = 'DisplayController' pdcn = 'PointingDevice' +libvirt_rasd_storagepool_changes = 934 + def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): """ Creating the lists that will be used for comparisons. @@ -319,6 +326,8 @@ exp_base_num = 4 exp_cdrom = 4 + # StoragePoolRASD record 1 for each of Min, Max, Default, and Incr + exp_storagevol_rasd = 4 exp_len = exp_base_num if id == "DiskPool/0": @@ -351,6 +360,9 @@ volumes = enum_volumes(virt, ip, id[1]) exp_len = (volumes * exp_base_num) + exp_cdrom + if rev >= libvirt_rasd_storagepool_changes and virt != 'LXC': + exp_len += exp_storagevol_rasd + return exp_len def get_exp_net_rasd_len(virt, rev, id): diff -r cb9ab2702c7b -r 4ab4184ab299 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Aug 04 05:20:41 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 05 02:07:44 2009 -0700 @@ -35,6 +35,7 @@ RASD_TYPE_DISK = 17 RASD_TYPE_GRAPHICS = 24 RASD_TYPE_INPUT = 13 +RASD_TYPE_STOREVOL = 32768 VSSD_RECOVERY_NONE = 2 VSSD_RECOVERY_RESTART = 3 From deeptik at linux.vnet.ibm.com Wed Aug 5 10:24:44 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 05 Aug 2009 03:24:44 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST]#2 Fixing SettingsDefineCapabilities/01_forward.py In-Reply-To: References: Message-ID: # HG changeset patch # User Deepti B.Kalakeri # Date 1249467784 25200 # Node ID ca99e2ff90ec82d9668f0751e201882acc0c0f16 # Parent 86053a515f379c660de7755fac3dba19209ce373 [TEST]#2 Fixing SettingsDefineCapabilities/01_forward.py Patch 2: ------- Modified to use constants defined in rasd.py and vsms.py Tested with KVM on F10 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r 86053a515f37 -r ca99e2ff90ec suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Aug 05 02:11:06 2009 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Wed Aug 05 03:23:04 2009 -0700 @@ -59,11 +59,16 @@ from XenKvmLib import enumclass from XenKvmLib.xm_virt_util import virsh_version from CimTest.ReturnCodes import PASS, FAIL, SKIP -from CimTest.Globals import logger, CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS -from XenKvmLib.const import do_main, default_pool_name, default_network_name +from CimTest.Globals import logger, CIM_ERROR_GETINSTANCE, \ + CIM_ERROR_ASSOCIATORS +from XenKvmLib.const import do_main, default_pool_name, default_network_name, \ + get_provider_version from XenKvmLib.classes import get_typed_class -from XenKvmLib.common_util import print_field_error -from XenKvmLib.rasd import get_exp_template_rasd_len +from XenKvmLib.rasd import get_exp_template_rasd_len, dasd_cn, masd_cn, \ + nasd_cn, pasd_cn, svrasd_cn, \ + libvirt_rasd_storagepool_changes +from XenKvmLib.vsms import RASD_TYPE_DISK, RASD_TYPE_MEM, RASD_TYPE_PROC, \ + RASD_TYPE_NET_ETHER, RASD_TYPE_STOREVOL platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -86,20 +91,17 @@ sys.exit(FAIL) return instance -def init_list(virt, pool): +def init_list(virt, server, pool): """ Creating the lists that will be used for comparisons. """ - memrasd = get_typed_class(virt, "MemResourceAllocationSettingData") - diskrasd = get_typed_class(virt, "DiskResourceAllocationSettingData") - netrasd = get_typed_class(virt, "NetResourceAllocationSettingData") - procrasd = get_typed_class(virt, "ProcResourceAllocationSettingData") + memrasd = get_typed_class(virt, masd_cn) + + rtype = { memrasd : RASD_TYPE_MEM } if virt == 'LXC': instlist = [ pool[1].InstanceID ] - cllist = [ memrasd ] - rtype = { memrasd : 4 } else: instlist = [ pool[0].InstanceID, @@ -107,20 +109,22 @@ pool[2].InstanceID, pool[3].InstanceID ] - cllist = [ diskrasd, memrasd, netrasd, procrasd ] - rtype = { - diskrasd : 17, - memrasd : 4, - netrasd : 10, - procrasd : 3 - } + + rtype[get_typed_class(virt, dasd_cn)] = RASD_TYPE_DISK + rtype[get_typed_class(virt, nasd_cn)] = RASD_TYPE_NET_ETHER + rtype[get_typed_class(virt, pasd_cn)] = RASD_TYPE_PROC + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev >= libvirt_rasd_storagepool_changes: + rtype[get_typed_class(virt, svrasd_cn)] = RASD_TYPE_STOREVOL + rangelist = { "Default" : 0, "Minimum" : 1, "Maximum" : 2, "Increment" : 3 } - return instlist, cllist, rtype, rangelist + return instlist, rtype, rangelist def get_pool_info(virt, server, devid, poolname=""): pool_cname = get_typed_class(virt, poolname) @@ -147,21 +151,21 @@ return PASS, pool_set -def verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist): +def verify_rasd_fields(assoc_info, rtype, rangelist): for inst in assoc_info: - if inst.classname != cllist[loop]: - print_field_error("Classname", inst.classname, cllist[loop]) + if not inst.classname in rtype.keys(): + logger.error("Classname Mismatch, '%s' not in '%s'", + inst.classname, rtype.keys()) return FAIL - if inst['ResourceType'] != rtype[cllist[loop]]: - print_field_error("ResourceType", inst['ResourceType'], - rtype[cllist[loop]]) + if inst['ResourceType'] != rtype[inst.classname]: + logger.error("ResourceType Mismatch, got '%s' expected '%s'", + inst['ResourceType'], rtype[inst.classname]) return FAIL return PASS def verify_sdc_with_ac(virt, server, pool): - loop = 0 - instlist, cllist, rtype, rangelist = init_list(virt, pool) + instlist, rtype, rangelist = init_list(virt, server, pool) assoc_cname = get_typed_class(virt, "SettingsDefineCapabilities") cn = get_typed_class(virt, "AllocationCapabilities") for instid in sorted(instlist): @@ -176,12 +180,9 @@ " of %i", assoc_cname, len(assoc_info), exp_len) status = FAIL break - status = verify_rasd_fields(loop, assoc_info, cllist, rtype, - rangelist) + status = verify_rasd_fields(assoc_info, rtype, rangelist) if status != PASS: break - else: - loop = loop + 1 except Exception, detail: logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) From deeptik at linux.vnet.ibm.com Wed Aug 5 10:33:18 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 05 Aug 2009 16:03:18 +0530 Subject: [Libvirt-cim] [PATCH 2 of 3] [TEST] Fixing HostSystem/03_hs_to_settdefcap.py In-Reply-To: <4A78BE76.2060103@linux.vnet.ibm.com> References: <99510f152e670db0948e.1249367077@elm3a148.beaverton.ibm.com> <4A78BE76.2060103@linux.vnet.ibm.com> Message-ID: <4A795FEE.5000606@linux.vnet.ibm.com> Kaitlin Rupert wrote: >> } >> + >> + curr_cim_rev, changeset = get_provider_version(virt, server) >> + if curr_cim_rev >= libvirt_rasd_storagepool_changes: >> + sto_vol_cn = 'StorageVolumeResourceAllocationSettingData' >> + storagevol_rasd_cn = get_typed_class(virt, sto_vol_cn) >> + rtype[storagevol_rasd_cn] = 32768 > > Instead of setting the value 32768 here, can you create a variable in > const.py, that way this value has more meaning. > > We should have done the same for the other values, but that's > something we can clean up later. > > done. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 5 10:33:27 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 05 Aug 2009 16:03:27 +0530 Subject: [Libvirt-cim] [PATCH 3 of 3] [TEST] Fixing SettingsDefineCapabilities/01_forward.py In-Reply-To: <4A78BED1.7050605@linux.vnet.ibm.com> References: <09572d5c821abbe37abd.1249367078@elm3a148.beaverton.ibm.com> <4A78BED1.7050605@linux.vnet.ibm.com> Message-ID: <4A795FF7.305@linux.vnet.ibm.com> Kaitlin Rupert wrote: >> + >> + curr_cim_rev, changeset = get_provider_version(virt, server) >> + if curr_cim_rev >= libvirt_rasd_storagepool_changes: >> + sto_vol_cn = 'StorageVolumeResourceAllocationSettingData' >> + storagevol_rasd_cn = get_typed_class(virt, sto_vol_cn) >> + rtype[storagevol_rasd_cn] = 32768 > > Same here, can you use a const value? > > >> @@ -176,12 +184,9 @@ >> " of %i", assoc_cname, len(assoc_info), exp_len) >> status = FAIL >> break >> - status = verify_rasd_fields(loop, assoc_info, cllist, rtype, - >> rangelist) >> + status = verify_rasd_fields(assoc_info, rtype, rangelist) >> if status != PASS: >> break >> - else: >> - loop = loop + 1 >> except Exception, detail: >> logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) >> > > I like the changes here to get rid of the loop. Make the test a little > cleaner I think. > > Thanks! > done. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 5 10:44:55 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 05 Aug 2009 16:14:55 +0530 Subject: [Libvirt-cim] Test Run Summary (Aug 05 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb Message-ID: <4A7962A7.5040904@linux.vnet.ibm.com> ================================================= Test Run Summary (Aug 05 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb ================================================= Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae libvirt: 0.4.6 Hypervisor: QEMU 0.9.1 CIMOM: sfcb sfcbd 1.3.2 Libvirt-cim revision: 937 Libvirt-cim changeset: 02bb726b1ed3+ Cimtest revision: 745 Cimtest changeset: cb9ab2702c7b ================================================= FAIL : 3 XFAIL : 5 SKIP : 10 PASS : 147 ----------------- Total : 165 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: PASS -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for define indication ERROR - Waited too long for start indication ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: PASS -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: PASS -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: PASS -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: PASS -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - KVM_SettingsDefineCapabilities returned 52 RASD objects instead of 48 for DiskPool/cimtest-diskpool Class not found -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: PASS -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: PASS -------------------------------------------------------------------- Processor - 01_processor.py: PASS -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: PASS -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: PASS -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: PASS -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: PASS -------------------------------------------------------------------- RASD - 02_enum.py: PASS -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: FAIL ERROR - KVM_SettingsDefineCapabilities returned 48 ResourcePool objects instead of 44 -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: PASS -------------------------------------------------------------------- SystemDevice - 02_reverse.py: PASS -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: PASS -------------------------------------------------------------------- VSSD - 01_enum.py: PASS -------------------------------------------------------------------- VSSD - 02_bootldr.py: SKIP -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: PASS -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Error invoking AddRS: add_net_res ERROR - (1, u'Unable to change (0) device: Error 0') ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): Unable to change (0) device: Error 0 Bug:<00015> -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 5 10:49:59 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 05 Aug 2009 16:19:59 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 05 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb In-Reply-To: <4A7962A7.5040904@linux.vnet.ibm.com> References: <4A7962A7.5040904@linux.vnet.ibm.com> Message-ID: <4A7963D7.7070107@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > ================================================= > Test Run Summary (Aug 05 2009): KVM on SUSE Linux Enterprise Server > 11 (i586) with sfcb > ================================================= > Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae > libvirt: 0.4.6 > Hypervisor: QEMU 0.9.1 > CIMOM: sfcb sfcbd 1.3.2 > Libvirt-cim revision: 937 > Libvirt-cim changeset: 02bb726b1ed3+ > Cimtest revision: 745 > Cimtest changeset: cb9ab2702c7b > ================================================= > FAIL : 3 > XFAIL : 5 > SKIP : 10 > PASS : 147 > ----------------- > Total : 165 > ================================================= > FAIL Test Summary: > ComputerSystemIndication - 01_created_indication.py: FAIL known issue > HostSystem - 03_hs_to_settdefcap.py: FAIL > SettingsDefineCapabilities - 01_forward.py: FAIL > Test case fix for the above are under review. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 5 11:26:38 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 05 Aug 2009 16:56:38 +0530 Subject: [Libvirt-cim] Test Run Summary (Aug 05 2009): KVM on Fedora release 10.90 (Rawhide) with Pegasus Message-ID: <4A796C6E.1010009@linux.vnet.ibm.com> ================================================= Test Run Summary (Aug 05 2009): KVM on Fedora release 10.90 (Rawhide) with Pegasus ================================================= Distro: Fedora release 10.90 (Rawhide) Kernel: 2.6.29-0.38.rc1.git4.fc11.x86_64 libvirt: 0.6.5 Hypervisor: QEMU 0.10.0 CIMOM: Pegasus 2.7.2 Libvirt-cim revision: 937 Libvirt-cim changeset: 02bb726b1ed3 Cimtest revision: 745 Cimtest changeset: cb9ab2702c7b ================================================= FAIL : 3 XFAIL : 4 SKIP : 9 PASS : 149 ----------------- Total : 165 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ================================================= SKIP Test Summary: ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: PASS -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: PASS -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_NOT_SUPPORTED: State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): CIM_ERR_NOT_SUPPORTED: State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: PASS -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: PASS -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: PASS -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: PASS -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - KVM_SettingsDefineCapabilities returned 56 RASD objects instead of 52 for DiskPool/cimtest-diskpool CIM_ERR_INVALID_CLASS: Linux_ComputerSystem -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: PASS -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: PASS -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: PASS -------------------------------------------------------------------- Processor - 01_processor.py: PASS -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: PASS -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: PASS -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: PASS -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: PASS -------------------------------------------------------------------- RASD - 02_enum.py: PASS -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP ERROR - Need to give different bridge name since it already exists -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: FAIL ERROR - KVM_SettingsDefineCapabilities returned 52 ResourcePool objects instead of 48 -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: PASS -------------------------------------------------------------------- SystemDevice - 02_reverse.py: PASS -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: PASS -------------------------------------------------------------------- VSSD - 01_enum.py: PASS -------------------------------------------------------------------- VSSD - 02_bootldr.py: SKIP -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: PASS -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Error invoking AddRS: add_net_res ERROR - (1, u'CIM_ERR_FAILED: Unable to change (0) device: Error 0') ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unable to change (0) device: Error 0 Bug:<00015> -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 5 11:35:15 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 05 Aug 2009 17:05:15 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 05 2009): KVM on Fedora release 10.90 (Rawhide) with Pegasus In-Reply-To: <4A796C6E.1010009@linux.vnet.ibm.com> References: <4A796C6E.1010009@linux.vnet.ibm.com> Message-ID: <4A796E73.5020105@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > ================================================= > Test Run Summary (Aug 05 2009): KVM on Fedora release 10.90 (Rawhide) > with Pegasus > ================================================= > Distro: Fedora release 10.90 (Rawhide) > Kernel: 2.6.29-0.38.rc1.git4.fc11.x86_64 > libvirt: 0.6.5 > Hypervisor: QEMU 0.10.0 > CIMOM: Pegasus 2.7.2 > Libvirt-cim revision: 937 > Libvirt-cim changeset: 02bb726b1ed3 > Cimtest revision: 745 > Cimtest changeset: cb9ab2702c7b > ================================================= > FAIL : 3 > XFAIL : 4 > SKIP : 9 > PASS : 149 > ----------------- > Total : 165 > ================================================= > FAIL Test Summary: > ComputerSystemIndication - 01_created_indication.py: FAIL Known issue > HostSystem - 03_hs_to_settdefcap.py: FAIL > SettingsDefineCapabilities - 01_forward.py: FAIL > Test case fix for the above are under review. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From anantyog at linux.vnet.ibm.com Wed Aug 5 12:15:42 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Wed, 05 Aug 2009 05:15:42 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [Test] Patch to set UUID in domain In-Reply-To: References: Message-ID: <0fe8417e16fce456f1a7.1249474542@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1249473758 25200 # Node ID 0fe8417e16fce456f1a7049f196340bcb58a14d1 # Parent cb9ab2702c7b693c334bc6709fd71833e7fa843f [Test] Patch to set UUID in domain Patch enables the user to set the UUID while defining a domain Signed-off-by: Yogananth Subramanian diff -r cb9ab2702c7b -r 0fe8417e16fc suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue Aug 04 05:20:41 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 05 05:02:38 2009 -0700 @@ -90,7 +90,7 @@ # classes to define VSSD parameters class CIM_VirtualSystemSettingData(CIMClassMOF): - def __init__(self, name, virt, bldr=None, emulator=None): + def __init__(self, name, virt, uuid=None, bldr=None, emulator=None): type = get_class_type(self.__class__.__name__) self.InstanceID = '%s:%s' % (type, name) self.Caption = self.Description = 'Virtual System' @@ -115,6 +115,9 @@ if bldr is not None: self.Bootloader = bldr + if uuid is not None: + self.UUID = uuid + class Xen_VirtualSystemSettingData(CIM_VirtualSystemSettingData): pass diff -r cb9ab2702c7b -r 0fe8417e16fc suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Aug 04 05:20:41 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Aug 05 05:02:38 2009 -0700 @@ -555,7 +555,7 @@ class VirtCIM: - def __init__(self, virt, dom_name, disk_dev, disk_source, + def __init__(self, virt, dom_name, uuid, disk_dev, disk_source, net_type, net_name, net_mac, vcpus, mem, mem_allocunits, emu_type, grstype, ip, port_num, kmap, irstype, btype, vnc_passwd): @@ -563,7 +563,7 @@ self.domain_name = dom_name self.err_rc = None self.err_desc = None - self.vssd = vsms.get_vssd_mof(virt, dom_name) + self.vssd = vsms.get_vssd_mof(virt, dom_name, uuid) self.nasd = vsms.get_nasd_class(virt)(type=net_type, mac=net_mac, name=dom_name, @@ -787,6 +787,7 @@ secondary_disk_path = const.Xen_secondary_disk_path def __init__(self, test_dom=const.default_domname, + uuid=None, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -807,7 +808,7 @@ self._os(const.Xen_kernel_path, const.Xen_init_path) self._devices(disk_file_path, disk, ntype, mac, net_name) - VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, + VirtCIM.__init__(self, 'Xen', test_dom, uuid, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) @@ -852,6 +853,7 @@ secondary_disk_path = const.KVM_secondary_disk_path def __init__(self, test_dom=const.default_domname, + uuid=None, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -867,7 +869,7 @@ logger.error('Error: Disk image does not exist') sys.exit(1) VirtXML.__init__(self, 'kvm', test_dom, set_uuid(), mem, vcpus) - VirtCIM.__init__(self, 'KVM', test_dom, disk, disk_file_path, + VirtCIM.__init__(self, 'KVM', test_dom, uuid, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) @@ -907,6 +909,7 @@ secondary_disk_path = const.XenFV_secondary_disk_path def __init__(self, test_dom=const.default_domname, + uuid=None, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -922,7 +925,7 @@ logger.error('Error: Disk image does not exist') sys.exit(1) VirtXML.__init__(self, 'xenfv', test_dom, set_uuid(), mem, vcpus) - VirtCIM.__init__(self, 'XenFV', test_dom, disk, disk_file_path, + VirtCIM.__init__(self, 'XenFV', test_dom, uuid, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) @@ -967,6 +970,7 @@ class LXCXML(VirtXML, VirtCIM): def __init__(self, test_dom=const.default_domname, + uuid=None, mem=const.default_memory, vcpus=const.default_vcpus, mac=const.LXC_default_mac, @@ -976,7 +980,7 @@ address="127.0.0.1", port_num='-1', keymap="en-us", irstype="mouse", btype="usb", vnc_passwd=None): VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus) - VirtCIM.__init__(self, 'LXC', test_dom, const.LXC_default_mp, + VirtCIM.__init__(self, 'LXC', test_dom, uuid, const.LXC_default_mp, const.LXC_default_source, ntype, net_name, mac, vcpus, mem, const.default_mallocunits, None, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) From anantyog at linux.vnet.ibm.com Wed Aug 5 12:15:43 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Wed, 05 Aug 2009 05:15:43 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [Test] Test case to test setting UUID by user In-Reply-To: References: Message-ID: <9b1015d9ecc67d973be7.1249474543@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1249473859 25200 # Node ID 9b1015d9ecc67d973be7a95df2bbabf6ba6632bd # Parent 0fe8417e16fce456f1a7049f196340bcb58a14d1 [Test] Test case to test setting UUID by user This test defines a domain with user specified UUID Signed-off-by: Yogananth Subramanian diff -r 0fe8417e16fc -r 9b1015d9ecc6 suites/libvirt-cim/cimtest/VSSD/05_set_uuid.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/05_set_uuid.py Wed Aug 05 05:04:19 2009 -0700 @@ -0,0 +1,86 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth Subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# + +import sys +from XenKvmLib import vsms +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.const import do_main +from XenKvmLib.classes import get_typed_class +from XenKvmLib.enumclass import GetInstance + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'uuid_domain' +uuid = "05ea345a-4539-57d8-abb4-d4fc858641f3" + +def get_vssd(ip, virt, get_cim_inst): + cn = get_typed_class(virt, "VirtualSystemSettingData") + inst = None + + try: + if virt == "XenFV": + virt = "Xen" + + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } + inst = GetInstance(ip, cn, key_list, get_cim_inst) + + except Exception, details: + logger.error(details) + return FAIL, inst + + if inst is None: + return FAIL, inst + + return PASS, inst + + at do_main(sup_types) +def main(): + options = main.options + + service = vsms.get_vsms_class(options.virt)(options.ip) + + cxml = vxml.get_class(options.virt)(default_dom, uuid=uuid) + ret = cxml.cim_define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + + try: + status, inst = get_vssd(options.ip, options.virt, True) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s"% + default_dom) + + if inst['UUID'] != uuid: + raise Exception(" UUID is differnet from the one set by the user") + + except Exception, details: + logger.error(details) + status = FAIL + + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) + From anantyog at linux.vnet.ibm.com Wed Aug 5 12:15:41 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Wed, 05 Aug 2009 05:15:41 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [Test] Patch and test for user defined UUID Message-ID: Hello everyone, I like to submit patch for setting UUID by the user and a testcase to verify it. Thx Yogi From deeptik at linux.vnet.ibm.com Wed Aug 5 13:48:43 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 05 Aug 2009 19:18:43 +0530 Subject: [Libvirt-cim] [PATCH 2 of 2] [Test] Test case to test setting UUID by user In-Reply-To: <9b1015d9ecc67d973be7.1249474543@elm3b151.beaverton.ibm.com> References: <9b1015d9ecc67d973be7.1249474543@elm3b151.beaverton.ibm.com> Message-ID: <4A798DBB.4060601@linux.vnet.ibm.com> Yogananth Subramanian wrote: > # HG changeset patch > # User anantyog at linux.vnet.ibm.com > # Date 1249473859 25200 > # Node ID 9b1015d9ecc67d973be7a95df2bbabf6ba6632bd > # Parent 0fe8417e16fce456f1a7049f196340bcb58a14d1 > [Test] Test case to test setting UUID by user > > This test defines a domain with user specified UUID > > Signed-off-by: Yogananth Subramanian > > diff -r 0fe8417e16fc -r 9b1015d9ecc6 suites/libvirt-cim/cimtest/VSSD/05_set_uuid.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/VSSD/05_set_uuid.py Wed Aug 05 05:04:19 2009 -0700 > @@ -0,0 +1,86 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Yogananth Subramanian > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU 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 > +# General Public License for more details. > +# > +# You should have received a copy of the GNU 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 > +# > A small description will be good. > + > +import sys > +from XenKvmLib import vsms > +from XenKvmLib import vxml > +from CimTest.Globals import logger > +from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.const import do_main > +from XenKvmLib.classes import get_typed_class > +from XenKvmLib.enumclass import GetInstance > + > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > +default_dom = 'uuid_domain' > +uuid = "05ea345a-4539-57d8-abb4-d4fc858641f3" > Instead of hardcoding the uuid can you use randint() and generate some random values in the uuid may be something like "05ea345a-%s-57d8-abb4-d4fc858641f3" % randint(1000, 9999) or something similar.. Like that we hope that we are having a UUID which could be unique otherwise the test might just error out. > + > +def get_vssd(ip, virt, get_cim_inst): > + cn = get_typed_class(virt, "VirtualSystemSettingData") > + inst = None > + > + try: > + if virt == "XenFV": > + virt = "Xen" > + > + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } > + inst = GetInstance(ip, cn, key_list, get_cim_inst) > + > + except Exception, details: > + logger.error(details) > + return FAIL, inst > + > + if inst is None: > Error message will be good. > + return FAIL, inst > + > + return PASS, inst > + > + at do_main(sup_types) > +def main(): > + options = main.options > + > + service = vsms.get_vsms_class(options.virt)(options.ip) > + > + cxml = vxml.get_class(options.virt)(default_dom, uuid=uuid) > + ret = cxml.cim_define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) > + return FAIL > Better if we include the cim_define as well in the try..except block... > + > + try: > + status, inst = get_vssd(options.ip, options.virt, True) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s"% > + default_dom) > + > + if inst['UUID'] != uuid: > + raise Exception(" UUID is differnet from the one set by the user") > would be good that we confirm the VVSD.ElementName has the expected domain name. > + > + except Exception, details: > + logger.error(details) > + status = FAIL > + > + cxml.undefine(options.ip) > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > + > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 5 13:52:44 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 05 Aug 2009 19:22:44 +0530 Subject: [Libvirt-cim] [PATCH 2 of 2] [Test] Test case to test setting UUID by user In-Reply-To: <4A798DBB.4060601@linux.vnet.ibm.com> References: <9b1015d9ecc67d973be7.1249474543@elm3b151.beaverton.ibm.com> <4A798DBB.4060601@linux.vnet.ibm.com> Message-ID: <4A798EAC.5000003@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Yogananth Subramanian wrote: >> # HG changeset patch >> # User anantyog at linux.vnet.ibm.com >> # Date 1249473859 25200 >> # Node ID 9b1015d9ecc67d973be7a95df2bbabf6ba6632bd >> # Parent 0fe8417e16fce456f1a7049f196340bcb58a14d1 >> [Test] Test case to test setting UUID by user >> >> This test defines a domain with user specified UUID >> >> Signed-off-by: Yogananth Subramanian >> >> diff -r 0fe8417e16fc -r 9b1015d9ecc6 >> suites/libvirt-cim/cimtest/VSSD/05_set_uuid.py >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/suites/libvirt-cim/cimtest/VSSD/05_set_uuid.py Wed Aug 05 >> 05:04:19 2009 -0700 >> @@ -0,0 +1,86 @@ >> +#!/usr/bin/python >> +# >> +# Copyright 2009 IBM Corp. >> +# >> +# Authors: >> +# Yogananth Subramanian >> +# >> +# This library is free software; you can redistribute it and/or >> +# modify it under the terms of the GNU 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 >> +# General Public License for more details. >> +# >> +# You should have received a copy of the GNU 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 >> +# >> > A small description will be good. >> + >> +import sys >> +from XenKvmLib import vsms >> +from XenKvmLib import vxml >> +from CimTest.Globals import logger >> +from CimTest.ReturnCodes import PASS, FAIL >> +from XenKvmLib.const import do_main >> +from XenKvmLib.classes import get_typed_class >> +from XenKvmLib.enumclass import GetInstance + >> +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] >> +default_dom = 'uuid_domain' >> +uuid = "05ea345a-4539-57d8-abb4-d4fc858641f3" >> > Instead of hardcoding the uuid can you use randint() and generate some > random values in the uuid may be something like > > "05ea345a-%s-57d8-abb4-d4fc858641f3" % randint(1000, 9999) > or something similar.. > Like that we hope that we are having a UUID which could be unique > otherwise the test might just error out. > > >> + >> +def get_vssd(ip, virt, get_cim_inst): >> + cn = get_typed_class(virt, "VirtualSystemSettingData") + inst >> = None >> + >> + try: >> + if virt == "XenFV": + virt = "Xen" >> + >> + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } >> + inst = GetInstance(ip, cn, key_list, get_cim_inst) >> + >> + except Exception, details: >> + logger.error(details) >> + return FAIL, inst >> + >> + if inst is None: >> > Error message will be good. You can ignore this comment I did not see that you are checking for the error message below in the main function. >> + return FAIL, inst >> + >> + return PASS, inst >> + >> + at do_main(sup_types) >> +def main(): >> + options = main.options + >> + service = vsms.get_vsms_class(options.virt)(options.ip) >> + >> + cxml = vxml.get_class(options.virt)(default_dom, uuid=uuid) >> + ret = cxml.cim_define(options.ip) >> + if not ret: >> + logger.error("Failed to define the dom: %s", default_dom) >> + return FAIL >> > Better if we include the cim_define as well in the try..except block... >> + >> + try: >> + status, inst = get_vssd(options.ip, options.virt, True) >> + if status != PASS: >> + raise Exception("Failed to get the VSSD instance for >> %s"% + default_dom) >> + >> + if inst['UUID'] != uuid: >> + raise Exception(" UUID is differnet from the one set by >> the user") >> > would be good that we confirm the VVSD.ElementName has the expected > domain name. >> + >> + except Exception, details: >> + logger.error(details) >> + status = FAIL >> + >> + cxml.undefine(options.ip) >> + return status >> + >> +if __name__ == "__main__": >> + sys.exit(main()) >> + >> _______________________________________________ >> Libvirt-cim mailing list >> Libvirt-cim at redhat.com >> https://www.redhat.com/mailman/listinfo/libvirt-cim >> > Also, do you have enough time to come up with a test case to test if libvirt-cim throws an error when two domain uses the same UUID? -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From sandeep.ms at hp.com Wed Aug 5 14:29:01 2009 From: sandeep.ms at hp.com (Subba Rao, Sandeep M (STSD)) Date: Wed, 5 Aug 2009 14:29:01 +0000 Subject: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" Message-ID: Hi, I'm trying to perform a live move of a domU using libvirt-cim, but I'm receiving a CIM_ERR_NOT_SUPPORTED exception. I have attached the request and response xmls. The same operation when tried through virsh command worked. Please let me know if I'm missing something here. Thanks for the help. Regards, Sandeep The following are the details of the 2 machines. Source Xen host: RHEL 5.3 The virsh comamnd that worked: virsh migrate --live Copy_Copy_RHEL52VM1 xen:/// xenmigr://15.154.102.20/ Libvirt and libvirt-cim Versions: [root at RHEL53Xen1 xen]# rpm -qa | grep -i libvirt libvirt-0.3.3-14.el5 libvirt-devel-0.3.3-14.el5 libvirt-cim-0.5.1-4.el5 libvirt-python-0.3.3-14.el5 RHEL Version: [root at RHEL53Xen1 xen]# cat /etc/issue Red Hat Enterprise Linux Server release 5.3 (Tikanga) Kernel \r on an \m Xen Version: [root at RHEL53Xen1 xen]# rpm -qa | grep xen xen-3.0.3-80.el5 xen-libs-3.0.3-80.el5 xen-devel-3.0.3-80.el5 kernel-xen-2.6.18-128.el5 Destination Xen host: RHEL 5.2 Libvirt and libvirt-cim Versions: [root at Rhel52-Xen ~]# rpm -qa | grep libvirt libvirt-cim-0.4-1 libvirt-0.3.3-7.el5 libvirt-python-0.3.3-7.el5 RHEL Version: [root at Rhel52-Xen ~]# cat /etc/issue Red Hat Enterprise Linux Server release 5.2 (Tikanga) Kernel \r on an \m Xen Version: [root at Rhel52-Xen ~]# rpm -qa | grep xen xen-libs-3.0.3-64.el5 xen-3.0.3-64.el5 kernel-xen-devel-2.6.18-92.el5 kernel-xen-2.6.18-92.el5 -------------- next part -------------- A non-text attachment was scrubbed... Name: MigrateVirtualSystemToHostRequest.xml Type: text/xml Size: 924 bytes Desc: MigrateVirtualSystemToHostRequest.xml URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MigrateVirtualSystemToHostResponse.xml Type: text/xml Size: 251 bytes Desc: MigrateVirtualSystemToHostResponse.xml URL: From kaitlin at linux.vnet.ibm.com Wed Aug 5 16:22:31 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 05 Aug 2009 09:22:31 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Add check to catch duplicated VirtualDevice parameter in DiskRASDs In-Reply-To: <3eebf7d2c4ebb1f4fdc1.1249448882@localhost.localdomain> References: <3eebf7d2c4ebb1f4fdc1.1249448882@localhost.localdomain> Message-ID: <4A79B1C7.1060802@linux.vnet.ibm.com> Richard Maciel wrote: > # HG changeset patch > # User Richard Maciel > # Date 1249448787 10800 > # Node ID 3eebf7d2c4ebb1f4fdc17173c0b12cb34496c32e > # Parent 23c0707da946c185f4387a13276b0c9fbf084da2 > (#2) Add check to catch duplicated VirtualDevice parameter in DiskRASDs > > At the moment of creation of a guest, it is necessary to check if its DiskRASDs all have unique (among themselves) VirtualDevice parameters > > #2: > Fixed patch submission date > > Signed-off-by: Richard Maciel > > diff -r 23c0707da946 -r 3eebf7d2c4eb src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 05 02:05:30 2009 -0300 > +++ b/src/Virt_VirtualSystemManagementService.c Wed Aug 05 02:06:27 2009 -0300 > @@ -1011,6 +1011,11 @@ > > for (i = 0; i < *index; i++) { > struct virt_device *ptr = &list[i]; > + > + if (STREQC(ptr->dev.disk.virtual_dev, dev->dev.disk.virtual_dev)) This line is over 80 characters. You want to make sure that you're comparing these values for disk devices only. If I attempt to define a guest with two network devices, then I see the error below and the guest fails to define properly. I added some debug, and here's what I get: device_parsing.c(325): No network source defined, leaving blank Virt_VirtualSystemManagementService.c(1015): ----------ptr->id: 00:16:3e:d2:92:9d, dev->id: 00:11:22:33:44:55 Virt_VirtualSystemManagementService.c(1016): ----------virt_dev: (null), virt_dev: (null) Virt_VirtualSystemManagementService.c(1426): Failed to classify resources: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest > + return "VirtualDevice property must be unique for each " > + "DiskResourceAllocationSettingData in a single " > + "guest"; > > if (STREQC(ptr->id, dev->id)) { > CU_DEBUG("Overriding device %s from refconf", ptr->id); > -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 5 16:51:25 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 05 Aug 2009 09:51:25 -0700 Subject: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" In-Reply-To: References: Message-ID: <4A79B88D.40509@linux.vnet.ibm.com> Subba Rao, Sandeep M (STSD) wrote: > Hi, > > I'm trying to perform a live move of a domU using libvirt-cim, but I'm receiving a CIM_ERR_NOT_SUPPORTED exception. > I have attached the request and response xmls. > > The same operation when tried through virsh command worked. > > Please let me know if I'm missing something here. Hi Sandeep, I don't see anything obvious in the information you provided. The return error of CIM_ERR_NOT_SUPPORTED is interesting, as both versions of libvirt support the MigrateVirtualSystemToHost() method. I'm wondering if something is happening in the CIMOM before our method even gets called. Can you enable debugging in the libvirt-cim providers and then provide the log output you get? You can enable debugging using the following: export CU_DEBUG="/tmp/libvirt-cim.log" Then restart the CIMOM in the same terminal (to make sure it picks up the environment settings). Thanks! > > Thanks for the help. > > Regards, > Sandeep > > The following are the details of the 2 machines. > > Source Xen host: RHEL 5.3 > > The virsh comamnd that worked: > virsh migrate --live Copy_Copy_RHEL52VM1 xen:/// xenmigr://15.154.102.20/ > > Libvirt and libvirt-cim Versions: > [root at RHEL53Xen1 xen]# rpm -qa | grep -i libvirt > libvirt-0.3.3-14.el5 > libvirt-devel-0.3.3-14.el5 > libvirt-cim-0.5.1-4.el5 > libvirt-python-0.3.3-14.el5 > > RHEL Version: > [root at RHEL53Xen1 xen]# cat /etc/issue > Red Hat Enterprise Linux Server release 5.3 (Tikanga) > Kernel \r on an \m > > Xen Version: > [root at RHEL53Xen1 xen]# rpm -qa | grep xen > xen-3.0.3-80.el5 > xen-libs-3.0.3-80.el5 > xen-devel-3.0.3-80.el5 > kernel-xen-2.6.18-128.el5 > > Destination Xen host: RHEL 5.2 > > Libvirt and libvirt-cim Versions: > [root at Rhel52-Xen ~]# rpm -qa | grep libvirt > libvirt-cim-0.4-1 > libvirt-0.3.3-7.el5 > libvirt-python-0.3.3-7.el5 > > RHEL Version: > [root at Rhel52-Xen ~]# cat /etc/issue > Red Hat Enterprise Linux Server release 5.2 (Tikanga) > Kernel \r on an \m > > Xen Version: > [root at Rhel52-Xen ~]# rpm -qa | grep xen > xen-libs-3.0.3-64.el5 > xen-3.0.3-64.el5 > kernel-xen-devel-2.6.18-92.el5 > kernel-xen-2.6.18-92.el5 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Wed Aug 5 17:40:02 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 05 Aug 2009 14:40:02 -0300 Subject: [Libvirt-cim] [PATCH] (#3) Add check to catch duplicated VirtualDevice parameter in DiskRASDs Message-ID: # HG changeset patch # User Richard Maciel # Date 1249492020 10800 # Node ID cf3e493e4b7cd09305b1aba45ca32f82b385ae9d # Parent 23c0707da946c185f4387a13276b0c9fbf084da2 (#3) Add check to catch duplicated VirtualDevice parameter in DiskRASDs At the moment of creation of a guest, it is necessary to check if its DiskRASDs all have unique (among themselves) VirtualDevice parameters #2: Fixed patch submission date #3: Added check for disk type before comparing virtual_dev members Signed-off-by: Richard Maciel diff -r 23c0707da946 -r cf3e493e4b7c src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 05 02:05:30 2009 -0300 +++ b/src/Virt_VirtualSystemManagementService.c Wed Aug 05 14:07:00 2009 -0300 @@ -1011,6 +1011,13 @@ for (i = 0; i < *index; i++) { struct virt_device *ptr = &list[i]; + + if (dev->type == CIM_RES_TYPE_DISK && + STREQC(ptr->dev.disk.virtual_dev, + dev->dev.disk.virtual_dev)) + return "VirtualDevice property must be unique for each " + "DiskResourceAllocationSettingData in a single " + "guest"; if (STREQC(ptr->id, dev->id)) { CU_DEBUG("Overriding device %s from refconf", ptr->id); From madan-ganesh.v at hp.com Wed Aug 5 19:35:13 2009 From: madan-ganesh.v at hp.com (Velayudham, Madan Ganesh (STSD / ESS SW)) Date: Wed, 5 Aug 2009 19:35:13 +0000 Subject: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" In-Reply-To: <4A79B88D.40509@linux.vnet.ibm.com> References: <4A79B88D.40509@linux.vnet.ibm.com> Message-ID: <33AD874197876A4E9440933154AA337D2CA451D5B7@GVW1157EXB.americas.hpqcorp.net> Hi Kaitlin, Thanks for the troubleshooting tip. We retried the invocation and the same result appeared. The following snippet related to migrateVirtualSystemToHost was found in the /tmp/libvirt-cim.log file. device_parsing.c(257): Disk node: disk infostore.c(88): Path is /etc/libvirt/cim/Xen_Copy_Copy_RHEL52VM1 std_invokemethod.c(279): Method `MigrateVirtualSystemToHost' execution attempted std_invokemethod.c(230): Method parameter `ComputerSystem' validated type 0x1100 std_invokemethod.c(230): Method parameter `DestinationHost' validated type 0x1600 std_invokemethod.c(215): No optional parameter supplied for `MigrationSettingData' std_invokemethod.c(230): Method parameter `MigrationSettingData' validated type 0x1000 std_invokemethod.c(303): Executing handler for method `MigrateVirtualSystemToHost' misc_util.c(72): Connecting to libvirt with uri `xen' Virt_VSMigrationService.c(102): Using default values for MigrationSettingData param Virt_VSMigrationService.c(1351): Prepared migration job f64be851-e44a-4d3c-b4a8-bce814ceffe1 Virt_VSMigrationService.c(1283): Creating instance: root/virt:Virt_MigrationJob.InstanceID="f64be851-e44a-4d3c-b4a8-bce814ceffe1" Virt_VSMigrationService.c(1287): Failed to create job instance: 7 std_invokemethod.c(305): Method `MigrateVirtualSystemToHost' returned 7 misc_util.c(72): Connecting to libvirt with uri `xen' misc_util.c(199): URI of connection is: xen:/// misc_util.c(199): URI of connection is: xen:/// device_parsing.c(257): Disk node: disk infostore.c(88): Path is /etc/libvirt/cim/Xen_RHELVM-GUI-1 Can you suggest us how to get around this? Thanks and Regards, Madan (_MaGa_) Madan Ganesh Velayudham Office: +91 80 2516 5333 -----Original Message----- From: Kaitlin Rupert [mailto:kaitlin at linux.vnet.ibm.com] Sent: Wednesday, August 05, 2009 10:21 PM To: List for discussion and development of libvirt CIM Cc: Velayudham, Madan Ganesh (STSD / ESS SW) Subject: Re: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" Subba Rao, Sandeep M (STSD) wrote: > Hi, > > I'm trying to perform a live move of a domU using libvirt-cim, but I'm receiving a CIM_ERR_NOT_SUPPORTED exception. > I have attached the request and response xmls. > > The same operation when tried through virsh command worked. > > Please let me know if I'm missing something here. Hi Sandeep, I don't see anything obvious in the information you provided. The return error of CIM_ERR_NOT_SUPPORTED is interesting, as both versions of libvirt support the MigrateVirtualSystemToHost() method. I'm wondering if something is happening in the CIMOM before our method even gets called. Can you enable debugging in the libvirt-cim providers and then provide the log output you get? You can enable debugging using the following: export CU_DEBUG="/tmp/libvirt-cim.log" Then restart the CIMOM in the same terminal (to make sure it picks up the environment settings). Thanks! > > Thanks for the help. > > Regards, > Sandeep > > The following are the details of the 2 machines. > > Source Xen host: RHEL 5.3 > > The virsh comamnd that worked: > virsh migrate --live Copy_Copy_RHEL52VM1 xen:/// xenmigr://15.154.102.20/ > > Libvirt and libvirt-cim Versions: > [root at RHEL53Xen1 xen]# rpm -qa | grep -i libvirt > libvirt-0.3.3-14.el5 > libvirt-devel-0.3.3-14.el5 > libvirt-cim-0.5.1-4.el5 > libvirt-python-0.3.3-14.el5 > > RHEL Version: > [root at RHEL53Xen1 xen]# cat /etc/issue > Red Hat Enterprise Linux Server release 5.3 (Tikanga) > Kernel \r on an \m > > Xen Version: > [root at RHEL53Xen1 xen]# rpm -qa | grep xen > xen-3.0.3-80.el5 > xen-libs-3.0.3-80.el5 > xen-devel-3.0.3-80.el5 > kernel-xen-2.6.18-128.el5 > > Destination Xen host: RHEL 5.2 > > Libvirt and libvirt-cim Versions: > [root at Rhel52-Xen ~]# rpm -qa | grep libvirt > libvirt-cim-0.4-1 > libvirt-0.3.3-7.el5 > libvirt-python-0.3.3-7.el5 > > RHEL Version: > [root at Rhel52-Xen ~]# cat /etc/issue > Red Hat Enterprise Linux Server release 5.2 (Tikanga) > Kernel \r on an \m > > Xen Version: > [root at Rhel52-Xen ~]# rpm -qa | grep xen > xen-libs-3.0.3-64.el5 > xen-3.0.3-64.el5 > kernel-xen-devel-2.6.18-92.el5 > kernel-xen-2.6.18-92.el5 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 5 22:16:46 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 05 Aug 2009 15:16:46 -0700 Subject: [Libvirt-cim] [PATCH] Add addiitonal attributes to StorageVolumeResourceAllocationSettingData Message-ID: <7f946266983b4b0a7e0a.1249510606@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1245187550 25200 # Node ID 7f946266983b4b0a7e0aa86d5a1b21b794b46a76 # Parent 8c9cb3efdbad40890a5408267bc6a0d7b4b3de6e Add addiitonal attributes to StorageVolumeResourceAllocationSettingData... These attributes will be needed when defining a new image. Also, make the necessary changes to expose these attributes via SDC. Signed-off-by: Kaitlin Rupert diff -r 8c9cb3efdbad -r 7f946266983b schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Wed Aug 05 14:07:00 2009 -0300 +++ b/schema/ResourceAllocationSettingData.mof Tue Jun 16 14:25:50 2009 -0700 @@ -296,8 +296,12 @@ ] class Xen_StorageVolumeResourceAllocationSettingData : Xen_ResourceAllocationSettingData { + string VolumeName; string Path; - uint16 Type; + uint16 FormatType; + uint16 AllocationQuantity; + uint16 Capacity; + string AllocationUnits; }; [Description ("KVM storage volume settings"), @@ -305,7 +309,11 @@ ] class KVM_StorageVolumeResourceAllocationSettingData : KVM_ResourceAllocationSettingData { + string VolumeName; string Path; - uint16 Type; + uint16 FormatType; + uint16 AllocationQuantity; + uint16 Capacity; + string AllocationUnits; }; diff -r 8c9cb3efdbad -r 7f946266983b src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Aug 05 14:07:00 2009 -0300 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Jun 16 14:25:50 2009 -0700 @@ -1038,7 +1038,11 @@ struct virt_pool *pool = NULL; CMPIInstance *inst = NULL; int type = 0; + const char *name; const char *path; + uint16_t alloc = 0; + uint16_t cap = 0; + const char *units; switch(template_type) { case SDC_RASD_MIN: @@ -1080,11 +1084,24 @@ goto out; CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars); - CMSetProperty(inst, "Type", (CMPIValue *)&type, CMPI_uint16); + CMSetProperty(inst, "FormatType", (CMPIValue *)&type, CMPI_uint16); + + name = "tmp.img"; + CMSetProperty(inst, "VolumeName", (CMPIValue *)name, CMPI_chars); path = "/var/lib/libvirt/images/"; CMSetProperty(inst, "Path", (CMPIValue *)path, CMPI_chars); + alloc = 0; + CMSetProperty(inst, "AllocationQuantity", + (CMPIValue *)&alloc, CMPI_uint16); + + cap = 0; + CMSetProperty(inst, "Capacity", (CMPIValue *)&cap, CMPI_uint16); + + units = "G"; + CMSetProperty(inst, "AllocationUnits", (CMPIValue *)units, CMPI_chars); + inst_list_add(list, inst); out: From kaitlin at linux.vnet.ibm.com Wed Aug 5 23:07:59 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 05 Aug 2009 16:07:59 -0700 Subject: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" In-Reply-To: <33AD874197876A4E9440933154AA337D2CA451D5B7@GVW1157EXB.americas.hpqcorp.net> References: <4A79B88D.40509@linux.vnet.ibm.com> <33AD874197876A4E9440933154AA337D2CA451D5B7@GVW1157EXB.americas.hpqcorp.net> Message-ID: <4A7A10CF.9040002@linux.vnet.ibm.com> Velayudham, Madan Ganesh (STSD / ESS SW) wrote: > Hi Kaitlin, > > Thanks for the troubleshooting tip. > > We retried the invocation and the same result appeared. The following snippet related to migrateVirtualSystemToHost was found in the /tmp/libvirt-cim.log file. > > > device_parsing.c(257): Disk node: disk > infostore.c(88): Path is /etc/libvirt/cim/Xen_Copy_Copy_RHEL52VM1 > std_invokemethod.c(279): Method `MigrateVirtualSystemToHost' execution attempted > std_invokemethod.c(230): Method parameter `ComputerSystem' validated type 0x1100 > std_invokemethod.c(230): Method parameter `DestinationHost' validated type 0x1600 > std_invokemethod.c(215): No optional parameter supplied for `MigrationSettingData' > std_invokemethod.c(230): Method parameter `MigrationSettingData' validated type 0x1000 > std_invokemethod.c(303): Executing handler for method `MigrateVirtualSystemToHost' > misc_util.c(72): Connecting to libvirt with uri `xen' > Virt_VSMigrationService.c(102): Using default values for MigrationSettingData param > Virt_VSMigrationService.c(1351): Prepared migration job f64be851-e44a-4d3c-b4a8-bce814ceffe1 > Virt_VSMigrationService.c(1283): Creating instance: root/virt:Virt_MigrationJob.InstanceID="f64be851-e44a-4d3c-b4a8-bce814ceffe1" > Virt_VSMigrationService.c(1287): Failed to create job instance: 7 We're doing a callback to the CIMOM here, asking the CIMOM to create an instance of Virt_MigrationJob for us. The CIMOM is responding saying that our request is unsupported. Can you check the following setting: # cat /etc/Pegasus/cimserver_planned.conf | grep repositoryIsDefaultInstanceProvider or # cat /etc/Pegasus/cimserver_current.conf | grep repositoryIsDefaultInstanceProvider You should see this set to: repositoryIsDefaultInstanceProvider=true If it's not, can you try running the following command: cimconfig -s repositoryIsDefaultInstanceProvider=true -p Then be sure to restart the CIMOM so it picks up the changes. This tells Pegasus that we would like it to enable it's default provider for generating instances. Let me know if this doesn't resolve the issue. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From madan-ganesh.v at hp.com Thu Aug 6 02:52:45 2009 From: madan-ganesh.v at hp.com (Velayudham, Madan Ganesh (STSD / ESS SW)) Date: Thu, 6 Aug 2009 02:52:45 +0000 Subject: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" In-Reply-To: <4A7A10CF.9040002@linux.vnet.ibm.com> References: <4A79B88D.40509@linux.vnet.ibm.com> <33AD874197876A4E9440933154AA337D2CA451D5B7@GVW1157EXB.americas.hpqcorp.net> <4A7A10CF.9040002@linux.vnet.ibm.com> Message-ID: <33AD874197876A4E9440933154AA337D2CA451D67A@GVW1157EXB.americas.hpqcorp.net> Hi Kaitlin, Thanks for your suggestion. Our RHEL 5.3 did not have either cimserver_[planned|current].conf file. Hence we enabled the flag repositoryIsDefaultInstanceProvider, now the migrateVirtualSystem call succeeds. Thank you. std_invokemethod.c(279): Method `MigrateVirtualSystemToHost' execution attempted std_invokemethod.c(230): Method parameter `ComputerSystem' validated type 0x1100 std_invokemethod.c(230): Method parameter `DestinationHost' validated type 0x1600 std_invokemethod.c(215): No optional parameter supplied for `MigrationSettingData' std_invokemethod.c(230): Method parameter `MigrationSettingData' validated type 0x1000 std_invokemethod.c(303): Executing handler for method `MigrateVirtualSystemToHost' misc_util.c(72): Connecting to libvirt with uri `xen' Virt_VSMigrationService.c(102): Using default values for MigrationSettingData param Virt_VSMigrationService.c(1351): Prepared migration job 9e5f538c-3658-4e31-9b97-b528d51d063d Virt_VSMigrationService.c(1283): Creating instance: root/virt:Virt_MigrationJob.InstanceID="9e5f538c-3658-4e31-9b97-b528d51d063d" Virt_VSMigrationService.c(783): Creating indication. misc_util.c(72): Connecting to libvirt with uri `xen' misc_util.c(199): URI of connection is: xen:/// Virt_VSMigrationService.c(757): Setting SourceInstance std_indication.c(70): Indications disabled for this provider std_invokemethod.c(305): Method `MigrateVirtualSystemToHost' returned 0 Virt_VSMigrationService.c(1184): Migration Job 9e5f538c-3658-4e31-9b97-b528d51d063d started Virt_VSMigrationService.c(833): MigrationJob ref: root/virt:Virt_MigrationJob.InstanceID="9e5f538c-3658-4e31-9b97-b528d51d063d" Virt_VSMigrationService.c(783): Creating indication. Virt_VSMigrationService.c(806): Setting PreviousInstance Virt_VSMigrationService.c(896): Modifying job 9e5f538c-3658-4e31-9b97-b528d51d063d (4:Running) misc_util.c(72): Connecting to libvirt with uri `xen' misc_util.c(199): URI of connection is: xen:/// Virt_VSMigrationService.c(757): Setting SourceInstance std_indication.c(70): Indications disabled for this provider misc_util.c(72): Connecting to libvirt with uri `xen' Virt_VSMigrationService.c(1118): Remote domain `Copy_Copy_RHEL52VM1' exists Virt_VSMigrationService.c(833): MigrationJob ref: root/virt:Virt_MigrationJob.InstanceID="9e5f538c-3658-4e31-9b97-b528d51d063d" Virt_VSMigrationService.c(783): Creating indication. misc_util.c(72): Connecting to libvirt with uri `xen' misc_util.c(199): URI of connection is: xen:/// Virt_VSMigrationService.c(757): Setting SourceInstance std_indication.c(70): Indications disabled for this provider Virt_VSMigrationService.c(1189): Migration Job 9e5f538c-3658-4e31-9b97-b528d51d063d finished: 1 Virt_VSMigrationService.c(833): MigrationJob ref: root/virt:Virt_MigrationJob.InstanceID="9e5f538c-3658-4e31-9b97-b528d51d063d" Virt_VSMigrationService.c(783): Creating indication. Virt_VSMigrationService.c(806): Setting PreviousInstance Virt_VSMigrationService.c(896): Modifying job 9e5f538c-3658-4e31-9b97-b528d51d063d (7:Remote already has domain `Copy_Copy_RHEL52VM1') Is repositoryIsDefaultInstanceProvider option enabled by default, should we customize this? Thanks and Regards, Madan (_MaGa_) Madan Ganesh Velayudham Office: +91 80 2516 5333 -----Original Message----- From: Kaitlin Rupert [mailto:kaitlin at linux.vnet.ibm.com] Sent: Thursday, August 06, 2009 4:38 AM To: Velayudham, Madan Ganesh (STSD / ESS SW) Cc: List for discussion and development of libvirt CIM; Subba Rao, Sandeep M (STSD) Subject: Re: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" Velayudham, Madan Ganesh (STSD / ESS SW) wrote: > Hi Kaitlin, > > Thanks for the troubleshooting tip. > > We retried the invocation and the same result appeared. The following snippet related to migrateVirtualSystemToHost was found in the /tmp/libvirt-cim.log file. > > > device_parsing.c(257): Disk node: disk > infostore.c(88): Path is /etc/libvirt/cim/Xen_Copy_Copy_RHEL52VM1 > std_invokemethod.c(279): Method `MigrateVirtualSystemToHost' execution attempted > std_invokemethod.c(230): Method parameter `ComputerSystem' validated type 0x1100 > std_invokemethod.c(230): Method parameter `DestinationHost' validated type 0x1600 > std_invokemethod.c(215): No optional parameter supplied for `MigrationSettingData' > std_invokemethod.c(230): Method parameter `MigrationSettingData' validated type 0x1000 > std_invokemethod.c(303): Executing handler for method `MigrateVirtualSystemToHost' > misc_util.c(72): Connecting to libvirt with uri `xen' > Virt_VSMigrationService.c(102): Using default values for MigrationSettingData param > Virt_VSMigrationService.c(1351): Prepared migration job f64be851-e44a-4d3c-b4a8-bce814ceffe1 > Virt_VSMigrationService.c(1283): Creating instance: root/virt:Virt_MigrationJob.InstanceID="f64be851-e44a-4d3c-b4a8-bce814ceffe1" > Virt_VSMigrationService.c(1287): Failed to create job instance: 7 We're doing a callback to the CIMOM here, asking the CIMOM to create an instance of Virt_MigrationJob for us. The CIMOM is responding saying that our request is unsupported. Can you check the following setting: # cat /etc/Pegasus/cimserver_planned.conf | grep repositoryIsDefaultInstanceProvider or # cat /etc/Pegasus/cimserver_current.conf | grep repositoryIsDefaultInstanceProvider You should see this set to: repositoryIsDefaultInstanceProvider=true If it's not, can you try running the following command: cimconfig -s repositoryIsDefaultInstanceProvider=true -p Then be sure to restart the CIMOM so it picks up the changes. This tells Pegasus that we would like it to enable it's default provider for generating instances. Let me know if this doesn't resolve the issue. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Aug 6 10:05:56 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 06 Aug 2009 15:35:56 +0530 Subject: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" In-Reply-To: <33AD874197876A4E9440933154AA337D2CA451D67A@GVW1157EXB.americas.hpqcorp.net> References: <4A79B88D.40509@linux.vnet.ibm.com> <33AD874197876A4E9440933154AA337D2CA451D5B7@GVW1157EXB.americas.hpqcorp.net> <4A7A10CF.9040002@linux.vnet.ibm.com> <33AD874197876A4E9440933154AA337D2CA451D67A@GVW1157EXB.americas.hpqcorp.net> Message-ID: <4A7AAB04.5050001@linux.vnet.ibm.com> Velayudham, Madan Ganesh (STSD / ESS SW) wrote: > Hi Kaitlin, > > Thanks for your suggestion. > > Our RHEL 5.3 did not have either cimserver_[planned|current].conf file. Hence we enabled the flag repositoryIsDefaultInstanceProvider, now the migrateVirtualSystem call succeeds. Thank you. > > > std_invokemethod.c(279): Method `MigrateVirtualSystemToHost' execution attempted > std_invokemethod.c(230): Method parameter `ComputerSystem' validated type 0x1100 > std_invokemethod.c(230): Method parameter `DestinationHost' validated type 0x1600 > std_invokemethod.c(215): No optional parameter supplied for `MigrationSettingData' > std_invokemethod.c(230): Method parameter `MigrationSettingData' validated type 0x1000 > std_invokemethod.c(303): Executing handler for method `MigrateVirtualSystemToHost' > misc_util.c(72): Connecting to libvirt with uri `xen' > Virt_VSMigrationService.c(102): Using default values for MigrationSettingData param > Virt_VSMigrationService.c(1351): Prepared migration job 9e5f538c-3658-4e31-9b97-b528d51d063d > Virt_VSMigrationService.c(1283): Creating instance: root/virt:Virt_MigrationJob.InstanceID="9e5f538c-3658-4e31-9b97-b528d51d063d" > Virt_VSMigrationService.c(783): Creating indication. > misc_util.c(72): Connecting to libvirt with uri `xen' > misc_util.c(199): URI of connection is: xen:/// > Virt_VSMigrationService.c(757): Setting SourceInstance > std_indication.c(70): Indications disabled for this provider > std_invokemethod.c(305): Method `MigrateVirtualSystemToHost' returned 0 > Virt_VSMigrationService.c(1184): Migration Job 9e5f538c-3658-4e31-9b97-b528d51d063d started > Virt_VSMigrationService.c(833): MigrationJob ref: root/virt:Virt_MigrationJob.InstanceID="9e5f538c-3658-4e31-9b97-b528d51d063d" > Virt_VSMigrationService.c(783): Creating indication. > Virt_VSMigrationService.c(806): Setting PreviousInstance > Virt_VSMigrationService.c(896): Modifying job 9e5f538c-3658-4e31-9b97-b528d51d063d (4:Running) > misc_util.c(72): Connecting to libvirt with uri `xen' > misc_util.c(199): URI of connection is: xen:/// > Virt_VSMigrationService.c(757): Setting SourceInstance > std_indication.c(70): Indications disabled for this provider > misc_util.c(72): Connecting to libvirt with uri `xen' > Virt_VSMigrationService.c(1118): Remote domain `Copy_Copy_RHEL52VM1' exists > Virt_VSMigrationService.c(833): MigrationJob ref: root/virt:Virt_MigrationJob.InstanceID="9e5f538c-3658-4e31-9b97-b528d51d063d" > Virt_VSMigrationService.c(783): Creating indication. > misc_util.c(72): Connecting to libvirt with uri `xen' > misc_util.c(199): URI of connection is: xen:/// > Virt_VSMigrationService.c(757): Setting SourceInstance > std_indication.c(70): Indications disabled for this provider > Virt_VSMigrationService.c(1189): Migration Job 9e5f538c-3658-4e31-9b97-b528d51d063d finished: 1 > Virt_VSMigrationService.c(833): MigrationJob ref: root/virt:Virt_MigrationJob.InstanceID="9e5f538c-3658-4e31-9b97-b528d51d063d" > Virt_VSMigrationService.c(783): Creating indication. > Virt_VSMigrationService.c(806): Setting PreviousInstance > Virt_VSMigrationService.c(896): Modifying job 9e5f538c-3658-4e31-9b97-b528d51d063d (7:Remote already has domain `Copy_Copy_RHEL52VM1') > > > Is repositoryIsDefaultInstanceProvider option enabled by default, should we customize this? > This would not be enabled by default. If desired you can automate it or enable it manually. For configuration information and the flags necessary for libvirt-cim you can refer to http://wiki.libvirt.org/page/Cimtest > Thanks and Regards, > Madan (_MaGa_) > Madan Ganesh Velayudham > Office: +91 80 2516 5333 > > > -----Original Message----- > From: Kaitlin Rupert [mailto:kaitlin at linux.vnet.ibm.com] > Sent: Thursday, August 06, 2009 4:38 AM > To: Velayudham, Madan Ganesh (STSD / ESS SW) > Cc: List for discussion and development of libvirt CIM; Subba Rao, Sandeep M (STSD) > Subject: Re: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" > > Velayudham, Madan Ganesh (STSD / ESS SW) wrote: > >> Hi Kaitlin, >> >> Thanks for the troubleshooting tip. >> >> We retried the invocation and the same result appeared. The following snippet related to migrateVirtualSystemToHost was found in the /tmp/libvirt-cim.log file. >> >> >> device_parsing.c(257): Disk node: disk >> infostore.c(88): Path is /etc/libvirt/cim/Xen_Copy_Copy_RHEL52VM1 >> std_invokemethod.c(279): Method `MigrateVirtualSystemToHost' execution attempted >> std_invokemethod.c(230): Method parameter `ComputerSystem' validated type 0x1100 >> std_invokemethod.c(230): Method parameter `DestinationHost' validated type 0x1600 >> std_invokemethod.c(215): No optional parameter supplied for `MigrationSettingData' >> std_invokemethod.c(230): Method parameter `MigrationSettingData' validated type 0x1000 >> std_invokemethod.c(303): Executing handler for method `MigrateVirtualSystemToHost' >> misc_util.c(72): Connecting to libvirt with uri `xen' >> Virt_VSMigrationService.c(102): Using default values for MigrationSettingData param >> Virt_VSMigrationService.c(1351): Prepared migration job f64be851-e44a-4d3c-b4a8-bce814ceffe1 >> Virt_VSMigrationService.c(1283): Creating instance: root/virt:Virt_MigrationJob.InstanceID="f64be851-e44a-4d3c-b4a8-bce814ceffe1" >> Virt_VSMigrationService.c(1287): Failed to create job instance: 7 >> > > We're doing a callback to the CIMOM here, asking the CIMOM to create an > instance of Virt_MigrationJob for us. The CIMOM is responding saying > that our request is unsupported. > > Can you check the following setting: > > # cat /etc/Pegasus/cimserver_planned.conf | grep > repositoryIsDefaultInstanceProvider > > or > > # cat /etc/Pegasus/cimserver_current.conf | grep > repositoryIsDefaultInstanceProvider > > You should see this set to: > repositoryIsDefaultInstanceProvider=true > > If it's not, can you try running the following command: > > cimconfig -s repositoryIsDefaultInstanceProvider=true -p > > Then be sure to restart the CIMOM so it picks up the changes. This > tells Pegasus that we would like it to enable it's default provider for > generating instances. > > Let me know if this doesn't resolve the issue. > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 6 15:32:55 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 06 Aug 2009 08:32:55 -0700 Subject: [Libvirt-cim] MigratevirtualSystemToHost reports "unsupported" In-Reply-To: <4A7AAB04.5050001@linux.vnet.ibm.com> References: <4A79B88D.40509@linux.vnet.ibm.com> <33AD874197876A4E9440933154AA337D2CA451D5B7@GVW1157EXB.americas.hpqcorp.net> <4A7A10CF.9040002@linux.vnet.ibm.com> <33AD874197876A4E9440933154AA337D2CA451D67A@GVW1157EXB.americas.hpqcorp.net> <4A7AAB04.5050001@linux.vnet.ibm.com> Message-ID: <4A7AF7A7.4080102@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Velayudham, Madan Ganesh (STSD / ESS SW) wrote: >> Hi Kaitlin, >> >> Thanks for your suggestion. >> >> Our RHEL 5.3 did not have either cimserver_[planned|current].conf >> file. Hence we enabled the flag repositoryIsDefaultInstanceProvider, >> now the migrateVirtualSystem call succeeds. Thank you. Glad to hear it's working =) >> >> Is repositoryIsDefaultInstanceProvider option enabled by default, >> should we customize this? During the libivrt-cim install, we should be sure to set this flag, or else our providers don't function properly. However, it's possible for another provider set (or some other package) to overwrite the change me make. So it's difficult to ensure that this option is set properly. We should at least add a note to our README that indicates this should be set. >> > This would not be enabled by default. If desired you can automate it or > enable it manually. > For configuration information and the flags necessary for libvirt-cim > you can refer to http://wiki.libvirt.org/page/Cimtest >> Thanks and Regards, >> Madan (_MaGa_) >> Madan Ganesh Velayudham >> Office: +91 80 2516 5333 >> >> >> -----Original Message----- >> From: Kaitlin Rupert [mailto:kaitlin at linux.vnet.ibm.com] Sent: >> Thursday, August 06, 2009 4:38 AM >> To: Velayudham, Madan Ganesh (STSD / ESS SW) >> Cc: List for discussion and development of libvirt CIM; Subba Rao, >> Sandeep M (STSD) >> Subject: Re: [Libvirt-cim] MigratevirtualSystemToHost reports >> "unsupported" >> >> Velayudham, Madan Ganesh (STSD / ESS SW) wrote: >> >>> Hi Kaitlin, >>> >>> Thanks for the troubleshooting tip. >>> >>> We retried the invocation and the same result appeared. The following >>> snippet related to migrateVirtualSystemToHost was found in the >>> /tmp/libvirt-cim.log file. >>> >>> >>> device_parsing.c(257): Disk node: disk >>> infostore.c(88): Path is /etc/libvirt/cim/Xen_Copy_Copy_RHEL52VM1 >>> std_invokemethod.c(279): Method `MigrateVirtualSystemToHost' >>> execution attempted >>> std_invokemethod.c(230): Method parameter `ComputerSystem' validated >>> type 0x1100 >>> std_invokemethod.c(230): Method parameter `DestinationHost' validated >>> type 0x1600 >>> std_invokemethod.c(215): No optional parameter supplied for >>> `MigrationSettingData' >>> std_invokemethod.c(230): Method parameter `MigrationSettingData' >>> validated type 0x1000 >>> std_invokemethod.c(303): Executing handler for method >>> `MigrateVirtualSystemToHost' >>> misc_util.c(72): Connecting to libvirt with uri `xen' >>> Virt_VSMigrationService.c(102): Using default values for >>> MigrationSettingData param >>> Virt_VSMigrationService.c(1351): Prepared migration job >>> f64be851-e44a-4d3c-b4a8-bce814ceffe1 >>> Virt_VSMigrationService.c(1283): Creating instance: >>> root/virt:Virt_MigrationJob.InstanceID="f64be851-e44a-4d3c-b4a8-bce814ceffe1" >>> >>> Virt_VSMigrationService.c(1287): Failed to create job instance: 7 >>> >> >> We're doing a callback to the CIMOM here, asking the CIMOM to create >> an instance of Virt_MigrationJob for us. The CIMOM is responding >> saying that our request is unsupported. >> >> Can you check the following setting: >> >> # cat /etc/Pegasus/cimserver_planned.conf | grep >> repositoryIsDefaultInstanceProvider >> >> or >> >> # cat /etc/Pegasus/cimserver_current.conf | grep >> repositoryIsDefaultInstanceProvider >> >> You should see this set to: >> repositoryIsDefaultInstanceProvider=true >> >> If it's not, can you try running the following command: >> >> cimconfig -s repositoryIsDefaultInstanceProvider=true -p >> >> Then be sure to restart the CIMOM so it picks up the changes. This >> tells Pegasus that we would like it to enable it's default provider >> for generating instances. >> >> Let me know if this doesn't resolve the issue. >> > -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 6 21:59:47 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 06 Aug 2009 14:59:47 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Initial image creation support Message-ID: Right now, the CreateResourceInPool() doesn't do anything other than check the parameters that are parsed in. Subsequent patches will add additional functionality. From kaitlin at linux.vnet.ibm.com Thu Aug 6 21:59:48 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 06 Aug 2009 14:59:48 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Method definition to RPCS mof for image creation In-Reply-To: References: Message-ID: <274a3daaed7a8f64d7e0.1249595988@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1245187550 25200 # Node ID 274a3daaed7a8f64d7e070ef77a59bd42951922b # Parent 7f946266983b4b0a7e0aa86d5a1b21b794b46a76 Method definition to RPCS mof for image creation Signed-off-by: Kaitlin Rupert diff -r 7f946266983b -r 274a3daaed7a schema/ResourcePoolConfigurationService.mof --- a/schema/ResourcePoolConfigurationService.mof Tue Jun 16 14:25:50 2009 -0700 +++ b/schema/ResourcePoolConfigurationService.mof Tue Jun 16 14:25:50 2009 -0700 @@ -3,14 +3,71 @@ [Provider("cmpi::Virt_ResourcePoolConfigurationService")] class Xen_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService { + + [Description ( "Create a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 CreateResourceInPool( + [IN, Description ( "String containing a representation of a " + "CIM_SettingData instance that is used to specify " + "the settings for the resource." ), + EmbeddedInstance ( "CIM_ResourceAllocationSettingData" )] + string Settings, + + [IN, Description ( "Reference to the pool to create the resources in." )] + CIM_ResourcePool REF Pool, + + [IN ( false ), OUT, Description ( "Reference to the job (may be null " + "if job completed)." )] + CIM_ResourceAllocationSettingData REF Resource + ); + }; [Provider("cmpi::Virt_ResourcePoolConfigurationService")] class KVM_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService { + + [Description ( "Create a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 CreateResourceInPool( + [IN, Description ( "String containing a representation of a " + "CIM_SettingData instance that is used to specify " + "the settings for the resource." ), + EmbeddedInstance ( "CIM_ResourceAllocationSettingData" )] + string Settings, + + [IN, Description ( "Reference to the pool to create the resources in." )] + CIM_ResourcePool REF Pool, + + [IN ( false ), OUT, Description ( "Reference to the job (may be null " + "if job completed)." )] + CIM_ResourceAllocationSettingData REF Resource + ); + }; [Provider("cmpi::Virt_ResourcePoolConfigurationService")] class LXC_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService { + + [Description ( "Create a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 CreateResourceInPool( + [IN, Description ( "String containing a representation of a " + "CIM_SettingData instance that is used to specify " + "the settings for the resource." ), + EmbeddedInstance ( "CIM_ResourceAllocationSettingData" )] + string Settings, + + [IN, Description ( "Reference to the pool to create the resources in." )] + CIM_ResourcePool REF Pool, + + [IN ( false ), OUT, Description ( "Reference to the job (may be null " + "if job completed)." )] + CIM_ResourceAllocationSettingData REF Resource + ); + }; From kaitlin at linux.vnet.ibm.com Thu Aug 6 21:59:49 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 06 Aug 2009 14:59:49 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] Add initial support for CreateResourceInPool() method In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1249595936 25200 # Node ID fc589363fb55e780942d8431f9c3559d766dcb69 # Parent 274a3daaed7a8f64d7e070ef77a59bd42951922b Add initial support for CreateResourceInPool() method This is just the stub. Additional support to follow. Signed-off-by: Kaitlin Rupert diff -r 274a3daaed7a -r fc589363fb55 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Tue Jun 16 14:25:50 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Thu Aug 06 14:58:56 2009 -0700 @@ -664,6 +664,25 @@ return s; } +static CMPIStatus create_resource_in_pool(CMPIMethodMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference, + const CMPIArgs *argsin, + CMPIArgs *argsout) +{ + uint32_t rc = CIM_SVPC_RETURN_FAILED; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + CU_DEBUG("CreateResourceInPool"); + + if (s.rc == CMPI_RC_OK) + rc = CIM_SVPC_RETURN_COMPLETED; + CMReturnData(results, &rc, CMPI_uint32); + + return s; +} + static CMPIStatus dummy_handler(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, @@ -710,12 +729,22 @@ } }; +static struct method_handler CreateResourceInPool = { + .name = "CreateResourceInPool", + .handler = create_resource_in_pool, + .args = {{"Settings", CMPI_instance, true}, + {"Pool", CMPI_ref, true}, + ARG_END + } +}; + static struct method_handler *my_handlers[] = { &CreateResourcePool, &CreateChildResourcePool, &AddResourcesToResourcePool, &RemoveResourcesFromResourcePool, &DeleteResourcePool, + &CreateResourceInPool, NULL, }; From kaitlin at linux.vnet.ibm.com Thu Aug 6 21:59:50 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 06 Aug 2009 14:59:50 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Parse parameters passed in to CreateResourceInPool In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1249595963 25200 # Node ID af509ca0e7f25db4e7ce96dff8bc77df6289e9b3 # Parent fc589363fb55e780942d8431f9c3559d766dcb69 Parse parameters passed in to CreateResourceInPool Signed-off-by: Kaitlin Rupert diff -r fc589363fb55 -r af509ca0e7f2 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Thu Aug 06 14:58:56 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Thu Aug 06 14:59:23 2009 -0700 @@ -664,6 +664,32 @@ return s; } +static CMPIStatus create_resource_parse_args(const CMPIArgs *argsin, + CMPIInstance **settings, + CMPIObjectPath **pool) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (cu_get_inst_arg(argsin, "Settings", settings) != CMPI_RC_OK) { + CU_DEBUG("Failed to get Settings arg"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing argument `Settings'"); + goto out; + } + + if (cu_get_ref_arg(argsin, "Pool", pool) != CMPI_RC_OK) { + CU_DEBUG("Failed to get Pool reference arg"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing argument `Pool'"); + goto out; + } + + out: + return s; +} + static CMPIStatus create_resource_in_pool(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, @@ -673,13 +699,21 @@ { uint32_t rc = CIM_SVPC_RETURN_FAILED; CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *settings; + CMPIObjectPath *pool; CU_DEBUG("CreateResourceInPool"); + s = create_resource_parse_args(argsin, &settings, &pool); + if (s.rc != CMPI_RC_OK) + goto out; + if (s.rc == CMPI_RC_OK) rc = CIM_SVPC_RETURN_COMPLETED; CMReturnData(results, &rc, CMPI_uint32); + out: + return s; } From kaitlin at linux.vnet.ibm.com Thu Aug 6 23:56:28 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 06 Aug 2009 16:56:28 -0700 Subject: [Libvirt-cim] [PATCH] Move get_disk_pool() to SDC Message-ID: <2cb7c25bb35e7cb7b532.1249602988@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1249602804 25200 # Node ID 2cb7c25bb35e7cb7b532ed78a43a3f27cb9fcf4f # Parent af509ca0e7f25db4e7ce96dff8bc77df6289e9b3 Move get_disk_pool() to SDC... libvirt-cim won't build with versions of libvirt that don't have disk pool support. Since only the SDC provider needs this function, move it there and place it under a #if VIR_USE_LIBVIRT_STORAGE tag to ensure it doesn't get built with older versions of libvirt. Signed-off-by: Kaitlin Rupert diff -r af509ca0e7f2 -r 2cb7c25bb35e libxkutil/pool_parsing.c --- a/libxkutil/pool_parsing.c Thu Aug 06 14:59:23 2009 -0700 +++ b/libxkutil/pool_parsing.c Thu Aug 06 16:53:24 2009 -0700 @@ -230,26 +230,6 @@ return ret; } -int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) -{ - char *xml; - int ret; - - xml = virStoragePoolGetXMLDesc(poolptr, 0); - if (xml == NULL) - return 0; - - *pool = malloc(sizeof(**pool)); - if (*pool == NULL) - return 0; - - ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); - - free(xml); - - return ret; -} - int define_pool(virConnectPtr conn, const char *xml, int res_type) { int ret = 1; diff -r af509ca0e7f2 -r 2cb7c25bb35e libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Thu Aug 06 14:59:23 2009 -0700 +++ b/libxkutil/pool_parsing.h Thu Aug 06 16:53:24 2009 -0700 @@ -67,7 +67,6 @@ void cleanup_virt_pool(struct virt_pool **pool); int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type); -int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool); int define_pool(virConnectPtr conn, const char *xml, int res_type); int destroy_pool(virConnectPtr conn, const char *name, int res_type); diff -r af509ca0e7f2 -r 2cb7c25bb35e src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Aug 06 14:59:23 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Aug 06 16:53:24 2009 -0700 @@ -1027,6 +1027,26 @@ } #if VIR_USE_LIBVIRT_STORAGE +static int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) +{ + char *xml; + int ret; + + xml = virStoragePoolGetXMLDesc(poolptr, 0); + if (xml == NULL) + return 0; + + *pool = malloc(sizeof(**pool)); + if (*pool == NULL) + return 0; + + ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); + + free(xml); + + return ret; +} + static CMPIStatus new_volume_template(const CMPIObjectPath *ref, int template_type, virStoragePoolPtr poolptr, From anantyog at linux.vnet.ibm.com Fri Aug 7 00:27:11 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Thu, 06 Aug 2009 17:27:11 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [Test] (#2) Patch to set UUID in domain In-Reply-To: References: Message-ID: <849bed1d2e467d6a2735.1249604831@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at in.ibm.com # Date 1249603785 25200 # Node ID 849bed1d2e467d6a2735e2c510ec0f40911c1554 # Parent ca99e2ff90ec82d9668f0751e201882acc0c0f16 [Test] (#2) Patch to set UUID in domain Patch enables the user to set the UUID while defining a domain Signed-off-by: Yogananth Subramanian diff -r ca99e2ff90ec -r 849bed1d2e46 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 05 03:23:04 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Thu Aug 06 17:09:45 2009 -0700 @@ -91,7 +91,7 @@ # classes to define VSSD parameters class CIM_VirtualSystemSettingData(CIMClassMOF): - def __init__(self, name, virt, bldr=None, emulator=None): + def __init__(self, name, virt, uuid=None, bldr=None, emulator=None): type = get_class_type(self.__class__.__name__) self.InstanceID = '%s:%s' % (type, name) self.Caption = self.Description = 'Virtual System' @@ -116,6 +116,9 @@ if bldr is not None: self.Bootloader = bldr + if uuid is not None: + self.UUID = uuid + class Xen_VirtualSystemSettingData(CIM_VirtualSystemSettingData): pass diff -r ca99e2ff90ec -r 849bed1d2e46 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Aug 05 03:23:04 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Aug 06 17:09:45 2009 -0700 @@ -555,7 +555,7 @@ class VirtCIM: - def __init__(self, virt, dom_name, disk_dev, disk_source, + def __init__(self, virt, dom_name, uuid, disk_dev, disk_source, net_type, net_name, net_mac, vcpus, mem, mem_allocunits, emu_type, grstype, ip, port_num, kmap, irstype, btype, vnc_passwd): @@ -563,7 +563,7 @@ self.domain_name = dom_name self.err_rc = None self.err_desc = None - self.vssd = vsms.get_vssd_mof(virt, dom_name) + self.vssd = vsms.get_vssd_mof(virt, dom_name, uuid) self.nasd = vsms.get_nasd_class(virt)(type=net_type, mac=net_mac, name=dom_name, @@ -787,6 +787,7 @@ secondary_disk_path = const.Xen_secondary_disk_path def __init__(self, test_dom=const.default_domname, + uuid=None, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -807,7 +808,7 @@ self._os(const.Xen_kernel_path, const.Xen_init_path) self._devices(disk_file_path, disk, ntype, mac, net_name) - VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, + VirtCIM.__init__(self, 'Xen', test_dom, uuid, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) @@ -852,6 +853,7 @@ secondary_disk_path = const.KVM_secondary_disk_path def __init__(self, test_dom=const.default_domname, + uuid=None, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -867,7 +869,7 @@ logger.error('Error: Disk image does not exist') sys.exit(1) VirtXML.__init__(self, 'kvm', test_dom, set_uuid(), mem, vcpus) - VirtCIM.__init__(self, 'KVM', test_dom, disk, disk_file_path, + VirtCIM.__init__(self, 'KVM', test_dom, uuid, disk, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) @@ -907,6 +909,7 @@ secondary_disk_path = const.XenFV_secondary_disk_path def __init__(self, test_dom=const.default_domname, + uuid=None, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -922,7 +925,7 @@ logger.error('Error: Disk image does not exist') sys.exit(1) VirtXML.__init__(self, 'xenfv', test_dom, set_uuid(), mem, vcpus) - VirtCIM.__init__(self, 'XenFV', test_dom, disk, disk_file_path, + VirtCIM.__init__(self, 'XenFV', test_dom, disk, uuid, disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) @@ -967,6 +970,7 @@ class LXCXML(VirtXML, VirtCIM): def __init__(self, test_dom=const.default_domname, + uuid=None, mem=const.default_memory, vcpus=const.default_vcpus, mac=const.LXC_default_mac, @@ -976,7 +980,7 @@ address="127.0.0.1", port_num='-1', keymap="en-us", irstype="mouse", btype="usb", vnc_passwd=None): VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus) - VirtCIM.__init__(self, 'LXC', test_dom, const.LXC_default_mp, + VirtCIM.__init__(self, 'LXC', test_dom, uuid, const.LXC_default_mp, const.LXC_default_source, ntype, net_name, mac, vcpus, mem, const.default_mallocunits, None, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) From anantyog at linux.vnet.ibm.com Fri Aug 7 00:27:10 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Thu, 06 Aug 2009 17:27:10 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [Test] (#2) Patch and test for user defined UUID Message-ID: Hello everyone, I like to resubmit the patch based on suggestions form Deepti Kalakeri. I would like to submit the testcse to verify duplicate UUID as a separate patch, so its not included in this patchset. Thx yogi From anantyog at linux.vnet.ibm.com Fri Aug 7 00:27:12 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Thu, 06 Aug 2009 17:27:12 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [Test] (#2) Test case to test setting UUID by user In-Reply-To: References: Message-ID: <35ae4e3e49b5a6bc0b48.1249604832@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at in.ibm.com # Date 1249604247 25200 # Node ID 35ae4e3e49b5a6bc0b48d2068ed89d0838b1ecd7 # Parent 849bed1d2e467d6a2735e2c510ec0f40911c1554 [Test] (#2) Test case to test setting UUID by user This test defines a domain with user specified UUID Signed-off-by: Yogananth Subramanian diff -r 849bed1d2e46 -r 35ae4e3e49b5 suites/libvirt-cim/cimtest/VSSD/05_set_uuid.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/05_set_uuid.py Thu Aug 06 17:17:27 2009 -0700 @@ -0,0 +1,91 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth Subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +#This test defines a domain with user specified UUID +# + +import sys +from XenKvmLib.test_doms import set_uuid +from XenKvmLib import vsms +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.const import do_main +from XenKvmLib.classes import get_typed_class +from XenKvmLib.enumclass import GetInstance + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'uuid_domain' +uuid = set_uuid() + +def get_vssd(ip, virt, get_cim_inst): + cn = get_typed_class(virt, "VirtualSystemSettingData") + inst = None + + try: + if virt == "XenFV": + virt = "Xen" + + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } + inst = GetInstance(ip, cn, key_list, get_cim_inst) + + except Exception, details: + logger.error(details) + return FAIL, inst + + if inst is None: + return FAIL, inst + + return PASS, inst + + at do_main(sup_types) +def main(): + options = main.options + + service = vsms.get_vsms_class(options.virt)(options.ip) + + cxml = vxml.get_class(options.virt)(default_dom, uuid=uuid) + ret = cxml.cim_define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + + try: + status, inst = get_vssd(options.ip, options.virt, True) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s"% + default_dom) + + if inst['UUID'] != uuid: + raise Exception(" UUID is differnet from the one set by the user") + else: + logger.info("UUID is same as the one set by the user") + + except Exception, details: + logger.error(details) + status = FAIL + + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Fri Aug 7 00:26:10 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 7 Aug 2009 10:26:10 +1000 Subject: [Libvirt-cim] Test Run Summary (Aug 07 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus Message-ID: <200908070026.n770QA8e006621@d23av03.au.ibm.com> ================================================= Test Run Summary (Aug 07 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus ================================================= Distro: Red Hat Enterprise Linux Server release 5.3 (Tikanga) Kernel: 2.6.18-128.el5xen libvirt: 0.3.3 Hypervisor: Xen 3.1.0 CIMOM: Pegasus 2.7.1 Libvirt-cim revision: 940 Libvirt-cim changeset: 8690e2eca76e Cimtest revision: Cimtest changeset: ================================================= FAIL : 90 XFAIL : 1 SKIP : 3 PASS : 71 ----------------- Total : 165 ================================================= FAIL Test Summary: ComputerSystem - 01_enum.py: FAIL ComputerSystem - 03_defineVS.py: FAIL ComputerSystem - 04_defineStartVS.py: FAIL ComputerSystem - 05_activate_defined_start.py: FAIL ComputerSystem - 06_paused_active_suspend.py: FAIL ComputerSystem - 22_define_suspend.py: FAIL ComputerSystem - 23_pause_pause.py: FAIL ComputerSystem - 32_start_reboot.py: FAIL ComputerSystem - 33_suspend_reboot.py: FAIL ComputerSystem - 35_start_reset.py: FAIL ComputerSystem - 40_RSC_start.py: FAIL ComputerSystem - 42_cs_gi_errs.py: FAIL ComputerSystemIndication - 01_created_indication.py: FAIL ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: FAIL ElementAllocatedFromPool - 01_forward.py: FAIL ElementAllocatedFromPool - 02_reverse.py: FAIL ElementAllocatedFromPool - 03_reverse_errs.py: FAIL ElementAllocatedFromPool - 04_forward_errs.py: FAIL ElementCapabilities - 01_forward.py: FAIL ElementCapabilities - 02_reverse.py: FAIL ElementConforms - 01_forward.py: FAIL ElementConforms - 04_ectp_rev_errs.py: FAIL ElementSettingData - 03_esd_assoc_with_rasd_errs.py: FAIL EnabledLogicalElementCapabilities - 01_enum.py: FAIL EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: FAIL HostSystem - 02_hostsystem_to_rasd.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL HostedAccessPoint - 01_forward.py: FAIL HostedAccessPoint - 02_reverse.py: FAIL HostedDependency - 02_reverse.py: FAIL HostedDependency - 03_enabledstate.py: FAIL HostedDependency - 04_reverse_errs.py: FAIL LogicalDisk - 01_disk.py: FAIL LogicalDisk - 02_nodevs.py: FAIL LogicalDisk - 03_ld_gi_errs.py: FAIL Memory - 01_memory.py: FAIL Memory - 03_mem_gi_errs.py: FAIL NetworkPort - 02_np_gi_errors.py: FAIL Processor - 01_processor.py: FAIL Processor - 02_definesys_get_procs.py: FAIL Processor - 03_proc_gi_errs.py: FAIL Profile - 02_profile_to_elec.py: FAIL RASD - 01_verify_rasd_fields.py: FAIL RASD - 02_enum.py: FAIL RASD - 04_disk_rasd_size.py: FAIL RASD - 05_disk_rasd_emu_type.py: FAIL ResourceAllocationFromPool - 01_forward.py: FAIL ResourceAllocationFromPool - 02_reverse.py: FAIL ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL ResourcePoolConfigurationService - 09_DeleteDiskPool.py: FAIL ServiceAccessBySAP - 01_forward.py: FAIL ServiceAccessBySAP - 02_reverse.py: FAIL ServiceAffectsElement - 01_forward.py: FAIL ServiceAffectsElement - 02_reverse.py: FAIL SettingsDefine - 01_forward.py: FAIL SettingsDefine - 02_reverse.py: FAIL SettingsDefine - 03_sds_fwd_errs.py: FAIL SettingsDefine - 04_sds_rev_errs.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL SystemDevice - 01_forward.py: FAIL SystemDevice - 02_reverse.py: FAIL SystemDevice - 03_fwderrs.py: FAIL VSSD - 01_enum.py: FAIL VSSD - 03_vssd_gi_errs.py: FAIL VSSD - 04_vssd_to_rasd.py: FAIL VirtualSystemManagementService - 01_definesystem_name.py: FAIL VirtualSystemManagementService - 02_destroysystem.py: FAIL VirtualSystemManagementService - 06_addresource.py: FAIL VirtualSystemManagementService - 08_modifyresource.py: FAIL VirtualSystemManagementService - 09_procrasd_persist.py: FAIL VirtualSystemManagementService - 12_referenced_config.py: FAIL VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL VirtualSystemManagementService - 15_mod_system_settings.py: FAIL VirtualSystemManagementService - 17_removeresource_neg.py: FAIL VirtualSystemManagementService - 18_define_sys_bridge.py: FAIL VirtualSystemManagementService - 19_definenetwork_ers.py: FAIL VirtualSystemManagementService - 20_verify_vnc_password.py: FAIL VirtualSystemManagementService - 21_createVS_verifyMAC.py: FAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: FAIL VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: FAIL VirtualSystemMigrationService - 01_migratable_host.py: FAIL VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL VirtualSystemSettingDataComponent - 02_reverse.py: FAIL VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: FAIL VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL ================================================= XFAIL Test Summary: VirtualSystemManagementService - 16_removeresource.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP NetworkPort - 03_user_netport.py: SKIP ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: FAIL ERROR - Provider does not report system `error', but virsh does ERROR - Provider does not report system `Domain-0', but virsh does ERROR - Provider does not report system `dom_migrate', but virsh does CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: SKIP -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: FAIL ERROR - Failed to enumerate the class of Xen_ComputerSystem ERROR - Exception: No cs instance returned ERROR - Error: property values are not set for VS domU1 CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to Start the dom: domguest ERROR - Property values not set properly for domguest InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - ERROR: VS 'DomST1' was not defined InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Exception variable: VS 'DomST1' was not defined InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Error: Unable to define domgst InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Exception: 'Unable start dom 'cs_test_domain'' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Exception: Failed to define the guest: cs_test_domain ERROR - Got CIM error CIM_ERR_NOT_FOUND: Referenced domain `cs_test_domain' does not exist: Domain not found: xenUnifiedDomainLookupByName with return code 6 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Referenced domain `cs_test_domain' does not exist: Domain not found: xenUnifiedDomainLookupByName -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Exception: Failed to define the guest: test_domain ERROR - Got CIM error CIM_ERR_NOT_FOUND: Unable to retrieve domain name: Error 0 with return code 6 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Unable to retrieve domain name: Error 0 -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Exception: Unable start dom 'cs_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Exception: Unable start dom 'cs_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: FAIL CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Exception: Unable to generate indication ERROR - Failed to start domain: domU ERROR - Exception: Unable to generate indication ERROR - Got CIM error CIM_ERR_NOT_FOUND: Referenced domain `domU' does not exist: Domain not found: xenUnifiedDomainLookupByName with return code 6 ERROR - Unable to destroy domU ERROR - Exception: Unable to generate indication InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses CIM_ERR_NOT_FOUND: Referenced domain `domU' does not exist: Domain not found: xenUnifiedDomainLookupByName InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Referenced domain `domU' does not exist: Domain not found: xenUnifiedDomainLookupByName -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: FAIL -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to start the dom: 'hd_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: 'eafp_domain' InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: hd_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 ERROR - Failed to define the dom: hd_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: FAIL ERROR - IndexError : list index out of range Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 139, in do_try File "01_forward.py", line 138, in main if elec[0].classname != cn: IndexError: list index out of range ERROR - None CIM_ERR_INVALID_CLASS: Linux_ComputerSystem CIM_ERR_NOT_FOUND: Referenced domain `error' does not exist: Domain not found: xenUnifiedDomainLookupByName -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: dom_elecap CIM_ERR_INVALID_CLASS: Linux_ComputerSystem InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: FAIL ERROR - Unable to start domain domU -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Unable to define domain domU InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to start the dom: hd_domain1 InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: FAIL ERROR - Failed to enumerate the class of Xen_EnabledLogicalElementCapabilities -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to Start the dom: qemu InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: FAIL ERROR - Xen_HostedDependency returned 0 Xen_ComputerSystem objects CIM_ERR_INVALID_CLASS: Linux_ComputerSystem CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - Xen_SettingsDefineCapabilities returned 16 RASD objects instead of 20 for DiskPool/cimtest-diskpool CIM_ERR_INVALID_CLASS: Linux_ComputerSystem -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable start dom 'domu1' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable start dom 'domu1' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: hd_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: hd_domain1 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to start the dom: hd_domain1 InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - AttributeError : 'NoneType' object has no attribute 'Name' Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 139, in do_try File "01_disk.py", line 60, in main if dev.Name != test_dev: AttributeError: 'NoneType' object has no attribute 'Name' ERROR - None InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses CIM_ERR_NOT_FOUND: No such instance (no domain for test_domain/xvda): Domain not found: xenUnifiedDomainLookupByName -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: FAIL ERROR - Xen_LogicalDisk returned 1 instead of empty list CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to Define the dom: hd_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- Memory - 01_memory.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - AttributeError : 'NoneType' object has no attribute 'ConsumableBlocks' Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 139, in do_try File "01_memory.py", line 59, in main if dev.ConsumableBlocks > dev.NumberOfBlocks: AttributeError: 'NoneType' object has no attribute 'ConsumableBlocks' ERROR - None InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses CIM_ERR_NOT_FOUND: No such instance (no domain for test_domain/mem): Domain not found: xenUnifiedDomainLookupByName -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to Create the dom: domU InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Define domain failed! InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: SKIP -------------------------------------------------------------------- Processor - 01_processor.py: FAIL ERROR - Domain not started, we're not able to check vcpu -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Exception: Failed to define the guest: test_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the guest: proc_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: FAIL ERROR - Xen_ComputerSystem with domguest was not returned -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable to start the domain VSSDC_dom InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- RASD - 02_enum.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 ERROR - Failed to Define the domain: VSSDC_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to test RASD: Failed to define the dom: diskrasd_test InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to call DefineSystem() InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: FAIL ERROR - No RASD associated with NetworkPool/cimtest-networkpool -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to Define the domain: RAFP_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL ERROR - Exception in create_pool() ERROR - Exception details: (1, u'CIM_ERR_FAILED: Pool with that name already exists') ERROR - Error in networkpool creation InvokeMethod(CreateChildResourcePool): CIM_ERR_FAILED: Pool with that name already exists -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: SKIP -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: FAIL ERROR - Exception in create_pool() ERROR - Exception details: (1, u'CIM_ERR_FAILED: Settings Error: Storage pool creation not supported in this version of libvirt') ERROR - Failed to create diskpool 'dp_pool' InvokeMethod(CreateChildResourcePool): CIM_ERR_FAILED: Settings Error: Storage pool creation not supported in this version of libvirt -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable start dom 'domu1' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable start dom 'domu1' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: SAE_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: SAE_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- SettingsDefine - 01_forward.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to Create the dom: domu1 ERROR - NameError : global name 'cmxl' is not defined Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 139, in do_try File "01_forward.py", line 144, in main status, cxml = setup_env(options.ip, options.virt) File "01_forward.py", line 58, in setup_env return FAIL, cmxl NameError: global name 'cmxl' is not defined ERROR - None InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable start dom 'virtgst' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to start the dom: domu1 InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: domu1 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: FAIL ERROR - Xen_SettingsDefineCapabilities returned 16 ResourcePool objects instead of 20 -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable to start domain test_domain InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- SystemDevice - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Unable to define domain test_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the domain 'virt1' InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VSSD - 01_enum.py: FAIL ERROR - Missing VSSD instance for the system VSSD_dom CIM_ERR_FAILED: Unable to get VSSD instance from Domain -------------------------------------------------------------------- VSSD - 02_bootldr.py: PASS -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - error while define of VS InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 ERROR - Failed to Define the domain: VSSDC_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to start the defined domain: test_domain InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: FAIL ERROR - Failed to start the dom: test_domain -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: rstest_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: FAIL ERROR - Failed to start the dom: rstest_domain -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Unable to define procrasd_persist_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable to start rstest_domain ERROR - Unable to start rstest_domain InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.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 define domain rstest_domain2 ERROR - Unable to define rstest_domain2 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: rstest_domain ERROR - Got CIM error CIM_ERR_NOT_FOUND: Unable to retrieve domain name: Error 0 with return code 6 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Unable to retrieve domain name: Error 0 -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:xen CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:xen) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to start the dom: brgtest_domain InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Got desc: 'CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses', exp 'Valid param ' ERROR - Defing domain with invalid network name None gave unexpected rc code 1 and description: CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to start the dom: vncpasswd_domain ERROR - Got CIM error CIM_ERR_NOT_FOUND: Referenced domain `vncpasswd_domain' does not exist: Domain not found: xenUnifiedDomainLookupByName with return code 6 InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Referenced domain `vncpasswd_domain' does not exist: Domain not found: xenUnifiedDomainLookupByName -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Exception details: Failed to start the defined domain: dom_mac_notspecified InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - global name 'default_dom' is not defined InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Got desc: 'CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.')', exp 'Conflicting MAC Addresses' ERROR - Got unexpected rc code 1 and description CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: FAIL ERROR - Error create domain dom_migrate -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Failed to lookup resulting system with return code 1 ERROR - CS instance not returned for dom_migrate. ERROR - Error start domain dom_migrate InvokeMethod(DefineSystem): CIM_ERR_FAILED: Failed to lookup resulting system CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Error start domain dom_migration InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Error define domain VM_frm_elm3b43.beaverton.ibm.com ERROR - Error setting up the guest InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Error define domain VM_frm_elm3b43.beaverton.ibm.com ERROR - Error setting up the guest InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Error to start domain VM_frm_elm3b43.beaverton.ibm.com ERROR - Error setting up the guest InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Failed to start the dom: VSSDC_dom InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Unable to define domain domu1 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable to start domain domu1 InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Exception: Failed to start the defined domain: snapshot_vm ERROR - Failed to remove snapshot file for snapshot_vm InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- From kaitlin at linux.vnet.ibm.com Fri Aug 7 04:43:26 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 06 Aug 2009 21:43:26 -0700 Subject: [Libvirt-cim] Test Run Summary (Aug 07 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus In-Reply-To: <200908070026.n770QA8e006621@d23av03.au.ibm.com> References: <200908070026.n770QA8e006621@d23av03.au.ibm.com> Message-ID: <4A7BB0EE.5030201@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > ================================================= > Test Run Summary (Aug 07 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus > ================================================= > Distro: Red Hat Enterprise Linux Server release 5.3 (Tikanga) > Kernel: 2.6.18-128.el5xen > libvirt: 0.3.3 > Hypervisor: Xen 3.1.0 > CIMOM: Pegasus 2.7.1 > Libvirt-cim revision: 940 > Libvirt-cim changeset: 8690e2eca76e > Cimtest revision: > Cimtest changeset: > ================================================= > FAIL : 90 There appears to be a setup issue on this system. Please ignore this test run. I'll send a new run tomorrow. > XFAIL : 1 > SKIP : 3 > PASS : 71 > ----------------- > Total : 165 > ================================================= > FAIL Test Summary: > ComputerSystem - 01_enum.py: FAIL > ComputerSystem - 03_defineVS.py: FAIL > ComputerSystem - 04_defineStartVS.py: FAIL > ComputerSystem - 05_activate_defined_start.py: FAIL > ComputerSystem - 06_paused_active_suspend.py: FAIL > ComputerSystem - 22_define_suspend.py: FAIL > ComputerSystem - 23_pause_pause.py: FAIL > ComputerSystem - 32_start_reboot.py: FAIL > ComputerSystem - 33_suspend_reboot.py: FAIL > ComputerSystem - 35_start_reset.py: FAIL > ComputerSystem - 40_RSC_start.py: FAIL > ComputerSystem - 42_cs_gi_errs.py: FAIL > ComputerSystemIndication - 01_created_indication.py: FAIL > ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: FAIL > ElementAllocatedFromPool - 01_forward.py: FAIL > ElementAllocatedFromPool - 02_reverse.py: FAIL > ElementAllocatedFromPool - 03_reverse_errs.py: FAIL > ElementAllocatedFromPool - 04_forward_errs.py: FAIL > ElementCapabilities - 01_forward.py: FAIL > ElementCapabilities - 02_reverse.py: FAIL > ElementConforms - 01_forward.py: FAIL > ElementConforms - 04_ectp_rev_errs.py: FAIL > ElementSettingData - 03_esd_assoc_with_rasd_errs.py: FAIL > EnabledLogicalElementCapabilities - 01_enum.py: FAIL > EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: FAIL > HostSystem - 02_hostsystem_to_rasd.py: FAIL > HostSystem - 03_hs_to_settdefcap.py: FAIL > HostedAccessPoint - 01_forward.py: FAIL > HostedAccessPoint - 02_reverse.py: FAIL > HostedDependency - 02_reverse.py: FAIL > HostedDependency - 03_enabledstate.py: FAIL > HostedDependency - 04_reverse_errs.py: FAIL > LogicalDisk - 01_disk.py: FAIL > LogicalDisk - 02_nodevs.py: FAIL > LogicalDisk - 03_ld_gi_errs.py: FAIL > Memory - 01_memory.py: FAIL > Memory - 03_mem_gi_errs.py: FAIL > NetworkPort - 02_np_gi_errors.py: FAIL > Processor - 01_processor.py: FAIL > Processor - 02_definesys_get_procs.py: FAIL > Processor - 03_proc_gi_errs.py: FAIL > Profile - 02_profile_to_elec.py: FAIL > RASD - 01_verify_rasd_fields.py: FAIL > RASD - 02_enum.py: FAIL > RASD - 04_disk_rasd_size.py: FAIL > RASD - 05_disk_rasd_emu_type.py: FAIL > ResourceAllocationFromPool - 01_forward.py: FAIL > ResourceAllocationFromPool - 02_reverse.py: FAIL > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL > ResourcePoolConfigurationService - 09_DeleteDiskPool.py: FAIL > ServiceAccessBySAP - 01_forward.py: FAIL > ServiceAccessBySAP - 02_reverse.py: FAIL > ServiceAffectsElement - 01_forward.py: FAIL > ServiceAffectsElement - 02_reverse.py: FAIL > SettingsDefine - 01_forward.py: FAIL > SettingsDefine - 02_reverse.py: FAIL > SettingsDefine - 03_sds_fwd_errs.py: FAIL > SettingsDefine - 04_sds_rev_errs.py: FAIL > SettingsDefineCapabilities - 01_forward.py: FAIL > SystemDevice - 01_forward.py: FAIL > SystemDevice - 02_reverse.py: FAIL > SystemDevice - 03_fwderrs.py: FAIL > VSSD - 01_enum.py: FAIL > VSSD - 03_vssd_gi_errs.py: FAIL > VSSD - 04_vssd_to_rasd.py: FAIL > VirtualSystemManagementService - 01_definesystem_name.py: FAIL > VirtualSystemManagementService - 02_destroysystem.py: FAIL > VirtualSystemManagementService - 06_addresource.py: FAIL > VirtualSystemManagementService - 08_modifyresource.py: FAIL > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > VirtualSystemManagementService - 12_referenced_config.py: FAIL > VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL > VirtualSystemManagementService - 15_mod_system_settings.py: FAIL > VirtualSystemManagementService - 17_removeresource_neg.py: FAIL > VirtualSystemManagementService - 18_define_sys_bridge.py: FAIL > VirtualSystemManagementService - 19_definenetwork_ers.py: FAIL > VirtualSystemManagementService - 20_verify_vnc_password.py: FAIL > VirtualSystemManagementService - 21_createVS_verifyMAC.py: FAIL > VirtualSystemManagementService - 22_addmulti_brg_interface.py: FAIL > VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: FAIL > VirtualSystemMigrationService - 01_migratable_host.py: FAIL > VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL > VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL > VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL > VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL > VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL > VirtualSystemSettingDataComponent - 02_reverse.py: FAIL > VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: FAIL > VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL > VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL > > ================================================= > XFAIL Test Summary: > VirtualSystemManagementService - 16_removeresource.py: XFAIL > > ================================================= > SKIP Test Summary: > ComputerSystem - 02_nosystems.py: SKIP > NetworkPort - 03_user_netport.py: SKIP > ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: SKIP > > ================================================= > Full report: > -------------------------------------------------------------------- > AllocationCapabilities - 01_enum.py: PASS > -------------------------------------------------------------------- > AllocationCapabilities - 02_alloccap_gi_errs.py: PASS > -------------------------------------------------------------------- > ComputerSystem - 01_enum.py: FAIL > ERROR - Provider does not report system `error', but virsh does > ERROR - Provider does not report system `Domain-0', but virsh does > ERROR - Provider does not report system `dom_migrate', but virsh does > CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id > -------------------------------------------------------------------- > ComputerSystem - 02_nosystems.py: SKIP > -------------------------------------------------------------------- > ComputerSystem - 03_defineVS.py: FAIL > ERROR - Failed to enumerate the class of Xen_ComputerSystem > ERROR - Exception: No cs instance returned > ERROR - Error: property values are not set for VS domU1 > CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id > -------------------------------------------------------------------- > ComputerSystem - 04_defineStartVS.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to Start the dom: domguest > ERROR - Property values not set properly for domguest > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > ComputerSystem - 05_activate_defined_start.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - ERROR: VS 'DomST1' was not defined > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ComputerSystem - 06_paused_active_suspend.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Exception variable: VS 'DomST1' was not defined > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ComputerSystem - 22_define_suspend.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Error: Unable to define domgst > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ComputerSystem - 23_pause_pause.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Exception: 'Unable start dom 'cs_test_domain'' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > ComputerSystem - 27_define_pause_errs.py: PASS > -------------------------------------------------------------------- > ComputerSystem - 32_start_reboot.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Exception: Failed to define the guest: cs_test_domain > ERROR - Got CIM error CIM_ERR_NOT_FOUND: Referenced domain `cs_test_domain' does not exist: Domain not found: xenUnifiedDomainLookupByName with return code 6 > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Referenced domain `cs_test_domain' does not exist: Domain not found: xenUnifiedDomainLookupByName > -------------------------------------------------------------------- > ComputerSystem - 33_suspend_reboot.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Exception: Failed to define the guest: test_domain > ERROR - Got CIM error CIM_ERR_NOT_FOUND: Unable to retrieve domain name: Error 0 with return code 6 > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Unable to retrieve domain name: Error 0 > -------------------------------------------------------------------- > ComputerSystem - 35_start_reset.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Exception: Unable start dom 'cs_test_domain' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > ComputerSystem - 40_RSC_start.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Exception: Unable start dom 'cs_test_domain' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > ComputerSystem - 41_cs_to_settingdefinestate.py: PASS > -------------------------------------------------------------------- > ComputerSystem - 42_cs_gi_errs.py: FAIL > CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id > -------------------------------------------------------------------- > ComputerSystemIndication - 01_created_indication.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Exception: Unable to generate indication > ERROR - Failed to start domain: domU > ERROR - Exception: Unable to generate indication > ERROR - Got CIM error CIM_ERR_NOT_FOUND: Referenced domain `domU' does not exist: Domain not found: xenUnifiedDomainLookupByName with return code 6 > ERROR - Unable to destroy domU > ERROR - Exception: Unable to generate indication > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > CIM_ERR_NOT_FOUND: Referenced domain `domU' does not exist: Domain not found: xenUnifiedDomainLookupByName > InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Referenced domain `domU' does not exist: Domain not found: xenUnifiedDomainLookupByName > -------------------------------------------------------------------- > ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: FAIL > -------------------------------------------------------------------- > ElementAllocatedFromPool - 01_forward.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to start the dom: 'hd_domain' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > ElementAllocatedFromPool - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: 'eafp_domain' > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ElementAllocatedFromPool - 03_reverse_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: hd_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ElementAllocatedFromPool - 04_forward_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 > ERROR - Failed to define the dom: hd_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified > -------------------------------------------------------------------- > ElementCapabilities - 01_forward.py: FAIL > ERROR - IndexError : list index out of range > Traceback (most recent call last): > File "./lib/XenKvmLib/const.py", line 139, in do_try > File "01_forward.py", line 138, in main > if elec[0].classname != cn: > IndexError: list index out of range > ERROR - None > CIM_ERR_INVALID_CLASS: Linux_ComputerSystem > CIM_ERR_NOT_FOUND: Referenced domain `error' does not exist: Domain not found: xenUnifiedDomainLookupByName > -------------------------------------------------------------------- > ElementCapabilities - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: dom_elecap > CIM_ERR_INVALID_CLASS: Linux_ComputerSystem > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ElementCapabilities - 03_forward_errs.py: PASS > -------------------------------------------------------------------- > ElementCapabilities - 04_reverse_errs.py: PASS > -------------------------------------------------------------------- > ElementCapabilities - 05_hostsystem_cap.py: PASS > -------------------------------------------------------------------- > ElementConforms - 01_forward.py: FAIL > ERROR - Unable to start domain domU > -------------------------------------------------------------------- > ElementConforms - 02_reverse.py: PASS > -------------------------------------------------------------------- > ElementConforms - 03_ectp_fwd_errs.py: PASS > -------------------------------------------------------------------- > ElementConforms - 04_ectp_rev_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Unable to define domain domU > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ElementSettingData - 01_forward.py: PASS > -------------------------------------------------------------------- > ElementSettingData - 03_esd_assoc_with_rasd_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to start the dom: hd_domain1 > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > EnabledLogicalElementCapabilities - 01_enum.py: FAIL > ERROR - Failed to enumerate the class of Xen_EnabledLogicalElementCapabilities > -------------------------------------------------------------------- > EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to Start the dom: qemu > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > HostSystem - 01_enum.py: PASS > -------------------------------------------------------------------- > HostSystem - 02_hostsystem_to_rasd.py: FAIL > ERROR - Xen_HostedDependency returned 0 Xen_ComputerSystem objects > CIM_ERR_INVALID_CLASS: Linux_ComputerSystem > CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id > -------------------------------------------------------------------- > HostSystem - 03_hs_to_settdefcap.py: FAIL > ERROR - Xen_SettingsDefineCapabilities returned 16 RASD objects instead of 20 for DiskPool/cimtest-diskpool > CIM_ERR_INVALID_CLASS: Linux_ComputerSystem > -------------------------------------------------------------------- > HostSystem - 04_hs_to_EAPF.py: PASS > -------------------------------------------------------------------- > HostSystem - 05_hs_gi_errs.py: PASS > -------------------------------------------------------------------- > HostSystem - 06_hs_to_vsms.py: PASS > -------------------------------------------------------------------- > HostedAccessPoint - 01_forward.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable start dom 'domu1' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > HostedAccessPoint - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable start dom 'domu1' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > HostedDependency - 01_forward.py: PASS > -------------------------------------------------------------------- > HostedDependency - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: hd_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > HostedDependency - 03_enabledstate.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: hd_domain1 > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > HostedDependency - 04_reverse_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to start the dom: hd_domain1 > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > HostedResourcePool - 01_forward.py: PASS > -------------------------------------------------------------------- > HostedResourcePool - 02_reverse.py: PASS > -------------------------------------------------------------------- > HostedResourcePool - 03_forward_errs.py: PASS > -------------------------------------------------------------------- > HostedResourcePool - 04_reverse_errs.py: PASS > -------------------------------------------------------------------- > HostedService - 01_forward.py: PASS > -------------------------------------------------------------------- > HostedService - 02_reverse.py: PASS > -------------------------------------------------------------------- > HostedService - 03_forward_errs.py: PASS > -------------------------------------------------------------------- > HostedService - 04_reverse_errs.py: PASS > -------------------------------------------------------------------- > KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS > -------------------------------------------------------------------- > LogicalDisk - 01_disk.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - AttributeError : 'NoneType' object has no attribute 'Name' > Traceback (most recent call last): > File "./lib/XenKvmLib/const.py", line 139, in do_try > File "01_disk.py", line 60, in main > if dev.Name != test_dev: > AttributeError: 'NoneType' object has no attribute 'Name' > ERROR - None > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > CIM_ERR_NOT_FOUND: No such instance (no domain for test_domain/xvda): Domain not found: xenUnifiedDomainLookupByName > -------------------------------------------------------------------- > LogicalDisk - 02_nodevs.py: FAIL > ERROR - Xen_LogicalDisk returned 1 instead of empty list > CIM_ERR_FAILED: Unable to get domain information: internal error domain information incomplete, missing id > -------------------------------------------------------------------- > LogicalDisk - 03_ld_gi_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to Define the dom: hd_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > Memory - 01_memory.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - AttributeError : 'NoneType' object has no attribute 'ConsumableBlocks' > Traceback (most recent call last): > File "./lib/XenKvmLib/const.py", line 139, in do_try > File "01_memory.py", line 59, in main > if dev.ConsumableBlocks > dev.NumberOfBlocks: > AttributeError: 'NoneType' object has no attribute 'ConsumableBlocks' > ERROR - None > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > CIM_ERR_NOT_FOUND: No such instance (no domain for test_domain/mem): Domain not found: xenUnifiedDomainLookupByName > -------------------------------------------------------------------- > Memory - 02_defgetmem.py: PASS > -------------------------------------------------------------------- > Memory - 03_mem_gi_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to Create the dom: domU > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > NetworkPort - 01_netport.py: PASS > -------------------------------------------------------------------- > NetworkPort - 02_np_gi_errors.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Define domain failed! > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > NetworkPort - 03_user_netport.py: SKIP > -------------------------------------------------------------------- > Processor - 01_processor.py: FAIL > ERROR - Domain not started, we're not able to check vcpu > -------------------------------------------------------------------- > Processor - 02_definesys_get_procs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Exception: Failed to define the guest: test_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > Processor - 03_proc_gi_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the guest: proc_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > Profile - 01_enum.py: PASS > -------------------------------------------------------------------- > Profile - 02_profile_to_elec.py: FAIL > ERROR - Xen_ComputerSystem with domguest was not returned > -------------------------------------------------------------------- > Profile - 03_rprofile_gi_errs.py: PASS > -------------------------------------------------------------------- > RASD - 01_verify_rasd_fields.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable to start the domain VSSDC_dom > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > RASD - 02_enum.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 > ERROR - Failed to Define the domain: VSSDC_dom > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified > -------------------------------------------------------------------- > RASD - 03_rasd_errs.py: PASS > -------------------------------------------------------------------- > RASD - 04_disk_rasd_size.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to test RASD: Failed to define the dom: diskrasd_test > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > RASD - 05_disk_rasd_emu_type.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to call DefineSystem() > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > RASD - 06_parent_net_pool.py: PASS > -------------------------------------------------------------------- > RASD - 07_parent_disk_pool.py: PASS > -------------------------------------------------------------------- > RedirectionService - 01_enum_crs.py: PASS > -------------------------------------------------------------------- > RedirectionService - 02_enum_crscap.py: PASS > -------------------------------------------------------------------- > RedirectionService - 03_RedirectionSAP_errs.py: PASS > -------------------------------------------------------------------- > ReferencedProfile - 01_verify_refprof.py: PASS > -------------------------------------------------------------------- > ReferencedProfile - 02_refprofile_errs.py: PASS > -------------------------------------------------------------------- > ResourceAllocationFromPool - 01_forward.py: FAIL > ERROR - No RASD associated with NetworkPool/cimtest-networkpool > -------------------------------------------------------------------- > ResourceAllocationFromPool - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to Define the domain: RAFP_dom > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ResourceAllocationFromPool - 03_forward_errs.py: PASS > -------------------------------------------------------------------- > ResourceAllocationFromPool - 04_reverse_errs.py: PASS > -------------------------------------------------------------------- > ResourceAllocationFromPool - 05_RAPF_err.py: PASS > -------------------------------------------------------------------- > ResourcePool - 01_enum.py: PASS > -------------------------------------------------------------------- > ResourcePool - 02_rp_gi_errors.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationCapabilities - 01_enum.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 01_enum.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL > ERROR - Exception in create_pool() > ERROR - Exception details: (1, u'CIM_ERR_FAILED: Pool with that name already exists') > ERROR - Error in networkpool creation > InvokeMethod(CreateChildResourcePool): CIM_ERR_FAILED: Pool with that name already exists > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: SKIP > -------------------------------------------------------------------- > ResourcePoolConfigurationService - 09_DeleteDiskPool.py: FAIL > ERROR - Exception in create_pool() > ERROR - Exception details: (1, u'CIM_ERR_FAILED: Settings Error: Storage pool creation not supported in this version of libvirt') > ERROR - Failed to create diskpool 'dp_pool' > InvokeMethod(CreateChildResourcePool): CIM_ERR_FAILED: Settings Error: Storage pool creation not supported in this version of libvirt > -------------------------------------------------------------------- > ServiceAccessBySAP - 01_forward.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable start dom 'domu1' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > ServiceAccessBySAP - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable start dom 'domu1' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > ServiceAffectsElement - 01_forward.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: SAE_dom > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > ServiceAffectsElement - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: SAE_dom > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > SettingsDefine - 01_forward.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to Create the dom: domu1 > ERROR - NameError : global name 'cmxl' is not defined > Traceback (most recent call last): > File "./lib/XenKvmLib/const.py", line 139, in do_try > File "01_forward.py", line 144, in main > status, cxml = setup_env(options.ip, options.virt) > File "01_forward.py", line 58, in setup_env > return FAIL, cmxl > NameError: global name 'cmxl' is not defined > ERROR - None > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > SettingsDefine - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable start dom 'virtgst' > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > SettingsDefine - 03_sds_fwd_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to start the dom: domu1 > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > SettingsDefine - 04_sds_rev_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: domu1 > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > SettingsDefineCapabilities - 01_forward.py: FAIL > ERROR - Xen_SettingsDefineCapabilities returned 16 ResourcePool objects instead of 20 > -------------------------------------------------------------------- > SettingsDefineCapabilities - 03_forward_errs.py: PASS > -------------------------------------------------------------------- > SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS > -------------------------------------------------------------------- > SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS > -------------------------------------------------------------------- > SystemDevice - 01_forward.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable to start domain test_domain > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > SystemDevice - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Unable to define domain test_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > SystemDevice - 03_fwderrs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the domain 'virt1' > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VSSD - 01_enum.py: FAIL > ERROR - Missing VSSD instance for the system VSSD_dom > CIM_ERR_FAILED: Unable to get VSSD instance from Domain > -------------------------------------------------------------------- > VSSD - 02_bootldr.py: PASS > -------------------------------------------------------------------- > VSSD - 03_vssd_gi_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - error while define of VS > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VSSD - 04_vssd_to_rasd.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 > ERROR - Failed to Define the domain: VSSDC_dom > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified > -------------------------------------------------------------------- > VirtualSystemManagementCapabilities - 01_enum.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementService - 01_definesystem_name.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to start the defined domain: test_domain > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemManagementService - 02_destroysystem.py: FAIL > ERROR - Failed to start the dom: test_domain > -------------------------------------------------------------------- > VirtualSystemManagementService - 03_definesystem_ess.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementService - 04_definesystem_ers.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementService - 05_destroysystem_neg.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementService - 06_addresource.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: rstest_domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VirtualSystemManagementService - 07_addresource_neg.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementService - 08_modifyresource.py: FAIL > ERROR - Failed to start the dom: rstest_domain > -------------------------------------------------------------------- > VirtualSystemManagementService - 09_procrasd_persist.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Unable to define procrasd_persist_dom > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VirtualSystemManagementService - 10_hv_version.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementService - 11_define_memrasdunits.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementService - 12_referenced_config.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable to start rstest_domain > ERROR - Unable to start rstest_domain > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemManagementService - 13_refconfig_additional_devs.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 define domain rstest_domain2 > ERROR - Unable to define rstest_domain2 > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest > -------------------------------------------------------------------- > VirtualSystemManagementService - 14_define_sys_disk.py: PASS > -------------------------------------------------------------------- > VirtualSystemManagementService - 15_mod_system_settings.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: rstest_domain > ERROR - Got CIM error CIM_ERR_NOT_FOUND: Unable to retrieve domain name: Error 0 with return code 6 > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Unable to retrieve domain name: Error 0 > -------------------------------------------------------------------- > VirtualSystemManagementService - 16_removeresource.py: XFAIL > ERROR - 0 RASD insts for domain/mouse:xen > CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:xen) > Bug:<00014> > -------------------------------------------------------------------- > VirtualSystemManagementService - 17_removeresource_neg.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Failed to define the dom: domain > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VirtualSystemManagementService - 18_define_sys_bridge.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to start the dom: brgtest_domain > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemManagementService - 19_definenetwork_ers.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Got desc: 'CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses', exp 'Valid param ' > ERROR - Defing domain with invalid network name None gave unexpected rc code 1 and description: > CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VirtualSystemManagementService - 20_verify_vnc_password.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to start the dom: vncpasswd_domain > ERROR - Got CIM error CIM_ERR_NOT_FOUND: Referenced domain `vncpasswd_domain' does not exist: Domain not found: xenUnifiedDomainLookupByName with return code 6 > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Referenced domain `vncpasswd_domain' does not exist: Domain not found: xenUnifiedDomainLookupByName > -------------------------------------------------------------------- > VirtualSystemManagementService - 21_createVS_verifyMAC.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Exception details: Failed to start the defined domain: dom_mac_notspecified > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemManagementService - 22_addmulti_brg_interface.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - global name 'default_dom' is not defined > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Got desc: 'CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.')', exp 'Conflicting MAC Addresses' > ERROR - Got unexpected rc code 1 and description CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemMigrationCapabilities - 01_enum.py: PASS > -------------------------------------------------------------------- > VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS > -------------------------------------------------------------------- > VirtualSystemMigrationService - 01_migratable_host.py: FAIL > ERROR - Error create domain dom_migrate > -------------------------------------------------------------------- > VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Failed to lookup resulting system with return code 1 > ERROR - CS instance not returned for dom_migrate. > ERROR - Error start domain dom_migrate > InvokeMethod(DefineSystem): CIM_ERR_FAILED: Failed to lookup resulting system > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > CIM_ERR_NOT_FOUND: Referenced domain `dom_migrate' does not exist: invalid argument in __virGetDomain > -------------------------------------------------------------------- > VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Error start domain dom_migration > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Error define domain VM_frm_elm3b43.beaverton.ibm.com > ERROR - Error setting up the guest > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Error define domain VM_frm_elm3b43.beaverton.ibm.com > ERROR - Error setting up the guest > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Error to start domain VM_frm_elm3b43.beaverton.ibm.com > ERROR - Error setting up the guest > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemMigrationSettingData - 01_enum.py: PASS > -------------------------------------------------------------------- > VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS > -------------------------------------------------------------------- > VirtualSystemSettingDataComponent - 01_forward.py: PASS > -------------------------------------------------------------------- > VirtualSystemSettingDataComponent - 02_reverse.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Failed to start the dom: VSSDC_dom > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51728 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 > ERROR - Unable to define domain domu1 > InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses > -------------------------------------------------------------------- > VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Unable to start domain domu1 > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemSnapshotService - 01_enum.py: PASS > -------------------------------------------------------------------- > VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS > -------------------------------------------------------------------- > VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL > ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 > ERROR - Exception: Failed to start the defined domain: snapshot_vm > ERROR - Failed to remove snapshot file for snapshot_vm > InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') > -------------------------------------------------------------------- > VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS > -------------------------------------------------------------------- > VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS > -------------------------------------------------------------------- > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Fri Aug 7 16:33:01 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Sat, 8 Aug 2009 02:33:01 +1000 Subject: [Libvirt-cim] Test Run Summary (Aug 07 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus Message-ID: <200908071633.n77GX1Ed030740@d23av04.au.ibm.com> ================================================= Test Run Summary (Aug 07 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus ================================================= Distro: Red Hat Enterprise Linux Server release 5.3 (Tikanga) Kernel: 2.6.18-128.el5xen libvirt: 0.3.3 Hypervisor: Xen 3.1.0 CIMOM: Pegasus 2.7.1 Libvirt-cim revision: 940 Libvirt-cim changeset: 8690e2eca76e Cimtest revision: Cimtest changeset: ================================================= FAIL : 24 XFAIL : 3 SKIP : 4 PASS : 134 ----------------- Total : 165 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: FAIL ElementAllocatedFromPool - 01_forward.py: FAIL ElementAllocatedFromPool - 04_forward_errs.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL RASD - 01_verify_rasd_fields.py: FAIL RASD - 02_enum.py: FAIL ResourceAllocationFromPool - 01_forward.py: FAIL ResourceAllocationFromPool - 02_reverse.py: FAIL ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL ResourcePoolConfigurationService - 09_DeleteDiskPool.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL VSSD - 04_vssd_to_rasd.py: FAIL VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL VirtualSystemMigrationService - 01_migratable_host.py: FAIL VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL VirtualSystemSettingDataComponent - 02_reverse.py: FAIL VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: FAIL VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP LogicalDisk - 02_nodevs.py: SKIP NetworkPort - 03_user_netport.py: SKIP ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: PASS -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: SKIP -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: PASS -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_NOT_SUPPORTED: State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): CIM_ERR_NOT_SUPPORTED: State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: FAIL -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: FAIL ERROR - Xen_ElementAllocatedFromPool returned 0 ResourcePool objects for domain 'hd_domain' -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 ERROR - Failed to define the dom: hd_domain InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: PASS -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: PASS -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: PASS -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: PASS -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - Xen_SettingsDefineCapabilities returned 16 RASD objects instead of 20 for DiskPool/cimtest-diskpool CIM_ERR_INVALID_CLASS: Linux_ComputerSystem -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: PASS -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: SKIP -------------------------------------------------------------------- Processor - 01_processor.py: PASS -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: PASS -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: PASS -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: PASS -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: FAIL ERROR - NetworkName val mismatch: got testbridge, expected None -------------------------------------------------------------------- RASD - 02_enum.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 ERROR - Failed to Define the domain: VSSDC_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: FAIL ERROR - No RASD associated with NetworkPool/cimtest-networkpool -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: FAIL ERROR - No associated pool with RAFP_dom/11:22:33:aa:bb:cc CIM_ERR_FAILED: Unable to determine pool of `RAFP_dom/11:22:33:aa:bb:cc' -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL ERROR - Exception in create_pool() ERROR - Exception details: (1, u'CIM_ERR_FAILED: Pool with that name already exists') ERROR - Error in networkpool creation InvokeMethod(CreateChildResourcePool): CIM_ERR_FAILED: Pool with that name already exists -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: SKIP -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: FAIL ERROR - Exception in create_pool() ERROR - Exception details: (1, u'CIM_ERR_FAILED: Settings Error: Storage pool creation not supported in this version of libvirt') ERROR - Failed to create diskpool 'dp_pool' InvokeMethod(CreateChildResourcePool): CIM_ERR_FAILED: Settings Error: Storage pool creation not supported in this version of libvirt -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: FAIL ERROR - Xen_SettingsDefineCapabilities returned 16 ResourcePool objects instead of 20 -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: PASS -------------------------------------------------------------------- SystemDevice - 02_reverse.py: PASS -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: PASS -------------------------------------------------------------------- VSSD - 01_enum.py: PASS -------------------------------------------------------------------- VSSD - 02_bootldr.py: PASS -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: PASS -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified with return code 1 ERROR - Failed to Define the domain: VSSDC_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: No Network bridge name specified -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.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 define domain rstest_domain2 ERROR - Unable to define rstest_domain2 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:xen CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:xen) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Error invoking AddRS: add_net_res ERROR - (1, u'CIM_ERR_FAILED: Unable to change (0) device: Error 0') ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unable to change (0) device: Error 0 Bug:<00015> -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: FAIL ERROR - Error create domain dom_migrate -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL ERROR - Failed to enumerate the class of Xen_MigrationJob ERROR - Exception in fn get_migration_job_instance() details: (1, u'CIM_ERR_FAILED: Validation error: on line 1: expected INSTANCE element') ERROR - Unable to get mig_job instance for 'dom_migrate' -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Error start domain dom_migration InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Error define domain VM_frm_elm3b43.beaverton.ibm.com ERROR - Error setting up the guest InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Error define domain VM_frm_elm3b43.beaverton.ibm.com ERROR - Error setting up the guest InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Error define domain VM_frm_elm3b43.beaverton.ibm.com ERROR - Error setting up the guest InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Failed to define the dom: VSSDC_dom InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Unable to define domain domu1 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') with return code 1 ERROR - Unable to start domain domu1 InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: POST operation failed: (xend.err 'Device 51712 (vbd) could not be connected.\nFile /tmp/default-xen-dimage is loopback-mounted through /dev/loop0,\nwhich is mounted in a guest domain,\nand so cannot be mounted now.') -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses with return code 1 ERROR - Exception: ('Unable to define %s', 'snapshot_vm') ERROR - Got CIM error CIM_ERR_NOT_FOUND: Referenced domain `snapshot_vm' does not exist: Domain not found: xenUnifiedDomainLookupByName with return code 6 ERROR - Failed to remove snapshot file for snapshot_vm InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Conflicting MAC Addresses InvokeMethod(DestroySystem): CIM_ERR_NOT_FOUND: Referenced domain `snapshot_vm' does not exist: Domain not found: xenUnifiedDomainLookupByName -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- From kaitlin at linux.vnet.ibm.com Fri Aug 7 22:57:36 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 07 Aug 2009 15:57:36 -0700 Subject: [Libvirt-cim] [PATCH] Fix behavior of calling RequestStateChange() with DISABLED state Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1249685637 25200 # Node ID b3412cf292d12512a3c6c6f9e266cfbaaa437fef # Parent 2cb7c25bb35e7cb7b532ed78a43a3f27cb9fcf4f Fix behavior of calling RequestStateChange() with DISABLED state... According to the CIM_EnabledLogicalElement mof, a disabled request should immediately disconnect the guest. Currently, the provider calls a shutdown. This patch changes the behavior so that DISABLED calls virDomainDestroy() and SHUTDOWN continues to call virDomainShutdown() as expected. Signed-off-by: Kaitlin Rupert diff -r 2cb7c25bb35e -r b3412cf292d1 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Aug 06 16:53:24 2009 -0700 +++ b/src/Virt_ComputerSystem.c Fri Aug 07 15:53:57 2009 -0700 @@ -943,16 +943,41 @@ switch (info->state) { case VIR_DOMAIN_RUNNING: case VIR_DOMAIN_BLOCKED: - CU_DEBUG("Stop domain"); + CU_DEBUG("Disable domain"); + if (virDomainDestroy(dom) != 0) + virt_set_status(_BROKER, &s, + CMPI_RC_ERR_FAILED, + virDomainGetConnect(dom), + "Unable to disable domain"); + break; + default: + CU_DEBUG("Cannot go to disabled state from %i", info->state); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Invalid state transition"); + }; + + return s; +} + +static CMPIStatus state_change_shutdown(virDomainPtr dom, virDomainInfoPtr info) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + + info->state = adjust_state_xen(dom, info->state); + + switch (info->state) { + case VIR_DOMAIN_RUNNING: + case VIR_DOMAIN_BLOCKED: + CU_DEBUG("Shudown domain"); if (virDomainShutdown(dom) != 0) virt_set_status(_BROKER, &s, CMPI_RC_ERR_FAILED, virDomainGetConnect(dom), - "Unable to stop domain"); + "Unable to shutdown domain"); break; default: - CU_DEBUG("Cannot go to disabled/shutdown state from %i", - info->state); + CU_DEBUG("Cannot go to shutdown state from %i", info->state); cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Invalid state transition"); @@ -1067,8 +1092,10 @@ if (state == CIM_STATE_ENABLED) s = state_change_enable(dom, &info); - else if ((state == CIM_STATE_DISABLED) || (state == CIM_STATE_SHUTDOWN)) + else if (state == CIM_STATE_DISABLED) s = state_change_disable(dom, &info); + else if (state == CIM_STATE_SHUTDOWN) + s = state_change_shutdown(dom, &info); else if (state == CIM_STATE_PAUSED) s = state_change_pause(dom, &info); else if (state == CIM_STATE_REBOOT) From jfehlig at novell.com Fri Aug 7 23:42:19 2009 From: jfehlig at novell.com (Jim Fehlig) Date: Fri, 07 Aug 2009 17:42:19 -0600 Subject: [Libvirt-cim] [PATCH] Add LibvirtVersion to VSMS Message-ID: # HG changeset patch # User Jim Fehlig # Date 1249688466 21600 # Node ID cca9b991128c170d03177e33b88e1b5bac930bd6 # Parent 8c9cb3efdbad40890a5408267bc6a0d7b4b3de6e Add LibvirtVersion to VSMS I've had users ask for libvirt version available through libvirt-cim. This patch add LibvirtVersion property to VSMS, which is a proxy for libvirt and seems the most appropriate place to add the property. I consider VSMSC, but that class describes what the associated service is capable of as opposed to version information about the service. Signed-off-by: Jim Fehlig diff -r 8c9cb3efdbad -r cca9b991128c schema/VirtualSystemManagementService.mof --- a/schema/VirtualSystemManagementService.mof Wed Aug 05 14:07:00 2009 -0300 +++ b/schema/VirtualSystemManagementService.mof Fri Aug 07 17:41:06 2009 -0600 @@ -11,6 +11,9 @@ [Description("Package Version")] string Release; + + [Description("libvirt Version")] + string LibvirtVersion; }; [Provider("cmpi::Virt_VirtualSystemManagementService")] @@ -24,6 +27,9 @@ [Description("Package Version")] string Release; + + [Description("libvirt Version")] + string LibvirtVersion; }; [Provider("cmpi::Virt_VirtualSystemManagementService")] @@ -37,4 +43,7 @@ [Description("Package Version")] string Release; + + [Description("libvirt Version")] + string LibvirtVersion; }; diff -r 8c9cb3efdbad -r cca9b991128c src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 05 14:07:00 2009 -0300 +++ b/src/Virt_VirtualSystemManagementService.c Fri Aug 07 17:41:06 2009 -0600 @@ -2418,8 +2418,10 @@ const char *ccname = NULL; virConnectPtr conn = NULL; unsigned long hv_version = 0; + unsigned long lv_version = 0; const char * hv_type = NULL; char *caption = NULL; + char *lv_version_string = NULL; CMPIArray *array; uint16_t op_status; @@ -2483,6 +2485,25 @@ CMSetProperty(inst, "Caption", (CMPIValue *)"Unknown Hypervisor", CMPI_chars); + if (virGetVersion(&lv_version, hv_type, &hv_version) < 0) { + CU_DEBUG("Unable to get libvirt version"); + lv_version= 0; + hv_version= 0; + } + + if (asprintf(&lv_version_string, "%lu.%lu.%lu", + lv_version / 1000000, + (lv_version % 1000000) / 1000, + (lv_version % 1000000) % 1000) == -1) + lv_version_string = NULL; + + if (lv_version_string != NULL) + CMSetProperty(inst, "LibvirtVersion", + (CMPIValue *)lv_version_string, CMPI_chars); + else + CMSetProperty(inst, "LibvirtVersion", + (CMPIValue *)"Unknown libvirt", CMPI_chars); + CMSetProperty(inst, "Name", (CMPIValue *)"Management Service", CMPI_chars); @@ -2522,6 +2543,7 @@ ""); out: free(caption); + free(lv_version_string); virConnectClose(conn); *_inst = inst; From rmaciel at linux.vnet.ibm.com Mon Aug 10 00:53:27 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Sun, 09 Aug 2009 21:53:27 -0300 Subject: [Libvirt-cim] [PATCH] Add addiitonal attributes to StorageVolumeResourceAllocationSettingData In-Reply-To: <7f946266983b4b0a7e0a.1249510606@elm3a148.beaverton.ibm.com> References: <7f946266983b4b0a7e0a.1249510606@elm3a148.beaverton.ibm.com> Message-ID: <4A7F6F87.20205@linux.vnet.ibm.com> +1 On 08/05/2009 07:16 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1245187550 25200 > # Node ID 7f946266983b4b0a7e0aa86d5a1b21b794b46a76 > # Parent 8c9cb3efdbad40890a5408267bc6a0d7b4b3de6e > Add addiitonal attributes to StorageVolumeResourceAllocationSettingData... > > These attributes will be needed when defining a new image. Also, make the > necessary changes to expose these attributes via SDC. > > Signed-off-by: Kaitlin Rupert > > diff -r 8c9cb3efdbad -r 7f946266983b schema/ResourceAllocationSettingData.mof > --- a/schema/ResourceAllocationSettingData.mof Wed Aug 05 14:07:00 2009 -0300 > +++ b/schema/ResourceAllocationSettingData.mof Tue Jun 16 14:25:50 2009 -0700 > @@ -296,8 +296,12 @@ > ] > class Xen_StorageVolumeResourceAllocationSettingData : Xen_ResourceAllocationSettingData > { > + string VolumeName; > string Path; > - uint16 Type; > + uint16 FormatType; > + uint16 AllocationQuantity; > + uint16 Capacity; > + string AllocationUnits; > }; > > [Description ("KVM storage volume settings"), > @@ -305,7 +309,11 @@ > ] > class KVM_StorageVolumeResourceAllocationSettingData : KVM_ResourceAllocationSettingData > { > + string VolumeName; > string Path; > - uint16 Type; > + uint16 FormatType; > + uint16 AllocationQuantity; > + uint16 Capacity; > + string AllocationUnits; > }; > > diff -r 8c9cb3efdbad -r 7f946266983b src/Virt_SettingsDefineCapabilities.c > --- a/src/Virt_SettingsDefineCapabilities.c Wed Aug 05 14:07:00 2009 -0300 > +++ b/src/Virt_SettingsDefineCapabilities.c Tue Jun 16 14:25:50 2009 -0700 > @@ -1038,7 +1038,11 @@ > struct virt_pool *pool = NULL; > CMPIInstance *inst = NULL; > int type = 0; > + const char *name; > const char *path; > + uint16_t alloc = 0; > + uint16_t cap = 0; > + const char *units; > > switch(template_type) { > case SDC_RASD_MIN: > @@ -1080,11 +1084,24 @@ > goto out; > > CMSetProperty(inst, "InstanceID", (CMPIValue *)id, CMPI_chars); > - CMSetProperty(inst, "Type", (CMPIValue *)&type, CMPI_uint16); > + CMSetProperty(inst, "FormatType", (CMPIValue *)&type, CMPI_uint16); > + > + name = "tmp.img"; > + CMSetProperty(inst, "VolumeName", (CMPIValue *)name, CMPI_chars); > > path = "/var/lib/libvirt/images/"; > CMSetProperty(inst, "Path", (CMPIValue *)path, CMPI_chars); > > + alloc = 0; > + CMSetProperty(inst, "AllocationQuantity", > + (CMPIValue *)&alloc, CMPI_uint16); > + > + cap = 0; > + CMSetProperty(inst, "Capacity", (CMPIValue *)&cap, CMPI_uint16); > + > + units = "G"; > + CMSetProperty(inst, "AllocationUnits", (CMPIValue *)units, CMPI_chars); > + > inst_list_add(list, inst); > > out: > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Aug 10 11:39:38 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 10 Aug 2009 04:39:38 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing CSMigrationJobIndication/01*py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1249904367 25200 # Node ID d6774b718374366d94075401399c2a4fe0a67590 # Parent 51a906dbd4082a5f1c8f25566c235d296fb30a2b [TEST] Fixing CSMigrationJobIndication/01*py . Testd with RHEL5.3 and current sources. Signed-off-by: Deepti B. Kalakeri diff -r 51a906dbd408 -r d6774b718374 suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py --- a/suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py Thu Aug 06 15:32:52 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py Mon Aug 10 04:39:27 2009 -0700 @@ -78,13 +78,14 @@ if clean_net != True: return - # clean the networkpool created on the remote machine - target_net_list = net_list(t_sysname, virt) - if target_net_list != None and default_network_name in target_net_list: - ret_value = destroy_netpool(t_sysname, virt, default_network_name) - if ret_value != PASS: - logger.info("Unable to destroy networkpool '%s' on '%s'", - default_network_name, t_sysname) + if t_sysname != "localhost" and t_sysname not in s_sysname: + # clean the networkpool created on the remote machine + target_net_list = net_list(t_sysname, virt) + if target_net_list != None and default_network_name in target_net_list: + ret_value = destroy_netpool(t_sysname, virt, default_network_name) + if ret_value != PASS: + logger.info("Unable to destroy networkpool '%s' on '%s'", + default_network_name, t_sysname) # Remote Migration not Successful, clean the domain on src machine src_list = domain_list(s_sysname, virt) From rmaciel at linux.vnet.ibm.com Mon Aug 10 14:16:07 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 10 Aug 2009 11:16:07 -0300 Subject: [Libvirt-cim] [PATCH 3 of 3] Parse parameters passed in to CreateResourceInPool In-Reply-To: References: Message-ID: <4A802BA7.7010903@linux.vnet.ibm.com> On 08/06/2009 06:59 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1249595963 25200 > # Node ID af509ca0e7f25db4e7ce96dff8bc77df6289e9b3 > # Parent fc589363fb55e780942d8431f9c3559d766dcb69 > Parse parameters passed in to CreateResourceInPool > > Signed-off-by: Kaitlin Rupert > > diff -r fc589363fb55 -r af509ca0e7f2 src/Virt_ResourcePoolConfigurationService.c > --- a/src/Virt_ResourcePoolConfigurationService.c Thu Aug 06 14:58:56 2009 -0700 > +++ b/src/Virt_ResourcePoolConfigurationService.c Thu Aug 06 14:59:23 2009 -0700 > @@ -664,6 +664,32 @@ > return s; > } > > +static CMPIStatus create_resource_parse_args(const CMPIArgs *argsin, > + CMPIInstance **settings, > + CMPIObjectPath **pool) > +{ > + CMPIStatus s = {CMPI_RC_OK, NULL}; > + > + if (cu_get_inst_arg(argsin, "Settings", settings) != CMPI_RC_OK) { > + CU_DEBUG("Failed to get Settings arg"); > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_INVALID_PARAMETER, > + "Missing argument `Settings'"); > + goto out; > + } > + > + if (cu_get_ref_arg(argsin, "Pool", pool) != CMPI_RC_OK) { > + CU_DEBUG("Failed to get Pool reference arg"); > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_INVALID_PARAMETER, > + "Missing argument `Pool'"); > + goto out; > + } > + > + out: > + return s; > +} > + > static CMPIStatus create_resource_in_pool(CMPIMethodMI *self, > const CMPIContext *context, > const CMPIResult *results, > @@ -673,13 +699,21 @@ > { > uint32_t rc = CIM_SVPC_RETURN_FAILED; > CMPIStatus s = {CMPI_RC_OK, NULL}; > + CMPIInstance *settings; > + CMPIObjectPath *pool; > > CU_DEBUG("CreateResourceInPool"); > > + s = create_resource_parse_args(argsin,&settings,&pool); > + if (s.rc != CMPI_RC_OK) > + goto out; > + > if (s.rc == CMPI_RC_OK) > rc = CIM_SVPC_RETURN_COMPLETED; > CMReturnData(results,&rc, CMPI_uint32); > > + out: > + > return s; > } According to the patchset header, this should check the parameters passed, but this code always call create_resource_parse_args with a both settings and pool parameters NULL. This will always generate an error! > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Aug 10 14:33:33 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 10 Aug 2009 11:33:33 -0300 Subject: [Libvirt-cim] [PATCH] Move get_disk_pool() to SDC In-Reply-To: <2cb7c25bb35e7cb7b532.1249602988@elm3a148.beaverton.ibm.com> References: <2cb7c25bb35e7cb7b532.1249602988@elm3a148.beaverton.ibm.com> Message-ID: <4A802FBD.70202@linux.vnet.ibm.com> +1 On 08/06/2009 08:56 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1249602804 25200 > # Node ID 2cb7c25bb35e7cb7b532ed78a43a3f27cb9fcf4f > # Parent af509ca0e7f25db4e7ce96dff8bc77df6289e9b3 > Move get_disk_pool() to SDC... > > libvirt-cim won't build with versions of libvirt that don't have disk pool > support. Since only the SDC provider needs this function, move it there and > place it under a #if VIR_USE_LIBVIRT_STORAGE tag to ensure it doesn't get built > with older versions of libvirt. > > Signed-off-by: Kaitlin Rupert > > diff -r af509ca0e7f2 -r 2cb7c25bb35e libxkutil/pool_parsing.c > --- a/libxkutil/pool_parsing.c Thu Aug 06 14:59:23 2009 -0700 > +++ b/libxkutil/pool_parsing.c Thu Aug 06 16:53:24 2009 -0700 > @@ -230,26 +230,6 @@ > return ret; > } > > -int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) > -{ > - char *xml; > - int ret; > - > - xml = virStoragePoolGetXMLDesc(poolptr, 0); > - if (xml == NULL) > - return 0; > - > - *pool = malloc(sizeof(**pool)); > - if (*pool == NULL) > - return 0; > - > - ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); > - > - free(xml); > - > - return ret; > -} > - > int define_pool(virConnectPtr conn, const char *xml, int res_type) > { > int ret = 1; > diff -r af509ca0e7f2 -r 2cb7c25bb35e libxkutil/pool_parsing.h > --- a/libxkutil/pool_parsing.h Thu Aug 06 14:59:23 2009 -0700 > +++ b/libxkutil/pool_parsing.h Thu Aug 06 16:53:24 2009 -0700 > @@ -67,7 +67,6 @@ > void cleanup_virt_pool(struct virt_pool **pool); > > int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type); > -int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool); > > int define_pool(virConnectPtr conn, const char *xml, int res_type); > int destroy_pool(virConnectPtr conn, const char *name, int res_type); > diff -r af509ca0e7f2 -r 2cb7c25bb35e src/Virt_SettingsDefineCapabilities.c > --- a/src/Virt_SettingsDefineCapabilities.c Thu Aug 06 14:59:23 2009 -0700 > +++ b/src/Virt_SettingsDefineCapabilities.c Thu Aug 06 16:53:24 2009 -0700 > @@ -1027,6 +1027,26 @@ > } > > #if VIR_USE_LIBVIRT_STORAGE > +static int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) > +{ > + char *xml; > + int ret; > + > + xml = virStoragePoolGetXMLDesc(poolptr, 0); > + if (xml == NULL) > + return 0; > + > + *pool = malloc(sizeof(**pool)); > + if (*pool == NULL) > + return 0; > + > + ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); > + > + free(xml); > + > + return ret; > +} > + > static CMPIStatus new_volume_template(const CMPIObjectPath *ref, > int template_type, > virStoragePoolPtr poolptr, > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Aug 10 17:21:55 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 10 Aug 2009 14:21:55 -0300 Subject: [Libvirt-cim] [PATCH] Fix behavior of calling RequestStateChange() with DISABLED state In-Reply-To: References: Message-ID: <4A805733.7050200@linux.vnet.ibm.com> +1 On 08/07/2009 07:57 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1249685637 25200 > # Node ID b3412cf292d12512a3c6c6f9e266cfbaaa437fef > # Parent 2cb7c25bb35e7cb7b532ed78a43a3f27cb9fcf4f > Fix behavior of calling RequestStateChange() with DISABLED state... > > According to the CIM_EnabledLogicalElement mof, a disabled request should > immediately disconnect the guest. Currently, the provider calls a shutdown. > > This patch changes the behavior so that DISABLED calls virDomainDestroy() and > SHUTDOWN continues to call virDomainShutdown() as expected. > > Signed-off-by: Kaitlin Rupert > > diff -r 2cb7c25bb35e -r b3412cf292d1 src/Virt_ComputerSystem.c > --- a/src/Virt_ComputerSystem.c Thu Aug 06 16:53:24 2009 -0700 > +++ b/src/Virt_ComputerSystem.c Fri Aug 07 15:53:57 2009 -0700 > @@ -943,16 +943,41 @@ > switch (info->state) { > case VIR_DOMAIN_RUNNING: > case VIR_DOMAIN_BLOCKED: > - CU_DEBUG("Stop domain"); > + CU_DEBUG("Disable domain"); > + if (virDomainDestroy(dom) != 0) > + virt_set_status(_BROKER,&s, > + CMPI_RC_ERR_FAILED, > + virDomainGetConnect(dom), > + "Unable to disable domain"); > + break; > + default: > + CU_DEBUG("Cannot go to disabled state from %i", info->state); > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_FAILED, > + "Invalid state transition"); > + }; > + > + return s; > +} > + > +static CMPIStatus state_change_shutdown(virDomainPtr dom, virDomainInfoPtr info) > +{ > + CMPIStatus s = {CMPI_RC_OK, NULL}; > + > + info->state = adjust_state_xen(dom, info->state); > + > + switch (info->state) { > + case VIR_DOMAIN_RUNNING: > + case VIR_DOMAIN_BLOCKED: > + CU_DEBUG("Shudown domain"); > if (virDomainShutdown(dom) != 0) > virt_set_status(_BROKER,&s, > CMPI_RC_ERR_FAILED, > virDomainGetConnect(dom), > - "Unable to stop domain"); > + "Unable to shutdown domain"); > break; > default: > - CU_DEBUG("Cannot go to disabled/shutdown state from %i", > - info->state); > + CU_DEBUG("Cannot go to shutdown state from %i", info->state); > cu_statusf(_BROKER,&s, > CMPI_RC_ERR_FAILED, > "Invalid state transition"); > @@ -1067,8 +1092,10 @@ > > if (state == CIM_STATE_ENABLED) > s = state_change_enable(dom,&info); > - else if ((state == CIM_STATE_DISABLED) || (state == CIM_STATE_SHUTDOWN)) > + else if (state == CIM_STATE_DISABLED) > s = state_change_disable(dom,&info); > + else if (state == CIM_STATE_SHUTDOWN) > + s = state_change_shutdown(dom,&info); > else if (state == CIM_STATE_PAUSED) > s = state_change_pause(dom,&info); > else if (state == CIM_STATE_REBOOT) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Aug 10 18:56:04 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 10 Aug 2009 11:56:04 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Parse parameters passed in to CreateResourceInPool In-Reply-To: <4A802BA7.7010903@linux.vnet.ibm.com> References: <4A802BA7.7010903@linux.vnet.ibm.com> Message-ID: <4A806D44.8090608@linux.vnet.ibm.com> >> @@ -673,13 +699,21 @@ >> { >> uint32_t rc = CIM_SVPC_RETURN_FAILED; >> CMPIStatus s = {CMPI_RC_OK, NULL}; >> + CMPIInstance *settings; >> + CMPIObjectPath *pool; >> >> CU_DEBUG("CreateResourceInPool"); >> >> + s = create_resource_parse_args(argsin,&settings,&pool); >> + if (s.rc != CMPI_RC_OK) >> + goto out; >> + >> if (s.rc == CMPI_RC_OK) >> rc = CIM_SVPC_RETURN_COMPLETED; >> CMReturnData(results,&rc, CMPI_uint32); >> >> + out: >> + >> return s; >> } > > According to the patchset header, this should check the parameters > passed, but this code always call create_resource_parse_args with a both > settings and pool parameters NULL. This will always generate an error! Settings and Pool are NULL because the create_resource_parse_args() assigns those parameters. Once create_resource_parse_args() returns, those params shouldn't be NULL unless create_resource_parse_args() encounters an error. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Aug 10 19:38:16 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 10 Aug 2009 16:38:16 -0300 Subject: [Libvirt-cim] [PATCH 0 of 3] Initial image creation support In-Reply-To: References: Message-ID: <4A807728.20006@linux.vnet.ibm.com> +1 On 08/06/2009 06:59 PM, Kaitlin Rupert wrote: > Right now, the CreateResourceInPool() doesn't do anything other than check the > parameters that are parsed in. Subsequent patches will add additional > functionality. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Aug 10 20:07:51 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 10 Aug 2009 17:07:51 -0300 Subject: [Libvirt-cim] [PATCH] Add LibvirtVersion to VSMS In-Reply-To: References: Message-ID: <4A807E17.3080507@linux.vnet.ibm.com> +1 On 08/07/2009 08:42 PM, Jim Fehlig wrote: > # HG changeset patch > # User Jim Fehlig > # Date 1249688466 21600 > # Node ID cca9b991128c170d03177e33b88e1b5bac930bd6 > # Parent 8c9cb3efdbad40890a5408267bc6a0d7b4b3de6e > Add LibvirtVersion to VSMS > > I've had users ask for libvirt version available through libvirt-cim. > This patch add LibvirtVersion property to VSMS, which is a proxy for > libvirt and seems the most appropriate place to add the property. > > I consider VSMSC, but that class describes what the associated service > is capable of as opposed to version information about the service. > > Signed-off-by: Jim Fehlig > > diff -r 8c9cb3efdbad -r cca9b991128c schema/VirtualSystemManagementService.mof > --- a/schema/VirtualSystemManagementService.mof Wed Aug 05 14:07:00 2009 -0300 > +++ b/schema/VirtualSystemManagementService.mof Fri Aug 07 17:41:06 2009 -0600 > @@ -11,6 +11,9 @@ > > [Description("Package Version")] > string Release; > + > + [Description("libvirt Version")] > + string LibvirtVersion; > }; > > [Provider("cmpi::Virt_VirtualSystemManagementService")] > @@ -24,6 +27,9 @@ > > [Description("Package Version")] > string Release; > + > + [Description("libvirt Version")] > + string LibvirtVersion; > }; > > [Provider("cmpi::Virt_VirtualSystemManagementService")] > @@ -37,4 +43,7 @@ > > [Description("Package Version")] > string Release; > + > + [Description("libvirt Version")] > + string LibvirtVersion; > }; > diff -r 8c9cb3efdbad -r cca9b991128c src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 05 14:07:00 2009 -0300 > +++ b/src/Virt_VirtualSystemManagementService.c Fri Aug 07 17:41:06 2009 -0600 > @@ -2418,8 +2418,10 @@ > const char *ccname = NULL; > virConnectPtr conn = NULL; > unsigned long hv_version = 0; > + unsigned long lv_version = 0; > const char * hv_type = NULL; > char *caption = NULL; > + char *lv_version_string = NULL; > CMPIArray *array; > uint16_t op_status; > > @@ -2483,6 +2485,25 @@ > CMSetProperty(inst, "Caption", > (CMPIValue *)"Unknown Hypervisor", CMPI_chars); > > + if (virGetVersion(&lv_version, hv_type,&hv_version)< 0) { > + CU_DEBUG("Unable to get libvirt version"); > + lv_version= 0; > + hv_version= 0; > + } > + > + if (asprintf(&lv_version_string, "%lu.%lu.%lu", > + lv_version / 1000000, > + (lv_version % 1000000) / 1000, > + (lv_version % 1000000) % 1000) == -1) > + lv_version_string = NULL; > + > + if (lv_version_string != NULL) > + CMSetProperty(inst, "LibvirtVersion", > + (CMPIValue *)lv_version_string, CMPI_chars); > + else > + CMSetProperty(inst, "LibvirtVersion", > + (CMPIValue *)"Unknown libvirt", CMPI_chars); > + > CMSetProperty(inst, "Name", > (CMPIValue *)"Management Service", CMPI_chars); > > @@ -2522,6 +2543,7 @@ > ""); > out: > free(caption); > + free(lv_version_string); > virConnectClose(conn); > *_inst = inst; > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Aug 10 20:56:31 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 10 Aug 2009 13:56:31 -0700 Subject: [Libvirt-cim] [PATCH] Add LibvirtVersion to VSMS In-Reply-To: References: Message-ID: <4A80897F.9090402@linux.vnet.ibm.com> Thanks Jim! This looks good, I've got a minor change below... > @@ -2483,6 +2485,25 @@ > CMSetProperty(inst, "Caption", > (CMPIValue *)"Unknown Hypervisor", CMPI_chars); > > + if (virGetVersion(&lv_version, hv_type, &hv_version) < 0) { > + CU_DEBUG("Unable to get libvirt version"); > + lv_version= 0; > + hv_version= 0; > + } > + > + if (asprintf(&lv_version_string, "%lu.%lu.%lu", > + lv_version / 1000000, > + (lv_version % 1000000) / 1000, > + (lv_version % 1000000) % 1000) == -1) > + lv_version_string = NULL; > + > + if (lv_version_string != NULL) > + CMSetProperty(inst, "LibvirtVersion", > + (CMPIValue *)lv_version_string, CMPI_chars); > + else > + CMSetProperty(inst, "LibvirtVersion", > + (CMPIValue *)"Unknown libvirt", CMPI_chars); > + Instead of the if / else here, in the case when lv_version_string, can you assign it the value of "Unknown libvirt". Then you can just call CMSetProperty() with lv_version_string, as lv_version_string shouldn't be NULL at that point. This approach is more inline with the convention followed up the rest of the code. Also, I think "Unknown libvirt version" is a little more clear. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Aug 10 20:55:46 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 10 Aug 2009 13:55:46 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Add structure to hold image creation settings Message-ID: From kaitlin at linux.vnet.ibm.com Mon Aug 10 20:55:47 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 10 Aug 2009 13:55:47 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add structure to hold info about new resources to be added to resource pools In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1249937577 25200 # Node ID aa8fb78cb7fc77496f962e80b2ff2468f91a6625 # Parent 2de7d9bdb9af3414ddc01f28d7a007d6c3d19bbc Add structure to hold info about new resources to be added to resource pools Signed-off-by: Kaitlin Rupert diff -r 2de7d9bdb9af -r aa8fb78cb7fc libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Fri Aug 07 15:53:57 2009 -0700 +++ b/libxkutil/pool_parsing.h Mon Aug 10 13:52:57 2009 -0700 @@ -64,6 +64,24 @@ char *id; }; +struct storage_vol { + enum {VOL_FORMAT_UNKNOWN, + VOL_FORMAT_RAW} format_type; + char *vol_name; + char *path; + uint16_t alloc; + uint16_t cap; + char *cap_units; +}; + +struct virt_pool_res { + uint16_t type; + union { + struct storage_vol storage_vol; + } res; + char *pool_id; +}; + void cleanup_virt_pool(struct virt_pool **pool); int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type); From kaitlin at linux.vnet.ibm.com Mon Aug 10 20:55:48 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 10 Aug 2009 13:55:48 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Pull config options from params to CreateResourceInPool() In-Reply-To: References: Message-ID: <615da7491c145fa283e6.1249937748@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1249937578 25200 # Node ID 615da7491c145fa283e658df520fd9e31615f4d4 # Parent aa8fb78cb7fc77496f962e80b2ff2468f91a6625 Pull config options from params to CreateResourceInPool() Store configuration options into a virt_pool_resource struct. This struct will be used when creating a new image. Signed-off-by: Kaitlin Rupert diff -r aa8fb78cb7fc -r 615da7491c14 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Aug 10 13:52:57 2009 -0700 +++ b/src/Virt_RASD.c Mon Aug 10 13:52:58 2009 -0700 @@ -592,6 +592,8 @@ *type = CIM_RES_TYPE_GRAPHICS; else if (STREQ(base, "InputResourceAllocationSettingData")) *type = CIM_RES_TYPE_INPUT; + else if (STREQ(base, "StorageVolumeResourceAllocationSettingData")) + *type = CIM_RES_TYPE_IMAGE; else goto out; diff -r aa8fb78cb7fc -r 615da7491c14 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Mon Aug 10 13:52:57 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Mon Aug 10 13:52:58 2009 -0700 @@ -690,6 +690,87 @@ return s; } +static const char *storage_vol_rasd_to_res(CMPIInstance *inst, + struct virt_pool_res *res) +{ + uint16_t int_val; + const char *val; + const char *msg; + + if (cu_get_u16_prop(inst, "FormatType", &int_val) != CMPI_RC_OK) { + msg = "StorageVolumeRASD FormatType field not valid"; + goto out; + } + res->res.storage_vol.format_type = int_val; + + if (cu_get_str_prop(inst, "VolumeName", &val) != CMPI_RC_OK) { + msg = "StorageVolumeRASD VolumeName field not valid"; + goto out; + } + free(res->res.storage_vol.vol_name); + res->res.storage_vol.vol_name = strdup(val); + + if (cu_get_str_prop(inst, "Path", &val) != CMPI_RC_OK) { + msg = "StorageVolumeRASD Path field not valid"; + goto out; + } + free(res->res.storage_vol.path); + res->res.storage_vol.path = strdup(val); + + if (cu_get_u16_prop(inst, "AllocationQuantity", &int_val) == CMPI_RC_OK) + res->res.storage_vol.alloc = int_val; + + if (cu_get_u16_prop(inst, "Capacity", &int_val) != CMPI_RC_OK) { + msg = "StorageVolumeRASD Capacity field not valid"; + goto out; + } + res->res.storage_vol.cap = int_val; + + free(res->res.storage_vol.cap_units); + if (cu_get_str_prop(inst, "AllocationUnits", &val) != CMPI_RC_OK) + res->res.storage_vol.cap_units = strdup("G"); + else + res->res.storage_vol.cap_units = strdup(val); + + out: + + return msg; +} + +static const char *rasd_to_res(CMPIInstance *inst, + struct virt_pool_res *res, + const char *ns) +{ + uint16_t type; + CMPIObjectPath *op; + const char *msg = NULL; + + op = CMGetObjectPath(inst, NULL); + if (op == NULL) { + msg = "Unable to get path for resource instance"; + goto out; + } + + if (res_type_from_rasd_classname(CLASSNAME(op), &type) != CMPI_RC_OK) { + msg = "Unable to get resource type"; + goto out; + } + + res->type = (int)type; + + if (type == CIM_RES_TYPE_IMAGE) { + msg = storage_vol_rasd_to_res(inst, res); + } + else + msg = "This function does not support this resource type"; + + out: + if (msg) + CU_DEBUG("rasd_to_res(%s): %s", CLASSNAME(op), msg); + + return msg; +} + static CMPIStatus create_resource_in_pool(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, @@ -701,6 +782,8 @@ CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *settings; CMPIObjectPath *pool; + struct virt_pool_res *res = NULL; + const char* msg = NULL; CU_DEBUG("CreateResourceInPool"); @@ -708,6 +791,23 @@ if (s.rc != CMPI_RC_OK) goto out; + res = calloc(1, sizeof(*res)); + if (res == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to allocate new resource struct"); + goto out; + } + + msg = rasd_to_res(settings, res, NAMESPACE(reference)); + if (msg != NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get attributes for resource: %s", + msg); + goto out; + } + if (s.rc == CMPI_RC_OK) rc = CIM_SVPC_RETURN_COMPLETED; CMReturnData(results, &rc, CMPI_uint32); From kaitlin at linux.vnet.ibm.com Mon Aug 10 23:44:59 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 10 Aug 2009 16:44:59 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for verifying disabled RequestStateChange() Message-ID: <9f740b6fe6cfe4131751.1249947899@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1249668560 25200 # Node ID 9f740b6fe6cfe41317514182f245d1eb9938122c # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b [TEST] Add test for verifying disabled RequestStateChange() Signed-off-by: Kaitlin Rupert diff -r 12fd8bac01f2 -r 9f740b6fe6cf suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py Fri Aug 07 11:09:20 2009 -0700 @@ -0,0 +1,74 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Kaitlin Rupert +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +# Test Case Info: +# -------------- +# This test case is used to verify the Virtual System State Transition +# information is captured in the RequestedState Property of the VS. +# The test is considered to be successful if RequestedState Property +# has a value of 3 when the VS is moved from active state to a disabled state. +# +# Date: 08-07-2009 + +import sys +from CimTest.Globals import logger +from XenKvmLib.const import do_main +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from XenKvmLib.vxml import get_class + +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] + +default_dom = 'cs_test_domain' + + at do_main(sup_types) +def main(): + options = main.options + status = FAIL + server = options.ip + virt = options.virt + + try: + # define the vs + cxml = get_class(virt)(default_dom) + ret = cxml.cim_define(server) + if not ret: + raise Exception("Failed to define the guest: %s" % default_dom) + + status = cxml.cim_start(server) + if status != PASS: + raise Exception("Unable start dom '%s'" % default_dom) + + status = cxml.cim_disable(server) + if status != PASS: + raise Exception("Unable disable dom '%s'" % default_dom) + + except Exception, detail: + logger.error("Exception: %s", detail) + status = FAIL + + cxml.cim_destroy(server) + cxml.undefine(server) + + return status + +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Tue Aug 11 07:44:22 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 11 Aug 2009 00:44:22 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Modifying rasd.py to include strorage vol info when libvirt>= 0.4.1 Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1249976643 25200 # Node ID e1a54be4fedf4527eebbb7b225c9ea9a75e815c8 # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b [TEST] Modifying rasd.py to include strorage vol info when libvirt>= 0.4.1 Tested with KVM on F10 and Xen on RHEL5.3 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 12fd8bac01f2 -r e1a54be4fedf suites/libvirt-cim/lib/XenKvmLib/rasd.py --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Aug 10 04:39:27 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Aug 11 00:44:03 2009 -0700 @@ -360,7 +360,8 @@ volumes = enum_volumes(virt, ip, id[1]) exp_len = (volumes * exp_base_num) + exp_cdrom - if rev >= libvirt_rasd_storagepool_changes and virt != 'LXC': + if rev >= libvirt_rasd_storagepool_changes and libvirt_ver >= '0.4.1' \ + and virt != 'LXC': exp_len += exp_storagevol_rasd return exp_len From anantyog at linux.vnet.ibm.com Tue Aug 11 10:35:58 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Tue, 11 Aug 2009 03:35:58 -0700 Subject: [Libvirt-cim] [PATCH] [Test]Testcase to check for duplicate UUID Message-ID: <87e175898a31e7866d67.1249986958@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at in.ibm.com # Date 1249986809 25200 # Node ID 87e175898a31e7866d67349e349fad34f8d0bb01 # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b [Test]Testcase to check for duplicate UUID Steps: 1) Define 2 domains,'default' and 'test', both with random UUID 2) Reset the uuid of the second domain, 'test', to the uuid of the first domain, using ModifySystemSettings 3) The verify the assigned uuid The test does not behave as expected, either at step 2 when ModifySystemSetting is called, an error should be returned for the duplicate UUID or at step 3 when we check for the assigned UUID, it should be different from the UUID of the first domain, neither of this happens. I have filed the bug 00016 regarding this issue. Signed-off-by: Yogananth Subramanian diff -r 12fd8bac01f2 -r 87e175898a31 suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py Tue Aug 11 03:33:29 2009 -0700 @@ -0,0 +1,115 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth Subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +#Steps: +#1) Define 2 domains,'default' and 'test', both with random UUID +#2) Reset the uuid of the second domain, 'test', to the uuid of the +# first domain, using ModifySystemSettings +#3) The verify the assigned uuid +# + +import sys +import time +from XenKvmLib import vsms +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC +from XenKvmLib.const import do_main +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.enumclass import GetInstance + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'uuid_domain' +test_dom = 'test_domain' +nmac = '99:aa:bb:cc:ee:ff' +bug_libvirt = "00016" + +def get_vssd(ip, virt, get_cim_inst, default_dom): + cn = get_typed_class(virt, "VirtualSystemSettingData") + inst = None + + try: + if virt == "XenFV": + virt = "Xen" + + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } + inst = GetInstance(ip, cn, key_list, get_cim_inst) + + except Exception, details: + logger.error(details) + return FAIL, inst + + if inst is None: + return FAIL, inst + + return PASS, inst + + at do_main(sup_types) +def main(): + options = main.options + + service = vsms.get_vsms_class(options.virt)(options.ip) + + cxml = vxml.get_class(options.virt)(default_dom) + ret = cxml.cim_define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + + try: + status, inst = get_vssd(options.ip, options.virt, True,default_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s"% + default_dom) + + uuid = inst['UUID'] + + sxml = vxml.get_class(options.virt)(test_dom, uuid=uuid, mac=nmac) + ret = sxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s"% test_dom) + + status, inst = get_vssd(options.ip, options.virt, True,test_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s"% + test_dom) + + inst['UUID'] = uuid + vssd = inst_to_mof(inst) + ret = service.ModifySystemSettings(SystemSettings=vssd) + + if inst['UUID'] == uuid and ret[0]== 0 : + sxml.undefine(options.ip) + logger.error("The domains %s and %s have the same UUID", + default_dom,test_dom) + status = XFAIL_RC(bug_libvirt) + + except Exception, details: + logger.error(details) + status = FAIL + + sxml.undefine(options.ip) + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Tue Aug 11 13:25:48 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Tue, 11 Aug 2009 06:25:48 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing EAFP/04_forward_errs.py Message-ID: <2f339d5b932d957cccc6.1249997148@elm3a148.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1249997113 25200 # Node ID 2f339d5b932d957cccc6432c6b979ad6bff02a8b # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b [TEST] Fixing EAFP/04_forward_errs.py. Tested with KVM on F10 and Xen on RHEL5.3 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 12fd8bac01f2 -r 2f339d5b932d suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Mon Aug 10 04:39:27 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Tue Aug 11 06:25:13 2009 -0700 @@ -498,10 +498,9 @@ else: test_disk = "hda" destroy_and_undefine_all(options.ip) - vsxml = get_class(virt)(test_dom, vcpus = test_vcpus, mac = test_mac, \ - disk = test_disk) + vsxml = get_class(virt)(test_dom, vcpus = test_vcpus, + mac = test_mac, disk = test_disk) - bridge = vsxml.set_vbridge(options.ip, default_network_name) ret = vsxml.cim_define(options.ip) if not ret: logger.error("Failed to define the dom: %s", test_dom) From deeptik at linux.vnet.ibm.com Tue Aug 11 13:57:55 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 11 Aug 2009 19:27:55 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for verifying disabled RequestStateChange() In-Reply-To: <9f740b6fe6cfe4131751.1249947899@elm3a148.beaverton.ibm.com> References: <9f740b6fe6cfe4131751.1249947899@elm3a148.beaverton.ibm.com> Message-ID: <4A8178E3.1050808@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1249668560 25200 > # Node ID 9f740b6fe6cfe41317514182f245d1eb9938122c > # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b > [TEST] Add test for verifying disabled RequestStateChange() > > Signed-off-by: Kaitlin Rupert > > diff -r 12fd8bac01f2 -r 9f740b6fe6cf suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py Fri Aug 07 11:09:20 2009 -0700 > @@ -0,0 +1,74 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Kaitlin Rupert > +# > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU 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 > +# General Public License for more details. > +# > +# You should have received a copy of the GNU 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 > +# > +# Test Case Info: > +# -------------- > +# This test case is used to verify the Virtual System State Transition > +# information is captured in the RequestedState Property of the VS. > +# The test is considered to be successful if RequestedState Property > +# has a value of 3 when the VS is moved from active state to a disabled state. > The test case does not verify the value if EnabledState is set to 3. Did you miss adding it ? > +# > +# Date: 08-07-2009 > + > +import sys > +from CimTest.Globals import logger > +from XenKvmLib.const import do_main > +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC > XFAIL_RC is not needed > +from XenKvmLib.vxml import get_class > + > +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] > + > +default_dom = 'cs_test_domain' > + > + at do_main(sup_types) > +def main(): > + options = main.options > + status = FAIL > + server = options.ip > + virt = options.virt > + > + try: > + # define the vs > + cxml = get_class(virt)(default_dom) > + ret = cxml.cim_define(server) > + if not ret: > + raise Exception("Failed to define the guest: %s" % default_dom) > + > + status = cxml.cim_start(server) > + if status != PASS: > + raise Exception("Unable start dom '%s'" % default_dom) > + > + status = cxml.cim_disable(server) > + if status != PASS: > + raise Exception("Unable disable dom '%s'" % default_dom) > + > + except Exception, detail: > + logger.error("Exception: %s", detail) > + status = FAIL > + > + cxml.cim_destroy(server) > We do not require cim_destroy if cim_disable is successful. > + cxml.undefine(server) > + > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Aug 11 14:32:52 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 11 Aug 2009 20:02:52 +0530 Subject: [Libvirt-cim] [PATCH] [Test]Testcase to check for duplicate UUID In-Reply-To: <87e175898a31e7866d67.1249986958@elm3b151.beaverton.ibm.com> References: <87e175898a31e7866d67.1249986958@elm3b151.beaverton.ibm.com> Message-ID: <4A818114.3090902@linux.vnet.ibm.com> Yogananth Subramanian wrote: > # HG changeset patch > # User anantyog at in.ibm.com > # Date 1249986809 25200 > # Node ID 87e175898a31e7866d67349e349fad34f8d0bb01 > # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b > [Test]Testcase to check for duplicate UUID > > Steps: > 1) Define 2 domains,'default' and 'test', both with random UUID > 2) Reset the uuid of the second domain, 'test', to the uuid of the > first domain, using ModifySystemSettings > 3) The verify the assigned uuid > > The test does not behave as expected, either at step 2 when ModifySystemSetting > is called, an error should be returned for the duplicate UUID or at step 3 > when we check for the assigned UUID, it should be different from the UUID of > the first domain, neither of this happens. I have filed the bug 00016 > regarding this issue. > > Signed-off-by: Yogananth Subramanian > > diff -r 12fd8bac01f2 -r 87e175898a31 suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py Tue Aug 11 03:33:29 2009 -0700 > @@ -0,0 +1,115 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Yogananth Subramanian > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU 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 > +# General Public License for more details. > +# > +# You should have received a copy of the GNU 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 > +# > +#Steps: > +#1) Define 2 domains,'default' and 'test', both with random UUID > +#2) Reset the uuid of the second domain, 'test', to the uuid of the > +# first domain, using ModifySystemSettings > +#3) The verify the assigned uuid > +# > + > +import sys > +import time > +from XenKvmLib import vsms > +from XenKvmLib import vxml > +from CimTest.Globals import logger > +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC > +from XenKvmLib.const import do_main > +from XenKvmLib.classes import get_typed_class, inst_to_mof > +from XenKvmLib.enumclass import GetInstance > + > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > +default_dom = 'uuid_domain' > +test_dom = 'test_domain' > +nmac = '99:aa:bb:cc:ee:ff' > +bug_libvirt = "00016" > + > +def get_vssd(ip, virt, get_cim_inst, default_dom): > + cn = get_typed_class(virt, "VirtualSystemSettingData") > + inst = None > + > + try: > + if virt == "XenFV": > + virt = "Xen" > + > + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } > + inst = GetInstance(ip, cn, key_list, get_cim_inst) > + > + except Exception, details: > + logger.error(details) > + return FAIL, inst > + > + if inst is None: > + return FAIL, inst > + > + return PASS, inst > + > + at do_main(sup_types) > +def main(): > + options = main.options > + > + service = vsms.get_vsms_class(options.virt)(options.ip) > + > + cxml = vxml.get_class(options.virt)(default_dom) > + ret = cxml.cim_define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) > + return FAIL > you could move the cim_define() inside the try block. > + > + try: > + status, inst = get_vssd(options.ip, options.virt, True,default_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s"% > + default_dom) > + > + uuid = inst['UUID'] > + > + sxml = vxml.get_class(options.virt)(test_dom, uuid=uuid, mac=nmac) > + ret = sxml.cim_define(options.ip) > Since you are using the UUID of the first domain while defining the second domain the test fails here with the following error: ERROR - (1, u"CIM_ERR_FAILED: Failed to define domain: operation failed: domain 'uuid_domain' is already defined with uuid 700ef91b-4eb9-4290-8c46-da67d860bb46") InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define domain: operation failed: domain 'uuid_domain' is already defined with uuid 700ef91b-4eb9-4290-8c46-da67d860bb46 You, dont need to assign the uuid here while defining the domain,lets allow the providers to assign the fresh uuid to the second domain first. > + if not ret: > + raise Exception("Failed to define the dom: %s"% test_dom) > need a space before % > + > + status, inst = get_vssd(options.ip, options.virt, True,test_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s"% > need a space before % > + test_dom) > + > + inst['UUID'] = uuid > + vssd = inst_to_mof(inst) > + ret = service.ModifySystemSettings(SystemSettings=vssd) > The ModifySystemSettings() was able to give me the following appropriate error when I tried modifying the second domains UUID with the first ones UUID. Heres the exception I got which needs to be verified: "InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define domain: operation failed: domain 'uuid_domain' is already defined with uuid e9db9af2-3281-4905-b81d-35144daaefb9" I did not see any problem with provider not being able to report the duplicate UUID. > + > + if inst['UUID'] == uuid and ret[0]== 0 : > + sxml.undefine(options.ip) > + logger.error("The domains %s and %s have the same UUID", > + default_dom,test_dom) > + status = XFAIL_RC(bug_libvirt) > + > + except Exception, details: > + logger.error(details) > + status = FAIL > You need to capture the exception "InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define domain: operation failed: domain 'uuid_domain' is already defined with uuid e9db9af2-3281-4905-b81d-35144daaefb9" and validate it here in the except block. You could do something like: except Exception, (rc, desc): exp_desc = "Failed to define domain: operation failed: domain 'uuid_domain' is already defined with uuid" status = FAIL if rc == pywbem.CIM_ERR_FAILED and exp_desc in desc: status = PASS logger.error("Got the expected exception from ModifySystemSettings") > + > + sxml.undefine(options.ip) > + cxml.undefine(options.ip) > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > + > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From anantyog at linux.vnet.ibm.com Tue Aug 11 15:06:58 2009 From: anantyog at linux.vnet.ibm.com (yogi) Date: Tue, 11 Aug 2009 20:36:58 +0530 Subject: [Libvirt-cim] [PATCH] [Test]Testcase to check for duplicate UUID In-Reply-To: <4A818114.3090902@linux.vnet.ibm.com> References: <87e175898a31e7866d67.1249986958@elm3b151.beaverton.ibm.com> <4A818114.3090902@linux.vnet.ibm.com> Message-ID: <1250003219.4544.13.camel@yogi-laptop> On Tue, 2009-08-11 at 20:02 +0530, Deepti B Kalakeri wrote: > > Yogananth Subramanian wrote: > > # HG changeset patch > > # User anantyog at in.ibm.com > > # Date 1249986809 25200 > > # Node ID 87e175898a31e7866d67349e349fad34f8d0bb01 > > # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b > > [Test]Testcase to check for duplicate UUID > > > > Steps: > > 1) Define 2 domains,'default' and 'test', both with random UUID > > 2) Reset the uuid of the second domain, 'test', to the uuid of the > > first domain, using ModifySystemSettings > > 3) The verify the assigned uuid > > > > The test does not behave as expected, either at step 2 when ModifySystemSetting > > is called, an error should be returned for the duplicate UUID or at step 3 > > when we check for the assigned UUID, it should be different from the UUID of > > the first domain, neither of this happens. I have filed the bug 00016 > > regarding this issue. > > > > Signed-off-by: Yogananth Subramanian > > > > diff -r 12fd8bac01f2 -r 87e175898a31 suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py > > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > > +++ b/suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py Tue Aug 11 03:33:29 2009 -0700 > > @@ -0,0 +1,115 @@ > > +#!/usr/bin/python > > +# > > +# Copyright 2009 IBM Corp. > > +# > > +# Authors: > > +# Yogananth Subramanian > > +# > > +# This library is free software; you can redistribute it and/or > > +# modify it under the terms of the GNU 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 > > +# General Public License for more details. > > +# > > +# You should have received a copy of the GNU 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 > > +# > > +#Steps: > > +#1) Define 2 domains,'default' and 'test', both with random UUID > > +#2) Reset the uuid of the second domain, 'test', to the uuid of the > > +# first domain, using ModifySystemSettings > > +#3) The verify the assigned uuid > > +# > > + > > +import sys > > +import time > > +from XenKvmLib import vsms > > +from XenKvmLib import vxml > > +from CimTest.Globals import logger > > +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC > > +from XenKvmLib.const import do_main > > +from XenKvmLib.classes import get_typed_class, inst_to_mof > > +from XenKvmLib.enumclass import GetInstance > > + > > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > > +default_dom = 'uuid_domain' > > +test_dom = 'test_domain' > > +nmac = '99:aa:bb:cc:ee:ff' > > +bug_libvirt = "00016" > > + > > +def get_vssd(ip, virt, get_cim_inst, default_dom): > > + cn = get_typed_class(virt, "VirtualSystemSettingData") > > + inst = None > > + > > + try: > > + if virt == "XenFV": > > + virt = "Xen" > > + > > + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } > > + inst = GetInstance(ip, cn, key_list, get_cim_inst) > > + > > + except Exception, details: > > + logger.error(details) > > + return FAIL, inst > > + > > + if inst is None: > > + return FAIL, inst > > + > > + return PASS, inst > > + > > + at do_main(sup_types) > > +def main(): > > + options = main.options > > + > > + service = vsms.get_vsms_class(options.virt)(options.ip) > > + > > + cxml = vxml.get_class(options.virt)(default_dom) > > + ret = cxml.cim_define(options.ip) > > + if not ret: > > + logger.error("Failed to define the dom: %s", default_dom) > > + return FAIL > > > you could move the cim_define() inside the try block. > > + > > + try: > > + status, inst = get_vssd(options.ip, options.virt, True,default_dom) > > + if status != PASS: > > + raise Exception("Failed to get the VSSD instance for %s"% > > + default_dom) > > + > > + uuid = inst['UUID'] > > + > > + sxml = vxml.get_class(options.virt)(test_dom, uuid=uuid, mac=nmac) > > + ret = sxml.cim_define(options.ip) > > > Since you are using the UUID of the first domain while defining the > second domain the test fails here with the following error: > > ERROR - (1, u"CIM_ERR_FAILED: Failed to define domain: operation failed: > domain 'uuid_domain' is already defined with uuid > 700ef91b-4eb9-4290-8c46-da67d860bb46") > InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define > domain: operation failed: domain 'uuid_domain' is already defined with > uuid 700ef91b-4eb9-4290-8c46-da67d860bb46 > Srry for this, the behavior on the machine I am using is completely different. It does not throw "CIM_ERR_FAILED" when a domain is defined with duplicate UUID. I will update my providers and resubmit the patches again. Was using openpegasus with Revision="934" > You, dont need to assign the uuid here while defining the domain,lets > allow the providers to assign the fresh uuid to the second domain first. > > + if not ret: > > + raise Exception("Failed to define the dom: %s"% test_dom) > > > need a space before % > > + > > + status, inst = get_vssd(options.ip, options.virt, True,test_dom) > > + if status != PASS: > > + raise Exception("Failed to get the VSSD instance for %s"% > > > need a space before % > > + test_dom) > > + > > + inst['UUID'] = uuid > > + vssd = inst_to_mof(inst) > > + ret = service.ModifySystemSettings(SystemSettings=vssd) > > > The ModifySystemSettings() was able to give me the following appropriate > error when I tried modifying the second domains UUID with the first ones > UUID. > Heres the exception I got which needs to be verified: > > "InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define > domain: operation failed: domain 'uuid_domain' is already defined with > uuid e9db9af2-3281-4905-b81d-35144daaefb9" > > I did not see any problem with provider not being able to report the > duplicate UUID. > > + > > + if inst['UUID'] == uuid and ret[0]== 0 : > > + sxml.undefine(options.ip) > > + logger.error("The domains %s and %s have the same UUID", > > + default_dom,test_dom) > > + status = XFAIL_RC(bug_libvirt) > > + > > + except Exception, details: > > + logger.error(details) > > + status = FAIL > > > You need to capture the exception "InvokeMethod(ModifySystemSettings): > CIM_ERR_FAILED: Failed to define domain: operation failed: domain > 'uuid_domain' is already defined with uuid > e9db9af2-3281-4905-b81d-35144daaefb9" and validate it here in the except > block. > You could do something like: > > except Exception, (rc, desc): > exp_desc = "Failed to define domain: operation failed: domain > 'uuid_domain' is already defined with uuid" > status = FAIL > if rc == pywbem.CIM_ERR_FAILED and exp_desc in desc: > status = PASS > logger.error("Got the expected exception from ModifySystemSettings") > > > + > > + sxml.undefine(options.ip) > > + cxml.undefine(options.ip) > > + return status > > + > > +if __name__ == "__main__": > > + sys.exit(main()) > > + > > > > _______________________________________________ > > Libvirt-cim mailing list > > Libvirt-cim at redhat.com > > https://www.redhat.com/mailman/listinfo/libvirt-cim > > > From jfehlig at novell.com Tue Aug 11 16:44:45 2009 From: jfehlig at novell.com (Jim Fehlig) Date: Tue, 11 Aug 2009 10:44:45 -0600 Subject: [Libvirt-cim] [PATCH] Add LibvirtVersion to VSMS In-Reply-To: <4A80897F.9090402@linux.vnet.ibm.com> References: <4A80897F.9090402@linux.vnet.ibm.com> Message-ID: <4A819FFD.1060808@novell.com> Kaitlin Rupert wrote: > Thanks Jim! This looks good, I've got a minor change below... > >> @@ -2483,6 +2485,25 @@ >> CMSetProperty(inst, "Caption", >> (CMPIValue *)"Unknown Hypervisor", CMPI_chars); >> >> + if (virGetVersion(&lv_version, hv_type, &hv_version) < 0) { >> + CU_DEBUG("Unable to get libvirt version"); >> + lv_version= 0; >> + hv_version= 0; >> + } >> + >> + if (asprintf(&lv_version_string, "%lu.%lu.%lu", >> + lv_version / 1000000, >> + (lv_version % 1000000) / 1000, >> + (lv_version % 1000000) % 1000) == -1) >> + lv_version_string = NULL; >> + >> + if (lv_version_string != NULL) >> + CMSetProperty(inst, "LibvirtVersion", >> + (CMPIValue *)lv_version_string, CMPI_chars); >> + else >> + CMSetProperty(inst, "LibvirtVersion", >> + (CMPIValue *)"Unknown libvirt", CMPI_chars); >> + > > Instead of the if / else here, in the case when lv_version_string, can > you assign it the value of "Unknown libvirt". Then you can just call > CMSetProperty() with lv_version_string, as lv_version_string shouldn't > be NULL at that point. This approach is more inline with the > convention followed up the rest of the code. I was following the convention established by the Caption property, which includes the hypervisor version. If asprintf() fails (most likely because of memory allocation failure), I would need to dup "Unkown libvirt version" in lv_version_string, which would also fail :-). I could assign the static string to another variable, but I don't think that is any better than the current logic. > Also, I think "Unknown libvirt version" is a little more clear. Agreed. I'll wait for your advice on the above before submitting a follow up patch. Thanks, Jim From deeptik at linux.vnet.ibm.com Tue Aug 11 17:15:35 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 11 Aug 2009 22:45:35 +0530 Subject: [Libvirt-cim] [PATCH] [Test]Testcase to check for duplicate UUID In-Reply-To: <1250003219.4544.13.camel@yogi-laptop> References: <87e175898a31e7866d67.1249986958@elm3b151.beaverton.ibm.com> <4A818114.3090902@linux.vnet.ibm.com> <1250003219.4544.13.camel@yogi-laptop> Message-ID: <4A81A737.5020102@linux.vnet.ibm.com> yogi wrote: > On Tue, 2009-08-11 at 20:02 +0530, Deepti B Kalakeri wrote: > >> Yogananth Subramanian wrote: >> >>> # HG changeset patch >>> # User anantyog at in.ibm.com >>> # Date 1249986809 25200 >>> # Node ID 87e175898a31e7866d67349e349fad34f8d0bb01 >>> # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b >>> [Test]Testcase to check for duplicate UUID >>> >>> Steps: >>> 1) Define 2 domains,'default' and 'test', both with random UUID >>> 2) Reset the uuid of the second domain, 'test', to the uuid of the >>> first domain, using ModifySystemSettings >>> 3) The verify the assigned uuid >>> >>> The test does not behave as expected, either at step 2 when ModifySystemSetting >>> is called, an error should be returned for the duplicate UUID or at step 3 >>> when we check for the assigned UUID, it should be different from the UUID of >>> the first domain, neither of this happens. I have filed the bug 00016 >>> regarding this issue. >>> >>> Signed-off-by: Yogananth Subramanian >>> >>> diff -r 12fd8bac01f2 -r 87e175898a31 suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ b/suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py Tue Aug 11 03:33:29 2009 -0700 >>> @@ -0,0 +1,115 @@ >>> +#!/usr/bin/python >>> +# >>> +# Copyright 2009 IBM Corp. >>> +# >>> +# Authors: >>> +# Yogananth Subramanian >>> +# >>> +# This library is free software; you can redistribute it and/or >>> +# modify it under the terms of the GNU 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 >>> +# General Public License for more details. >>> +# >>> +# You should have received a copy of the GNU 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 >>> +# >>> +#Steps: >>> +#1) Define 2 domains,'default' and 'test', both with random UUID >>> +#2) Reset the uuid of the second domain, 'test', to the uuid of the >>> +# first domain, using ModifySystemSettings >>> +#3) The verify the assigned uuid >>> +# >>> + >>> +import sys >>> +import time >>> +from XenKvmLib import vsms >>> +from XenKvmLib import vxml >>> +from CimTest.Globals import logger >>> +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC >>> +from XenKvmLib.const import do_main >>> +from XenKvmLib.classes import get_typed_class, inst_to_mof >>> +from XenKvmLib.enumclass import GetInstance >>> + >>> +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] >>> +default_dom = 'uuid_domain' >>> +test_dom = 'test_domain' >>> +nmac = '99:aa:bb:cc:ee:ff' >>> +bug_libvirt = "00016" >>> + >>> +def get_vssd(ip, virt, get_cim_inst, default_dom): >>> + cn = get_typed_class(virt, "VirtualSystemSettingData") >>> + inst = None >>> + >>> + try: >>> + if virt == "XenFV": >>> + virt = "Xen" >>> + >>> + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } >>> + inst = GetInstance(ip, cn, key_list, get_cim_inst) >>> + >>> + except Exception, details: >>> + logger.error(details) >>> + return FAIL, inst >>> + >>> + if inst is None: >>> + return FAIL, inst >>> + >>> + return PASS, inst >>> + >>> + at do_main(sup_types) >>> +def main(): >>> + options = main.options >>> + >>> + service = vsms.get_vsms_class(options.virt)(options.ip) >>> + >>> + cxml = vxml.get_class(options.virt)(default_dom) >>> + ret = cxml.cim_define(options.ip) >>> + if not ret: >>> + logger.error("Failed to define the dom: %s", default_dom) >>> + return FAIL >>> >>> >> you could move the cim_define() inside the try block. >> >>> + >>> + try: >>> + status, inst = get_vssd(options.ip, options.virt, True,default_dom) >>> + if status != PASS: >>> + raise Exception("Failed to get the VSSD instance for %s"% >>> + default_dom) >>> + >>> + uuid = inst['UUID'] >>> + >>> + sxml = vxml.get_class(options.virt)(test_dom, uuid=uuid, mac=nmac) >>> + ret = sxml.cim_define(options.ip) >>> >>> >> Since you are using the UUID of the first domain while defining the >> second domain the test fails here with the following error: >> >> ERROR - (1, u"CIM_ERR_FAILED: Failed to define domain: operation failed: >> domain 'uuid_domain' is already defined with uuid >> 700ef91b-4eb9-4290-8c46-da67d860bb46") >> InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define >> domain: operation failed: domain 'uuid_domain' is already defined with >> uuid 700ef91b-4eb9-4290-8c46-da67d860bb46 >> >> > Srry for this, the behavior on the machine I am using is completely > different. It does not throw "CIM_ERR_FAILED" when a domain is defined > with duplicate UUID. > I will update my providers and resubmit the patches again. > Was using openpegasus with Revision="934" > > > Hey thats no problem. Sure. Thanks for submitting the test case though. > >> You, dont need to assign the uuid here while defining the domain,lets >> allow the providers to assign the fresh uuid to the second domain first. >> >>> + if not ret: >>> + raise Exception("Failed to define the dom: %s"% test_dom) >>> >>> >> need a space before % >> >>> + >>> + status, inst = get_vssd(options.ip, options.virt, True,test_dom) >>> + if status != PASS: >>> + raise Exception("Failed to get the VSSD instance for %s"% >>> >>> >> need a space before % >> >>> + test_dom) >>> + >>> + inst['UUID'] = uuid >>> + vssd = inst_to_mof(inst) >>> + ret = service.ModifySystemSettings(SystemSettings=vssd) >>> >>> >> The ModifySystemSettings() was able to give me the following appropriate >> error when I tried modifying the second domains UUID with the first ones >> UUID. >> Heres the exception I got which needs to be verified: >> >> "InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define >> domain: operation failed: domain 'uuid_domain' is already defined with >> uuid e9db9af2-3281-4905-b81d-35144daaefb9" >> >> I did not see any problem with provider not being able to report the >> duplicate UUID. >> >>> + >>> + if inst['UUID'] == uuid and ret[0]== 0 : >>> + sxml.undefine(options.ip) >>> + logger.error("The domains %s and %s have the same UUID", >>> + default_dom,test_dom) >>> + status = XFAIL_RC(bug_libvirt) >>> + >>> + except Exception, details: >>> + logger.error(details) >>> + status = FAIL >>> >>> >> You need to capture the exception "InvokeMethod(ModifySystemSettings): >> CIM_ERR_FAILED: Failed to define domain: operation failed: domain >> 'uuid_domain' is already defined with uuid >> e9db9af2-3281-4905-b81d-35144daaefb9" and validate it here in the except >> block. >> You could do something like: >> >> except Exception, (rc, desc): >> exp_desc = "Failed to define domain: operation failed: domain >> 'uuid_domain' is already defined with uuid" >> status = FAIL >> if rc == pywbem.CIM_ERR_FAILED and exp_desc in desc: >> status = PASS >> logger.error("Got the expected exception from ModifySystemSettings") >> >> >>> + >>> + sxml.undefine(options.ip) >>> + cxml.undefine(options.ip) >>> + return status >>> + >>> +if __name__ == "__main__": >>> + sys.exit(main()) >>> + >>> >>> _______________________________________________ >>> 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 > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Aug 11 18:10:40 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 11 Aug 2009 11:10:40 -0700 Subject: [Libvirt-cim] [PATCH] Add LibvirtVersion to VSMS In-Reply-To: <4A819FFD.1060808@novell.com> References: <4A80897F.9090402@linux.vnet.ibm.com> <4A819FFD.1060808@novell.com> Message-ID: <4A81B420.9010703@linux.vnet.ibm.com> Jim Fehlig wrote: > Kaitlin Rupert wrote: >> Thanks Jim! This looks good, I've got a minor change below... >> >>> @@ -2483,6 +2485,25 @@ >>> CMSetProperty(inst, "Caption", >>> (CMPIValue *)"Unknown Hypervisor", CMPI_chars); >>> >>> + if (virGetVersion(&lv_version, hv_type, &hv_version) < 0) { >>> + CU_DEBUG("Unable to get libvirt version"); >>> + lv_version= 0; >>> + hv_version= 0; >>> + } >>> + >>> + if (asprintf(&lv_version_string, "%lu.%lu.%lu", >>> + lv_version / 1000000, >>> + (lv_version % 1000000) / 1000, >>> + (lv_version % 1000000) % 1000) == -1) >>> + lv_version_string = NULL; >>> + >>> + if (lv_version_string != NULL) >>> + CMSetProperty(inst, "LibvirtVersion", >>> + (CMPIValue *)lv_version_string, CMPI_chars); >>> + else >>> + CMSetProperty(inst, "LibvirtVersion", >>> + (CMPIValue *)"Unknown libvirt", CMPI_chars); >>> + >> Instead of the if / else here, in the case when lv_version_string, can >> you assign it the value of "Unknown libvirt". Then you can just call >> CMSetProperty() with lv_version_string, as lv_version_string shouldn't >> be NULL at that point. This approach is more inline with the >> convention followed up the rest of the code. > > I was following the convention established by the Caption property, As, you're right. My mistake. Generally, we do something like: if (str == NULL) str = strdup(val); //Call CMSetProperty() here > which includes the hypervisor version. If asprintf() fails (most likely > because of memory allocation failure), I would need to dup "Unkown > libvirt version" in lv_version_string, which would also fail :-). I > could assign the static string to another variable, but I don't think > that is any better than the current logic. Yes, agreed. It's fine to leave it as is. I missed seeing that Caption was assigned using this approach. > >> Also, I think "Unknown libvirt version" is a little more clear. > > Agreed. I'll wait for your advice on the above before submitting a > follow up patch. > > Thanks, > Jim > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From jfehlig at novell.com Tue Aug 11 20:16:52 2009 From: jfehlig at novell.com (Jim Fehlig) Date: Tue, 11 Aug 2009 14:16:52 -0600 Subject: [Libvirt-cim] [PATCH] (#2) Add LibvirtVersion to VSMS Message-ID: <9bb1d8852a07160ab0d4.1250021812@linux-f24u.site> # HG changeset patch # User Jim Fehlig # Date 1250021734 21600 # Node ID 9bb1d8852a07160ab0d4572d55a4ea21db830e12 # Parent 2de7d9bdb9af3414ddc01f28d7a007d6c3d19bbc (#2) Add LibvirtVersion to VSMS I've had users ask for libvirt version available through libvirt-cim. This patch add LibvirtVersion property to VSMS, which is a proxy for libvirt and seems the most appropriate place to add the property. I consider VSMSC, but that class describes what the associated service is capable of as opposed to version information about the service. #2: If unable to determine libvirt version, set property to "Unknown libvirt version" instead of "Unknown libvirt". Signed-off-by: Jim Fehlig diff -r 2de7d9bdb9af -r 9bb1d8852a07 schema/VirtualSystemManagementService.mof --- a/schema/VirtualSystemManagementService.mof Fri Aug 07 15:53:57 2009 -0700 +++ b/schema/VirtualSystemManagementService.mof Tue Aug 11 14:15:34 2009 -0600 @@ -11,6 +11,9 @@ [Description("Package Version")] string Release; + + [Description("libvirt Version")] + string LibvirtVersion; }; [Provider("cmpi::Virt_VirtualSystemManagementService")] @@ -24,6 +27,9 @@ [Description("Package Version")] string Release; + + [Description("libvirt Version")] + string LibvirtVersion; }; [Provider("cmpi::Virt_VirtualSystemManagementService")] @@ -37,4 +43,7 @@ [Description("Package Version")] string Release; + + [Description("libvirt Version")] + string LibvirtVersion; }; diff -r 2de7d9bdb9af -r 9bb1d8852a07 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri Aug 07 15:53:57 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Tue Aug 11 14:15:34 2009 -0600 @@ -2418,8 +2418,10 @@ const char *ccname = NULL; virConnectPtr conn = NULL; unsigned long hv_version = 0; + unsigned long lv_version = 0; const char * hv_type = NULL; char *caption = NULL; + char *lv_version_string = NULL; CMPIArray *array; uint16_t op_status; @@ -2483,6 +2485,26 @@ CMSetProperty(inst, "Caption", (CMPIValue *)"Unknown Hypervisor", CMPI_chars); + if (virGetVersion(&lv_version, hv_type, &hv_version) < 0) { + CU_DEBUG("Unable to get libvirt version"); + lv_version= 0; + hv_version= 0; + } + + if (asprintf(&lv_version_string, "%lu.%lu.%lu", + lv_version / 1000000, + (lv_version % 1000000) / 1000, + (lv_version % 1000000) % 1000) == -1) + lv_version_string = NULL; + + if (lv_version_string != NULL) + CMSetProperty(inst, "LibvirtVersion", + (CMPIValue *)lv_version_string, CMPI_chars); + else + CMSetProperty(inst, "LibvirtVersion", + (CMPIValue *)"Unknown libvirt version", + CMPI_chars); + CMSetProperty(inst, "Name", (CMPIValue *)"Management Service", CMPI_chars); @@ -2522,6 +2544,7 @@ ""); out: free(caption); + free(lv_version_string); virConnectClose(conn); *_inst = inst; From kaitlin at linux.vnet.ibm.com Tue Aug 11 20:19:24 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 11 Aug 2009 13:19:24 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Add support for generating image XML Message-ID: From kaitlin at linux.vnet.ibm.com Tue Aug 11 20:19:25 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 11 Aug 2009 13:19:25 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Image Creation: add functions for generating a storage volume XML In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1245187550 25200 # Node ID ffc93d36908aa5fca483fc650393802383409890 # Parent 615da7491c145fa283e658df520fd9e31615f4d4 Image Creation: add functions for generating a storage volume XML Signed-off-by: Kaitlin Rupert diff -r 615da7491c14 -r ffc93d36908a libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Mon Aug 10 13:52:58 2009 -0700 +++ b/libxkutil/xmlgen.c Tue Jun 16 14:25:50 2009 -0700 @@ -39,6 +39,7 @@ typedef const char *(*devfn_t)(xmlNodePtr node, struct domain *dominfo); typedef const char *(*poolfn_t)(xmlNodePtr node, struct virt_pool *pool); +typedef const char *(*resfn_t)(xmlNodePtr node, struct virt_pool_res *res); static char *disk_block_xml(xmlNodePtr root, struct disk_device *dev) { @@ -1056,6 +1057,133 @@ return xml; } +static const char *vol_format_type_to_str(uint16_t type) +{ + switch (type) { + case VOL_FORMAT_RAW: + return "raw"; + default: + CU_DEBUG("Unsupported storage volume type"); + } + + return NULL; +} + +static const char *storage_vol_xml(xmlNodePtr root, + struct virt_pool_res *res) +{ + xmlNodePtr v = NULL; + xmlNodePtr name = NULL; + xmlNodePtr alloc = NULL; + xmlNodePtr cap = NULL; + xmlNodePtr target = NULL; + xmlNodePtr path = NULL; + xmlNodePtr format = NULL; + const char *type = NULL; + struct storage_vol *vol = &res->res.storage_vol; + char *string = NULL; + int ret; + + type = vol_format_type_to_str(vol->format_type); + if (type == NULL) + goto out; + + v = xmlNewChild(root, NULL, BAD_CAST "volume", NULL); + if (v == NULL) + goto out; + + name = xmlNewChild(v, NULL, BAD_CAST "name", BAD_CAST vol->vol_name); + if (name == NULL) + goto out; + + ret = asprintf(&string, "%" PRIu16, vol->alloc); + if (ret == -1) + return XML_ERROR; + + alloc = xmlNewChild(v, NULL, BAD_CAST "allocation", BAD_CAST string); + if (alloc == NULL) + goto out; + + free(string); + ret = asprintf(&string, "%" PRIu16, vol->cap); + if (ret == -1) + return XML_ERROR; + + cap = xmlNewChild(v, NULL, BAD_CAST "capacity", BAD_CAST string); + if (cap == NULL) + goto out; + + free(string); + + if (xmlNewProp(cap, BAD_CAST "unit", BAD_CAST vol->cap_units) == NULL) + goto out; + + target = xmlNewChild(v, NULL, BAD_CAST "target", NULL); + if (target == NULL) + goto out; + + path = xmlNewChild(target, NULL, BAD_CAST "path", BAD_CAST vol->path); + if (path == NULL) + goto out; + + format = xmlNewChild(target, NULL, BAD_CAST "format", NULL); + if (format == NULL) + goto out; + + if (xmlNewProp(format, BAD_CAST "type", BAD_CAST type) == NULL) + goto out; + + /* FIXME: Need to add permissions and label tags here */ + + return NULL; + + out: + free(string); + return XML_ERROR; + } + +char *res_to_xml(struct virt_pool_res *res) { + char *xml = NULL; + xmlNodePtr root = NULL; + int type = res->type; + const char *msg = NULL; + resfn_t func; + + root = xmlNewNode(NULL, BAD_CAST "tmp"); + if (root == NULL) { + msg = XML_ERROR; + goto out; + } + + switch (type) { + case CIM_RES_TYPE_IMAGE: + func = storage_vol_xml; + break; + default: + CU_DEBUG("res_to_xml: invalid type specified: %d", type); + msg = "res_to_xml: invalid type specified"; + goto out; + } + + msg = func(root, res); + if (msg != NULL) + goto out; + + xml = tree_to_xml(root->children); + if (xml == NULL) + msg = "XML generation failed"; + out: + if (msg != NULL) { + CU_DEBUG("Failed to create res XML: %s", msg); + } else { + CU_DEBUG("Created res XML:\n%s\n", xml); + } + + xmlFreeNode(root); + + return xml; +} + /* * Local Variables: * mode: C diff -r 615da7491c14 -r ffc93d36908a libxkutil/xmlgen.h --- a/libxkutil/xmlgen.h Mon Aug 10 13:52:58 2009 -0700 +++ b/libxkutil/xmlgen.h Tue Jun 16 14:25:50 2009 -0700 @@ -36,4 +36,6 @@ char *pool_to_xml(struct virt_pool *pool); +char *res_to_xml(struct virt_pool_res *res); + #endif From kaitlin at linux.vnet.ibm.com Tue Aug 11 20:19:26 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 11 Aug 2009 13:19:26 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Image creation: Add support for CreateResourceInPool() method In-Reply-To: References: Message-ID: <2fb0663546797c778111.1250021966@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1245187550 25200 # Node ID 2fb0663546797c7781119063dc6ad3af2c090e83 # Parent ffc93d36908aa5fca483fc650393802383409890 Image creation: Add support for CreateResourceInPool() method Signed-off-by: Kaitlin Rupert diff -r ffc93d36908a -r 2fb066354679 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Tue Jun 16 14:25:50 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Tue Jun 16 14:25:50 2009 -0700 @@ -784,6 +784,9 @@ CMPIObjectPath *pool; struct virt_pool_res *res = NULL; const char* msg = NULL; + const char *id = NULL; + char *pool_id = NULL; + char *xml = NULL; CU_DEBUG("CreateResourceInPool"); @@ -808,12 +811,44 @@ goto out; } + if (cu_get_str_path(pool, "InstanceID", &id) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing InstanceID in resource pool"); + goto out; + } + + pool_id = name_from_pool_id(id); + if (pool_id == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Pool has invalid InstanceID"); + goto out; + } + + free(res->pool_id); + res->pool_id = strdup(pool_id); + + xml = res_to_xml(res); + if (xml == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to generate XML for new resource"); + goto out; + } + + CU_DEBUG("New resource XML:\n%s", xml); + + /*FIXME: Add resource here */ + + out: + free(pool_id); + free(xml); + if (s.rc == CMPI_RC_OK) rc = CIM_SVPC_RETURN_COMPLETED; CMReturnData(results, &rc, CMPI_uint32); - out: - return s; } From kaitlin at linux.vnet.ibm.com Tue Aug 11 22:03:30 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 11 Aug 2009 15:03:30 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Add test for verifying disabled RequestStateChange() In-Reply-To: <4A8178E3.1050808@linux.vnet.ibm.com> References: <9f740b6fe6cfe4131751.1249947899@elm3a148.beaverton.ibm.com> <4A8178E3.1050808@linux.vnet.ibm.com> Message-ID: <4A81EAB2.3030609@linux.vnet.ibm.com> >> +# information is captured in the RequestedState Property of the VS. >> +# The test is considered to be successful if RequestedState Property >> +# has a value of 3 when the VS is moved from active state to a >> disabled state. >> > The test case does not verify the value if EnabledState is set to 3. > Did you miss adding it ? No, it should. I forgot this. Plus, this comment isn't totally accurate, because the behavior will be different depending on the provider version. >> +# >> +# Date: 08-07-2009 >> + >> +import sys >> +from CimTest.Globals import logger >> +from XenKvmLib.const import do_main >> +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC >> > XFAIL_RC is not needed Good call. >> + >> + cxml.cim_destroy(server) >> > We do not require cim_destroy if cim_disable is successful. With the older versions of the providers, we do. Because with the other versions. disable is mapped to a reboot. >> + cxml.undefine(server) >> + -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Aug 11 22:41:03 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 11 Aug 2009 15:41:03 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Don't force the MAC address for all guests Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1250030447 25200 # Node ID ad3738df2b5f64ce7e8523e380f77a67b44d1fdd # Parent 302b70f9ef5dea6cc4f5c685718cf7d8cfea8a60 [TEST] Don't force the MAC address for all guests. The providers will set a MAC in the case one isn't specified. This will prevent address clashes in the case a guest isn't cleaned up properly. Signed-off-by: Kaitlin Rupert diff -r 302b70f9ef5d -r ad3738df2b5f suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Aug 11 06:25:13 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Aug 11 15:40:47 2009 -0700 @@ -791,7 +791,7 @@ mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, - mac=const.Xen_default_mac, + mac=None, disk_file_path=const.Xen_disk_path, disk=const.Xen_default_disk_dev, ntype=const.default_net_type, @@ -857,7 +857,7 @@ mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, - mac=const.KVM_default_mac, + mac=None, disk_file_path=const.KVM_disk_path, disk=const.KVM_default_disk_dev, ntype=const.default_net_type, @@ -913,7 +913,7 @@ mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, - mac=const.XenFV_default_mac, + mac=None, disk_file_path=const.XenFV_disk_path, disk=const.XenFV_default_disk_dev, ntype=const.default_net_type, @@ -973,7 +973,7 @@ uuid=None, mem=const.default_memory, vcpus=const.default_vcpus, - mac=const.LXC_default_mac, + mac=None, ntype=const.default_net_type, net_name=const.default_network_name, tty=const.LXC_default_tty, grstype="vnc", From kaitlin at linux.vnet.ibm.com Tue Aug 11 22:53:50 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 11 Aug 2009 15:53:50 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Add test for verifying disabled RequestStateChange() Message-ID: <01244d56c0603ec80515.1250031230@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1249668560 25200 # Node ID 01244d56c0603ec80515823e50bd425ddb22f8a0 # Parent ad3738df2b5f64ce7e8523e380f77a67b44d1fdd [TEST] #2 Add test for verifying disabled RequestStateChange() Changes from 1 to 2: -Remove XFAIL -Be sure guest is in proper state after disabling it -Update test description Signed-off-by: Kaitlin Rupert diff -r ad3738df2b5f -r 01244d56c060 suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py Fri Aug 07 11:09:20 2009 -0700 @@ -0,0 +1,93 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Kaitlin Rupert +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +# Test Case Info: +# -------------- +# This test case is used to verify the Virtual System State Transition +# information is captured in the RequestedState Property of the VS. +# The test is considered to be successful if RequestedState Property +# has a value of enabled/disabled when the VS is moved from active state +# to a disabled state. +# +# For providers older than 945, the guest will be rebooted. Otherwise, it will +# be destroyed and placed in the 'defined' state. +# +# Date: 08-07-2009 + +import sys +from CimTest.Globals import logger +from XenKvmLib.const import do_main, CIM_ENABLE, CIM_DISABLE, \ + get_provider_version +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.vxml import get_class + +sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] + +default_dom = 'cs_test_domain' + +disable_change_rev = 945 + + at do_main(sup_types) +def main(): + options = main.options + status = FAIL + server = options.ip + virt = options.virt + + try: + cxml = get_class(virt)(default_dom) + ret = cxml.cim_define(server) + if not ret: + raise Exception("Failed to define the guest: %s" % default_dom) + + status = cxml.cim_start(server) + if status != PASS: + raise Exception("Unable start dom '%s'" % default_dom) + + status = cxml.cim_disable(server) + if status != PASS: + raise Exception("Unable disable dom '%s'" % default_dom) + + rev, changeset = get_provider_version(virt, server) + if rev >= disable_change_rev: + exp_state = CIM_DISABLE + else: + exp_state = CIM_ENABLE + + status = cxml.check_guest_state(server, exp_state) + if status != PASS: + raise Exception("%s not in expected state %d" % \ + (default_dom, exp_state)) + + except Exception, detail: + logger.error("Exception: %s", detail) + status = FAIL + + #Call destroy incase disable fails or for older provider + #version where disable causes guest to be rebooted + cxml.cim_destroy(server) + cxml.undefine(server) + + return status + +if __name__ == "__main__": + sys.exit(main()) From rmaciel at linux.vnet.ibm.com Wed Aug 12 02:23:35 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Tue, 11 Aug 2009 23:23:35 -0300 Subject: [Libvirt-cim] [PATCH 0 of 2] Add structure to hold image creation settings In-Reply-To: References: Message-ID: <4A8227A7.9030309@linux.vnet.ibm.com> +1 On 08/10/2009 05:55 PM, Kaitlin Rupert wrote: > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Wed Aug 12 03:21:16 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 12 Aug 2009 00:21:16 -0300 Subject: [Libvirt-cim] [PATCH 1 of 2] Image Creation: add functions for generating a storage volume XML In-Reply-To: References: Message-ID: <4A82352C.207@linux.vnet.ibm.com> On 08/11/2009 05:19 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1245187550 25200 > # Node ID ffc93d36908aa5fca483fc650393802383409890 > # Parent 615da7491c145fa283e658df520fd9e31615f4d4 > Image Creation: add functions for generating a storage volume XML > > Signed-off-by: Kaitlin Rupert > > diff -r 615da7491c14 -r ffc93d36908a libxkutil/xmlgen.c > --- a/libxkutil/xmlgen.c Mon Aug 10 13:52:58 2009 -0700 > +++ b/libxkutil/xmlgen.c Tue Jun 16 14:25:50 2009 -0700 > @@ -39,6 +39,7 @@ > > typedef const char *(*devfn_t)(xmlNodePtr node, struct domain *dominfo); > typedef const char *(*poolfn_t)(xmlNodePtr node, struct virt_pool *pool); > +typedef const char *(*resfn_t)(xmlNodePtr node, struct virt_pool_res *res); > > static char *disk_block_xml(xmlNodePtr root, struct disk_device *dev) > { > @@ -1056,6 +1057,133 @@ > return xml; > } > > +static const char *vol_format_type_to_str(uint16_t type) > +{ > + switch (type) { > + case VOL_FORMAT_RAW: > + return "raw"; > + default: > + CU_DEBUG("Unsupported storage volume type"); > + } > + > + return NULL; > +} > + > +static const char *storage_vol_xml(xmlNodePtr root, > + struct virt_pool_res *res) > +{ > + xmlNodePtr v = NULL; > + xmlNodePtr name = NULL; > + xmlNodePtr alloc = NULL; > + xmlNodePtr cap = NULL; > + xmlNodePtr target = NULL; > + xmlNodePtr path = NULL; > + xmlNodePtr format = NULL; > + const char *type = NULL; > + struct storage_vol *vol =&res->res.storage_vol; > + char *string = NULL; > + int ret; > + > + type = vol_format_type_to_str(vol->format_type); > + if (type == NULL) > + goto out; > + > + v = xmlNewChild(root, NULL, BAD_CAST "volume", NULL); > + if (v == NULL) > + goto out; > + > + name = xmlNewChild(v, NULL, BAD_CAST "name", BAD_CAST vol->vol_name); > + if (name == NULL) > + goto out; > + > + ret = asprintf(&string, "%" PRIu16, vol->alloc); > + if (ret == -1) > + return XML_ERROR; > + > + alloc = xmlNewChild(v, NULL, BAD_CAST "allocation", BAD_CAST string); > + if (alloc == NULL) > + goto out; > + > + free(string); > + ret = asprintf(&string, "%" PRIu16, vol->cap); > + if (ret == -1) > + return XML_ERROR; > + > + cap = xmlNewChild(v, NULL, BAD_CAST "capacity", BAD_CAST string); > + if (cap == NULL) > + goto out; > + > + free(string); > + > + if (xmlNewProp(cap, BAD_CAST "unit", BAD_CAST vol->cap_units) == NULL) > + goto out; > + > + target = xmlNewChild(v, NULL, BAD_CAST "target", NULL); > + if (target == NULL) > + goto out; > + > + path = xmlNewChild(target, NULL, BAD_CAST "path", BAD_CAST vol->path); > + if (path == NULL) > + goto out; > + > + format = xmlNewChild(target, NULL, BAD_CAST "format", NULL); > + if (format == NULL) > + goto out; > + > + if (xmlNewProp(format, BAD_CAST "type", BAD_CAST type) == NULL) > + goto out; > + > + /* FIXME: Need to add permissions and label tags here */ What about this fixme? > + > + return NULL; > + > + out: > + free(string); > + return XML_ERROR; > + } > + > +char *res_to_xml(struct virt_pool_res *res) { > + char *xml = NULL; > + xmlNodePtr root = NULL; > + int type = res->type; > + const char *msg = NULL; > + resfn_t func; > + > + root = xmlNewNode(NULL, BAD_CAST "tmp"); > + if (root == NULL) { > + msg = XML_ERROR; > + goto out; > + } > + > + switch (type) { > + case CIM_RES_TYPE_IMAGE: > + func = storage_vol_xml; > + break; > + default: > + CU_DEBUG("res_to_xml: invalid type specified: %d", type); > + msg = "res_to_xml: invalid type specified"; > + goto out; > + } > + > + msg = func(root, res); > + if (msg != NULL) > + goto out; > + > + xml = tree_to_xml(root->children); > + if (xml == NULL) > + msg = "XML generation failed"; > + out: > + if (msg != NULL) { > + CU_DEBUG("Failed to create res XML: %s", msg); > + } else { > + CU_DEBUG("Created res XML:\n%s\n", xml); > + } > + > + xmlFreeNode(root); > + > + return xml; > +} > + > /* > * Local Variables: > * mode: C > diff -r 615da7491c14 -r ffc93d36908a libxkutil/xmlgen.h > --- a/libxkutil/xmlgen.h Mon Aug 10 13:52:58 2009 -0700 > +++ b/libxkutil/xmlgen.h Tue Jun 16 14:25:50 2009 -0700 > @@ -36,4 +36,6 @@ > > char *pool_to_xml(struct virt_pool *pool); > > +char *res_to_xml(struct virt_pool_res *res); > + > #endif > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 12 05:56:15 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 12 Aug 2009 11:26:15 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Add test for verifying disabled RequestStateChange() In-Reply-To: <01244d56c0603ec80515.1250031230@elm3a148.beaverton.ibm.com> References: <01244d56c0603ec80515.1250031230@elm3a148.beaverton.ibm.com> Message-ID: <4A82597F.4090404@linux.vnet.ibm.com> +1 -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 12 06:04:23 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 12 Aug 2009 11:34:23 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Don't force the MAC address for all guests In-Reply-To: References: Message-ID: <4A825B67.7020909@linux.vnet.ibm.com> +1 -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 12 09:30:42 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 12 Aug 2009 02:30:42 -0700 Subject: [Libvirt-cim] [PATCH] [TEST]Fixing RASD/02_enum.py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1250069419 25200 # Node ID ba7c3a6ecb409faad1395a19d1782fda6c525f67 # Parent 302b70f9ef5dea6cc4f5c685718cf7d8cfea8a60 [TEST]Fixing RASD/02_enum.py Tested with KVM on F10 and Xen on RHEL5.3 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 302b70f9ef5d -r ba7c3a6ecb40 suites/libvirt-cim/cimtest/RASD/02_enum.py --- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Tue Aug 11 06:25:13 2009 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Wed Aug 12 02:30:19 2009 -0700 @@ -129,7 +129,6 @@ else: vsxml = virtxml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk) - vsxml.set_vbridge(server, default_network_name) class_list = [ get_typed_class(virt, rasd.dasd_cn), get_typed_class(virt, rasd.masd_cn), get_typed_class(virt, rasd.pasd_cn), From deeptik at linux.vnet.ibm.com Wed Aug 12 11:28:29 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 12 Aug 2009 04:28:29 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSSD/04*py Message-ID: <40ae39e74558a58a05f0.1250076509@localhost.localdomain> # HG changeset patch # User Deepti B. Kalakeri # Date 1250076487 25200 # Node ID 40ae39e74558a58a05f01fcf61aaa8ee5384e667 # Parent ba7c3a6ecb409faad1395a19d1782fda6c525f67 [TEST] Fixing VSSD/04*py Tested with KVM on F10 and Xen on RHEL5.3 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r ba7c3a6ecb40 -r 40ae39e74558 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Wed Aug 12 02:30:19 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Wed Aug 12 04:28:07 2009 -0700 @@ -73,11 +73,6 @@ else: vsxml_info = virt_xml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk) - try: - bridge = vsxml_info.set_vbridge(server, default_network_name) - except Exception, details: - logger.error("Exception : %s", details) - return FAIL, vsxml_info try: ret = vsxml_info.cim_define(server) From anantyog at linux.vnet.ibm.com Wed Aug 12 12:10:13 2009 From: anantyog at linux.vnet.ibm.com (yogi) Date: Wed, 12 Aug 2009 17:40:13 +0530 Subject: [Libvirt-cim] [PATCH] [Test]Testcase to check for duplicate UUID In-Reply-To: <4A81A737.5020102@linux.vnet.ibm.com> References: <87e175898a31e7866d67.1249986958@elm3b151.beaverton.ibm.com> <4A818114.3090902@linux.vnet.ibm.com> <1250003219.4544.13.camel@yogi-laptop> <4A81A737.5020102@linux.vnet.ibm.com> Message-ID: <1250079013.10025.4.camel@yogi-laptop> On Tue, 2009-08-11 at 22:45 +0530, Deepti B Kalakeri wrote: > > yogi wrote: > > On Tue, 2009-08-11 at 20:02 +0530, Deepti B Kalakeri wrote: > > > >> Yogananth Subramanian wrote: > >> > >>> # HG changeset patch > >>> # User anantyog at in.ibm.com > >>> # Date 1249986809 25200 > >>> # Node ID 87e175898a31e7866d67349e349fad34f8d0bb01 > >>> # Parent 12fd8bac01f25251dbfb64dd5e764f533108964b > >>> [Test]Testcase to check for duplicate UUID > >>> > >>> Steps: > >>> 1) Define 2 domains,'default' and 'test', both with random UUID > >>> 2) Reset the uuid of the second domain, 'test', to the uuid of the > >>> first domain, using ModifySystemSettings > >>> 3) The verify the assigned uuid > >>> > >>> The test does not behave as expected, either at step 2 when ModifySystemSetting > >>> is called, an error should be returned for the duplicate UUID or at step 3 > >>> when we check for the assigned UUID, it should be different from the UUID of > >>> the first domain, neither of this happens. I have filed the bug 00016 > >>> regarding this issue. > >>> > >>> Signed-off-by: Yogananth Subramanian > >>> > >>> diff -r 12fd8bac01f2 -r 87e175898a31 suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py > >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > >>> +++ b/suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py Tue Aug 11 03:33:29 2009 -0700 > >>> @@ -0,0 +1,115 @@ > >>> +#!/usr/bin/python > >>> +# > >>> +# Copyright 2009 IBM Corp. > >>> +# > >>> +# Authors: > >>> +# Yogananth Subramanian > >>> +# > >>> +# This library is free software; you can redistribute it and/or > >>> +# modify it under the terms of the GNU 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 > >>> +# General Public License for more details. > >>> +# > >>> +# You should have received a copy of the GNU 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 > >>> +# > >>> +#Steps: > >>> +#1) Define 2 domains,'default' and 'test', both with random UUID > >>> +#2) Reset the uuid of the second domain, 'test', to the uuid of the > >>> +# first domain, using ModifySystemSettings > >>> +#3) The verify the assigned uuid > >>> +# > >>> + > >>> +import sys > >>> +import time > >>> +from XenKvmLib import vsms > >>> +from XenKvmLib import vxml > >>> +from CimTest.Globals import logger > >>> +from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC > >>> +from XenKvmLib.const import do_main > >>> +from XenKvmLib.classes import get_typed_class, inst_to_mof > >>> +from XenKvmLib.enumclass import GetInstance > >>> + > >>> +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > >>> +default_dom = 'uuid_domain' > >>> +test_dom = 'test_domain' > >>> +nmac = '99:aa:bb:cc:ee:ff' > >>> +bug_libvirt = "00016" > >>> + > >>> +def get_vssd(ip, virt, get_cim_inst, default_dom): > >>> + cn = get_typed_class(virt, "VirtualSystemSettingData") > >>> + inst = None > >>> + > >>> + try: > >>> + if virt == "XenFV": > >>> + virt = "Xen" > >>> + > >>> + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } > >>> + inst = GetInstance(ip, cn, key_list, get_cim_inst) > >>> + > >>> + except Exception, details: > >>> + logger.error(details) > >>> + return FAIL, inst > >>> + > >>> + if inst is None: > >>> + return FAIL, inst > >>> + > >>> + return PASS, inst > >>> + > >>> + at do_main(sup_types) > >>> +def main(): > >>> + options = main.options > >>> + > >>> + service = vsms.get_vsms_class(options.virt)(options.ip) > >>> + > >>> + cxml = vxml.get_class(options.virt)(default_dom) > >>> + ret = cxml.cim_define(options.ip) > >>> + if not ret: > >>> + logger.error("Failed to define the dom: %s", default_dom) > >>> + return FAIL > >>> > >>> > >> you could move the cim_define() inside the try block. > >> > >>> + > >>> + try: > >>> + status, inst = get_vssd(options.ip, options.virt, True,default_dom) > >>> + if status != PASS: > >>> + raise Exception("Failed to get the VSSD instance for %s"% > >>> + default_dom) > >>> + > >>> + uuid = inst['UUID'] > >>> + > >>> + sxml = vxml.get_class(options.virt)(test_dom, uuid=uuid, mac=nmac) > >>> + ret = sxml.cim_define(options.ip) > >>> > >>> > >> Since you are using the UUID of the first domain while defining the > >> second domain the test fails here with the following error: > >> > >> ERROR - (1, u"CIM_ERR_FAILED: Failed to define domain: operation failed: > >> domain 'uuid_domain' is already defined with uuid > >> 700ef91b-4eb9-4290-8c46-da67d860bb46") > >> InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define > >> domain: operation failed: domain 'uuid_domain' is already defined with > >> uuid 700ef91b-4eb9-4290-8c46-da67d860bb46 > >> > >> > > Srry for this, the behavior on the machine I am using is completely > > different. It does not throw "CIM_ERR_FAILED" when a domain is defined > > with duplicate UUID. > > I will update my providers and resubmit the patches again. > > Was using openpegasus with Revision="934" > > > > > > > Hey thats no problem. Sure. Thanks for submitting the test case though. > > I have recompiled the providers to Revision="945", the behavior on my machine is still same, no "CIM_ERR_FAILED" is generated, and testcase seems to work fine. > >> You, dont need to assign the uuid here while defining the domain,lets > >> allow the providers to assign the fresh uuid to the second domain first. > >> > >>> + if not ret: > >>> + raise Exception("Failed to define the dom: %s"% test_dom) > >>> > >>> > >> need a space before % > >> > >>> + > >>> + status, inst = get_vssd(options.ip, options.virt, True,test_dom) > >>> + if status != PASS: > >>> + raise Exception("Failed to get the VSSD instance for %s"% > >>> > >>> > >> need a space before % > >> > >>> + test_dom) > >>> + > >>> + inst['UUID'] = uuid > >>> + vssd = inst_to_mof(inst) > >>> + ret = service.ModifySystemSettings(SystemSettings=vssd) > >>> > >>> > >> The ModifySystemSettings() was able to give me the following appropriate > >> error when I tried modifying the second domains UUID with the first ones > >> UUID. > >> Heres the exception I got which needs to be verified: > >> > >> "InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define > >> domain: operation failed: domain 'uuid_domain' is already defined with > >> uuid e9db9af2-3281-4905-b81d-35144daaefb9" > >> > >> I did not see any problem with provider not being able to report the > >> duplicate UUID. > >> > >>> + > >>> + if inst['UUID'] == uuid and ret[0]== 0 : > >>> + sxml.undefine(options.ip) > >>> + logger.error("The domains %s and %s have the same UUID", > >>> + default_dom,test_dom) > >>> + status = XFAIL_RC(bug_libvirt) > >>> + > >>> + except Exception, details: > >>> + logger.error(details) > >>> + status = FAIL > >>> > >>> > >> You need to capture the exception "InvokeMethod(ModifySystemSettings): > >> CIM_ERR_FAILED: Failed to define domain: operation failed: domain > >> 'uuid_domain' is already defined with uuid > >> e9db9af2-3281-4905-b81d-35144daaefb9" and validate it here in the except > >> block. > >> You could do something like: > >> > >> except Exception, (rc, desc): > >> exp_desc = "Failed to define domain: operation failed: domain > >> 'uuid_domain' is already defined with uuid" > >> status = FAIL > >> if rc == pywbem.CIM_ERR_FAILED and exp_desc in desc: > >> status = PASS > >> logger.error("Got the expected exception from ModifySystemSettings") > >> > >> > >>> + > >>> + sxml.undefine(options.ip) > >>> + cxml.undefine(options.ip) > >>> + return status > >>> + > >>> +if __name__ == "__main__": > >>> + sys.exit(main()) > >>> + > >>> > >>> _______________________________________________ > >>> 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 > > > > -- > Thanks and Regards, > Deepti B. Kalakeri > IBM Linux Technology Center > deeptik at linux.vnet.ibm.com > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim From deeptik at linux.vnet.ibm.com Wed Aug 12 12:45:22 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 12 Aug 2009 05:45:22 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSSD/02_bootldr.py Message-ID: <1388a57c7e40a0e51c09.1250081122@localhost.localdomain> # HG changeset patch # User Deepti B. Kalakeri # Date 1250081099 25200 # Node ID 1388a57c7e40a0e51c095bab1fa93ce320433bdd # Parent 40ae39e74558a58a05f01fcf61aaa8ee5384e667 [TEST] Fixing VSSD/02_bootldr.py Tested with Xen on RHEL5.3 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 40ae39e74558 -r 1388a57c7e40 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 04:28:07 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 05:44:59 2009 -0700 @@ -130,7 +130,7 @@ def get_vssd_mof(virt, dom_name, bldr=None): vssd_cn = eval(get_typed_class(virt, "VirtualSystemSettingData")) - vssd = vssd_cn(dom_name, virt, bldr) + vssd = vssd_cn(dom_name, virt, bldr=bldr) return vssd.mof() # classes to define RASD parameters From deeptik at linux.vnet.ibm.com Wed Aug 12 13:33:35 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 12 Aug 2009 19:03:35 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSSD/02_bootldr.py In-Reply-To: <1388a57c7e40a0e51c09.1250081122@localhost.localdomain> References: <1388a57c7e40a0e51c09.1250081122@localhost.localdomain> Message-ID: <4A82C4AF.8020504@linux.vnet.ibm.com> Please ignore this.. These changes will be sent in another patch. Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1250081099 25200 > # Node ID 1388a57c7e40a0e51c095bab1fa93ce320433bdd > # Parent 40ae39e74558a58a05f01fcf61aaa8ee5384e667 > [TEST] Fixing VSSD/02_bootldr.py > > Tested with Xen on RHEL5.3 with current sources. > Signed-off-by: Deepti B. Kalakeri > > diff -r 40ae39e74558 -r 1388a57c7e40 suites/libvirt-cim/lib/XenKvmLib/vsms.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 04:28:07 2009 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 05:44:59 2009 -0700 > @@ -130,7 +130,7 @@ > > def get_vssd_mof(virt, dom_name, bldr=None): > vssd_cn = eval(get_typed_class(virt, "VirtualSystemSettingData")) > - vssd = vssd_cn(dom_name, virt, bldr) > + vssd = vssd_cn(dom_name, virt, bldr=bldr) > return vssd.mof() > > # classes to define RASD parameters > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 12 13:34:44 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 12 Aug 2009 19:04:44 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSSD/02_bootldr.py In-Reply-To: <1388a57c7e40a0e51c09.1250081122@localhost.localdomain> References: <1388a57c7e40a0e51c09.1250081122@localhost.localdomain> Message-ID: <4A82C4F4.8090300@linux.vnet.ibm.com> Please ignore this.. These changes will be sent in another patch. Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1250081099 25200 > # Node ID 1388a57c7e40a0e51c095bab1fa93ce320433bdd > # Parent 40ae39e74558a58a05f01fcf61aaa8ee5384e667 > [TEST] Fixing VSSD/02_bootldr.py > > Tested with Xen on RHEL5.3 with current sources. > Signed-off-by: Deepti B. Kalakeri > > diff -r 40ae39e74558 -r 1388a57c7e40 suites/libvirt-cim/lib/XenKvmLib/vsms.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 04:28:07 2009 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 05:44:59 2009 -0700 > @@ -130,7 +130,7 @@ > > def get_vssd_mof(virt, dom_name, bldr=None): > vssd_cn = eval(get_typed_class(virt, "VirtualSystemSettingData")) > - vssd = vssd_cn(dom_name, virt, bldr) > + vssd = vssd_cn(dom_name, virt, bldr=bldr) > return vssd.mof() > > # classes to define RASD parameters > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 12 13:33:24 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 12 Aug 2009 06:33:24 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing get_vssd_mof() to pass uuid param Message-ID: <2c8ae164c260b0d8c8df.1250084004@localhost.localdomain> # HG changeset patch # User Deepti B. Kalakeri # Date 1250083990 25200 # Node ID 2c8ae164c260b0d8c8df07c4e01010daa58a5de1 # Parent 1388a57c7e40a0e51c095bab1fa93ce320433bdd [TEST] Fixing get_vssd_mof() to pass uuid param. This patch fixes VSSD/02_bootldr.py VSSD/05_set_uuid.py Signed-off-by: Deepti B. Kalakeri diff -r 1388a57c7e40 -r 2c8ae164c260 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 05:44:59 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 06:33:10 2009 -0700 @@ -128,9 +128,9 @@ class LXC_VirtualSystemSettingData(CIM_VirtualSystemSettingData): pass -def get_vssd_mof(virt, dom_name, bldr=None): +def get_vssd_mof(virt, dom_name, uuid=None, bldr=None): vssd_cn = eval(get_typed_class(virt, "VirtualSystemSettingData")) - vssd = vssd_cn(dom_name, virt, bldr=bldr) + vssd = vssd_cn(dom_name, virt, uuid=uuid, bldr=bldr) return vssd.mof() # classes to define RASD parameters diff -r 1388a57c7e40 -r 2c8ae164c260 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Aug 12 05:44:59 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Aug 12 06:33:10 2009 -0700 @@ -563,7 +563,7 @@ self.domain_name = dom_name self.err_rc = None self.err_desc = None - self.vssd = vsms.get_vssd_mof(virt, dom_name, uuid) + self.vssd = vsms.get_vssd_mof(virt, dom_name, uuid=uuid) self.nasd = vsms.get_nasd_class(virt)(type=net_type, mac=net_mac, name=dom_name, @@ -836,7 +836,7 @@ def set_bootloader(self, ip, gtype=0): bldr = bootloader(ip, gtype) self.add_sub_node('/domain', 'bootloader', bldr) - self.vssd = vsms.get_vssd_mof(self.virt, self.domain_name, bldr) + self.vssd = vsms.get_vssd_mof(self.virt, self.domain_name, bldr=bldr) return bldr def set_bridge(self, ip): From deeptik at linux.vnet.ibm.com Wed Aug 12 14:11:01 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 12 Aug 2009 19:41:01 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 11 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus In-Reply-To: <4A81796E.3000107@linux.vnet.ibm.com> References: <4A813319.8040806@linux.vnet.ibm.com> <4A81796E.3000107@linux.vnet.ibm.com> Message-ID: <4A82CD75.4050905@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Deepti B Kalakeri wrote: >> Due to some problem, I am not able to send mails to libvirt-cim >> mailing list. >> >> ================================================= >> Test Run Summary (Aug 11 2009): Xen on Red Hat Enterprise Linux >> Server release 5.3 (Tikanga) with Pegasus >> ================================================= >> Distro: Red Hat Enterprise Linux Server release 5.3 (Tikanga) >> Kernel: 2.6.18-128.el5xen >> libvirt: 0.3.3 >> Hypervisor: Xen 3.1.0 >> CIMOM: Pegasus 2.7.1 >> Libvirt-cim revision: 945 >> Libvirt-cim changeset: 2de7d9bdb9af >> Cimtest revision: Cimtest changeset: >> ================================================= >> FAIL : 34 >> XFAIL : 3 >> SKIP : 4 >> PASS : 125 >> ----------------- >> Total : 166 >> ================================================= >> FAIL Test Summary: >> ComputerSystemIndication - 01_created_indication.py: FAIL >> ComputerSystemMigrationJobIndication - >> 01_csmig_ind_for_offline_mig.py: FAIL >> ElementAllocatedFromPool - 01_forward.py: FAIL > This tc fails for Xen. In the test case though we are passing the > network pool information while creating the domain. > But, somehow the domain is getting created with the bridge type > interface. > I checked this with the rpm based libvirt-cim on RHEL5.4 snap5 and the > test case worked fine. > But the same when checked with current sources on RHEL5.4 failed with > same error as on with RHEL5.3. > > >> ElementAllocatedFromPool - 04_forward_errs.py: FAIL >> HostSystem - 03_hs_to_settdefcap.py: FAIL > Submitted fix for these. >> RASD - 01_verify_rasd_fields.py: FAIL The test case do not have any problem. I am seeing a peculiar behavior. The EnumerateInstance operation from the provider on the RASD is returning None value in the NetworkName field. I commented out the destroy and undefine part of the test case and checked if the wbemcli ein operation on RASD returned proper NetworkName value, which did. The rasd_from_vdev() function in Virt_RASD.c is indirectly called via enu_rasds -> _get_rasds(). The NetworkName value seem to be assigned properly when called from the VSSDC.c vssd_to_rasd() function. But when called from EnumInstances() in the Virt_RASD.c the NetworkName is getting reset to null. Here is the sample Debug msg below: Virt_VSSDComponent.c(60): From VSSDC Virt_RASD.c(756): From RASD misc_util.c(75): Connecting to libvirt with uri `xen' device_parsing.c(325): No network source defined, leaving blank Virt_RASD.c(444): DEBUG NetworkName uis testbridge Virt_RASD.c(445): DEBUG dev->dev.net.type, bridge is bridge Virt_RASD.c(446): DEBUG InstanceID is VSSDC_dom/00:11:22:33:44:aa .... Virt_RASD.c(444): DEBUG DEEPTI NetworkName uis testbridge Virt_RASD.c(445): DEBUG (STREQ(dev->dev.net.type, bridge is bridge Virt_RASD.c(446): DEBUG InstanceID is VSSDC_dom/00:11:22:33:44:aa misc_util.c(75): Connecting to libvirt with uri `xen' infostore.c(88): Path is /etc/libvirt/cim/Xen_VSSDC_dom misc_util.c(406): Type is Xen libvir: Xen error : failed Xen syscall ioctl 3166208 infostore.c(88): Path is /etc/libvirt/cim/Xen_VSSDC_dom misc_util.c(75): Connecting to libvirt with uri `xen' instance_util.c(127): Number of keys: 1 instance_util.c(140): Comparing key 0: `InstanceID' misc_util.c(75): Connecting to libvirt with uri `xen' instance_util.c(127): Number of keys: 1 instance_util.c(140): Comparing key 0: `InstanceID' misc_util.c(75): Connecting to libvirt with uri `xen' device_parsing.c(273): Disk node: disk instance_util.c(127): Number of keys: 1 instance_util.c(140): Comparing key 0: `InstanceID' misc_util.c(75): Connecting to libvirt with uri `xen' instance_util.c(127): Number of keys: 1 instance_util.c(140): Comparing key 0: `InstanceID' misc_util.c(75): Connecting to libvirt with uri `xen' device_parsing.c(325): No network source defined, leaving blank Virt_RASD.c(444): DEBUG NetworkName uis (null) Virt_RASD.c(445): DEBUG (STREQ(dev->dev.net.type, bridge is bridge Virt_RASD.c(446): DEBUG InstanceID is VSSDC_dom/00:11:22:33:44:aa instance_util.c(127): Number of keys: 1 instance_util.c(140): Comparing key 0: `InstanceID' misc_util.c(75): Connecting to libvirt with uri `xen' misc_util.c(75): Connecting to libvirt with uri `xen' infostore.c(88): Path is /etc/libvirt/cim/Xen_VSSDC_dom instance_util.c(127): Number of keys: 1 instance_util.c(140): Comparing key 0: `InstanceID' misc_util.c(75): Connecting to libvirt with uri `xen' misc_util.c(75): Connecting to libvirt with uri `xen' misc_util.c(406): Type is Xen libvir: Xen error : failed Xen syscall ioctl 3166208 infostore.c(88): Path is /etc/libvirt/cim/Xen_Domain-0 instance_util.c(127): Number of keys: 1 instance_util.c(140): Comparing key 0: `InstanceID' misc_util.c(75): Connecting to libvirt with uri `xen' misc_util.c(75): Connecting to libvirt with uri `xen' misc_util.c(406): Type is Xen libvir: Xen error : failed Xen syscall ioctl 3166208 infostore.c(88): Path is /etc/libvirt/cim/Xen_VSSDC_dom instance_util.c(127): Number of keys: 1 instance_util.c(140): Comparing key 0: `InstanceID' misc_util.c(75): Connecting to libvirt with uri `xen' device_parsing.c(325): No network source defined, leaving blank Virt_RASD.c(444): DEBUG NetworkName uis (null) Virt_RASD.c(445): DEBUG (STREQ(dev->dev.net.type, bridge is bridge Virt_RASD.c(446): DEBUG InstanceID is VSSDC_dom/00:11:22:33:44:aa instance_util.c(127): Number of keys: 1 >> RASD - 02_enum.py: FAIL Submitted fix for this. >> ResourceAllocationFromPool - 01_forward.py: FAIL Though the networkpool information is supplied with the Xen domain while creating it.. once created the xml will have the bridge information instead of pool. Because of the provider would not have the source networkpool information when queried, this test fails with the following error: device_parsing.c(325): No network source defined, leaving blank Virt_DevicePool.c(444): Unable to determine pool since no network source defined >> ResourceAllocationFromPool - 02_reverse.py: FAIL same here. >> ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL >> ResourcePoolConfigurationService - 09_DeleteDiskPool.py: FAIL >> SettingsDefineCapabilities - 01_forward.py: FAIL >> VSSD - 02_bootldr.py: FAIL Submitted fix for this >> VSSD - 03_vssd_gi_errs.py: FAIL Passed when ran manually. >> VSSD - 04_vssd_to_rasd.py: FAIL Submitted fix for this. >> VSSD - 05_set_uuid.py: FAIL Submitted fix for this. >> VirtualSystemManagementService - 01_definesystem_name.py: FAIL >> VirtualSystemManagementService - 02_destroysystem.py: FAIL >> VirtualSystemManagementService - 06_addresource.py: FAIL Passed when run manually >> VirtualSystemManagementService - 08_modifyresource.py: FAIL Need to look into it >> VirtualSystemManagementService - 09_procrasd_persist.py: FAIL >> VirtualSystemManagementService - 12_referenced_config.py: FAIL Passed when run manually >> VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL The test case fails because of the duplicate vdevice info. will fix this. >> >> VirtualSystemManagementService - 15_mod_system_settings.py: FAIL >> VirtualSystemManagementService - 17_removeresource_neg.py: FAIL >> VirtualSystemManagementService - 20_verify_vnc_password.py: FAIL All the above passed when run manually >> VirtualSystemMigrationService - 01_migratable_host.py: FAIL >> VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL >> VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL >> VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL >> VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL >> VirtualSystemMigrationService - >> 08_remote_restart_resume_migration.py: FAIL >> VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL >> VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL >> > Need to verify the above. > The following needs to be verified. ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL ResourcePoolConfigurationService - 09_DeleteDiskPool.py: FAIL SettingsDefineCapabilities - 01_forward.py: FAIL VirtualSystemManagementService - 13_refconfig_additional_devs.py: VirtualSystemManagementService - 08_modifyresource.py: FAIL VirtualSystemMigrationService - 01_migratable_host.py: FAIL VirtualSystemMigrationService - 02_host_migrate_type.py: FAIL VirtualSystemMigrationService - 05_migratable_host_errs.py: FAIL VirtualSystemMigrationService - 06_remote_live_migration.py: FAIL VirtualSystemMigrationService - 07_remote_offline_migration.py: FAIL VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: FAIL VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: FAIL VirtualSystemSnapshotService - 03_create_snapshot.py: FAIL -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 12 16:32:37 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 09:32:37 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Image Creation: add functions for generating a storage volume XML In-Reply-To: <4A82352C.207@linux.vnet.ibm.com> References: <4A82352C.207@linux.vnet.ibm.com> Message-ID: <4A82EEA5.2090907@linux.vnet.ibm.com> >> + format = xmlNewChild(target, NULL, BAD_CAST "format", NULL); >> + if (format == NULL) >> + goto out; >> + >> + if (xmlNewProp(format, BAD_CAST "type", BAD_CAST type) == NULL) >> + goto out; >> + >> + /* FIXME: Need to add permissions and label tags here */ > > What about this fixme? > Right now, the StorageVolRASD doesn't have attributes that allow the user to set the permissions and flags they want for the image. This is something I'll need to add in the future, but it isn't needed to get the initial image creation support working. Plus, it's a lot of additional code, and I wanted to make the patches small enough that they were easy and quick to review. Once all the patches for initial image creation are in the tree, my plan is to do the following: 1) Add a method that will allow the user to delete the image 2) Improve the image creation support so that users can specify permissions, flags, anything else I've missed/neglected. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 12 16:27:19 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 09:27:19 -0700 Subject: [Libvirt-cim] [PATCH] Ensure hostname always returns a value Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1250034843 25200 # Node ID c7fa7f2f08f01abe23da18e3ed3a22efbae718af # Parent bf7220c52d7afecf85d7c2a6b11d9ba0f45052f9 Ensure hostname always returns a value. Signed-off-by: Kaitlin Rupert diff -r bf7220c52d7a -r c7fa7f2f08f0 src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Tue Aug 11 14:15:34 2009 -0600 +++ b/src/Virt_HostSystem.c Tue Aug 11 16:54:03 2009 -0700 @@ -58,7 +58,20 @@ } CU_DEBUG("Unable to find FQDN, using hostname."); - strncpy(buf, he->h_name, size); + + /* FIXME: An ugly hack to ensure we return something for the hostname, + but also be sure the value isn't empty and that it doesn't + contain "localhost" */ + if ((he->h_name != NULL) && (!STREQC(he->h_name, "")) && + (strstr(he->h_name, "localhost") == NULL)) + strncpy(buf, he->h_name, size); + else if ((host != NULL) && (!STREQC(host, "")) && + (strstr(host, "localhost") == NULL)) + strncpy(buf, host, size); + else { + CU_DEBUG("Unable to find valid hostname value."); + return -1; + } return 0; } @@ -78,7 +91,7 @@ else ret = resolve_host(host, buf, size); - return 0; + return ret; } static int set_host_system_properties(CMPIInstance *instance) From rmaciel at linux.vnet.ibm.com Wed Aug 12 17:30:08 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 12 Aug 2009 14:30:08 -0300 Subject: [Libvirt-cim] [PATCH 1 of 2] Image Creation: add functions for generating a storage volume XML In-Reply-To: References: Message-ID: <4A82FC20.6040204@linux.vnet.ibm.com> On 08/11/2009 05:19 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1245187550 25200 > # Node ID ffc93d36908aa5fca483fc650393802383409890 > # Parent 615da7491c145fa283e658df520fd9e31615f4d4 > Image Creation: add functions for generating a storage volume XML > > Signed-off-by: Kaitlin Rupert > > diff -r 615da7491c14 -r ffc93d36908a libxkutil/xmlgen.c > --- a/libxkutil/xmlgen.c Mon Aug 10 13:52:58 2009 -0700 > +++ b/libxkutil/xmlgen.c Tue Jun 16 14:25:50 2009 -0700 > @@ -39,6 +39,7 @@ > > typedef const char *(*devfn_t)(xmlNodePtr node, struct domain *dominfo); > typedef const char *(*poolfn_t)(xmlNodePtr node, struct virt_pool *pool); > +typedef const char *(*resfn_t)(xmlNodePtr node, struct virt_pool_res *res); > > static char *disk_block_xml(xmlNodePtr root, struct disk_device *dev) > { > @@ -1056,6 +1057,133 @@ > return xml; > } > > +static const char *vol_format_type_to_str(uint16_t type) > +{ > + switch (type) { > + case VOL_FORMAT_RAW: > + return "raw"; > + default: > + CU_DEBUG("Unsupported storage volume type"); > + } > + > + return NULL; > +} > + > +static const char *storage_vol_xml(xmlNodePtr root, > + struct virt_pool_res *res) > +{ > + xmlNodePtr v = NULL; > + xmlNodePtr name = NULL; > + xmlNodePtr alloc = NULL; > + xmlNodePtr cap = NULL; > + xmlNodePtr target = NULL; > + xmlNodePtr path = NULL; > + xmlNodePtr format = NULL; > + const char *type = NULL; > + struct storage_vol *vol =&res->res.storage_vol; > + char *string = NULL; > + int ret; > + > + type = vol_format_type_to_str(vol->format_type); > + if (type == NULL) > + goto out; > + > + v = xmlNewChild(root, NULL, BAD_CAST "volume", NULL); > + if (v == NULL) > + goto out; > + > + name = xmlNewChild(v, NULL, BAD_CAST "name", BAD_CAST vol->vol_name); > + if (name == NULL) > + goto out; > + > + ret = asprintf(&string, "%" PRIu16, vol->alloc); > + if (ret == -1) > + return XML_ERROR; > + > + alloc = xmlNewChild(v, NULL, BAD_CAST "allocation", BAD_CAST string); > + if (alloc == NULL) > + goto out; > + > + free(string); > + ret = asprintf(&string, "%" PRIu16, vol->cap); > + if (ret == -1) > + return XML_ERROR; > + > + cap = xmlNewChild(v, NULL, BAD_CAST "capacity", BAD_CAST string); > + if (cap == NULL) > + goto out; > + > + free(string); > + > + if (xmlNewProp(cap, BAD_CAST "unit", BAD_CAST vol->cap_units) == NULL) > + goto out; > + > + target = xmlNewChild(v, NULL, BAD_CAST "target", NULL); > + if (target == NULL) > + goto out; > + > + path = xmlNewChild(target, NULL, BAD_CAST "path", BAD_CAST vol->path); > + if (path == NULL) > + goto out; > + > + format = xmlNewChild(target, NULL, BAD_CAST "format", NULL); > + if (format == NULL) > + goto out; > + > + if (xmlNewProp(format, BAD_CAST "type", BAD_CAST type) == NULL) > + goto out; > + > + /* FIXME: Need to add permissions and label tags here */ > + > + return NULL; > + > + out: > + free(string); > + return XML_ERROR; > + } > + > +char *res_to_xml(struct virt_pool_res *res) { > + char *xml = NULL; > + xmlNodePtr root = NULL; > + int type = res->type; > + const char *msg = NULL; > + resfn_t func; > + > + root = xmlNewNode(NULL, BAD_CAST "tmp"); > + if (root == NULL) { > + msg = XML_ERROR; > + goto out; > + } > + > + switch (type) { > + case CIM_RES_TYPE_IMAGE: > + func = storage_vol_xml; > + break; > + default: > + CU_DEBUG("res_to_xml: invalid type specified: %d", type); > + msg = "res_to_xml: invalid type specified"; Since you're using the same message, why not assign the value and use it? > + goto out; > + } > + > + msg = func(root, res); > + if (msg != NULL) > + goto out; > + > + xml = tree_to_xml(root->children); > + if (xml == NULL) > + msg = "XML generation failed"; > + out: > + if (msg != NULL) { > + CU_DEBUG("Failed to create res XML: %s", msg); > + } else { > + CU_DEBUG("Created res XML:\n%s\n", xml); > + } > + > + xmlFreeNode(root); > + > + return xml; > +} > + > /* > * Local Variables: > * mode: C > diff -r 615da7491c14 -r ffc93d36908a libxkutil/xmlgen.h > --- a/libxkutil/xmlgen.h Mon Aug 10 13:52:58 2009 -0700 > +++ b/libxkutil/xmlgen.h Tue Jun 16 14:25:50 2009 -0700 > @@ -36,4 +36,6 @@ > > char *pool_to_xml(struct virt_pool *pool); > > +char *res_to_xml(struct virt_pool_res *res); > + > #endif > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim Only a small comment on the style above. Overall, the code is fine. -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 12 18:43:46 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 11:43:46 -0700 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 11 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus In-Reply-To: <4A82CD75.4050905@linux.vnet.ibm.com> References: <4A813319.8040806@linux.vnet.ibm.com> <4A81796E.3000107@linux.vnet.ibm.com> <4A82CD75.4050905@linux.vnet.ibm.com> Message-ID: <4A830D62.4020908@linux.vnet.ibm.com> >>> RASD - 01_verify_rasd_fields.py: FAIL > The test case do not have any problem. > I am seeing a peculiar behavior. The EnumerateInstance operation from > the provider on the RASD is returning None value in the NetworkName field. > I commented out the destroy and undefine part of the test case and > checked if the wbemcli ein operation on RASD returned proper NetworkName > value, which did. > The rasd_from_vdev() function in Virt_RASD.c is indirectly called via > enu_rasds -> _get_rasds(). > The NetworkName value seem to be assigned properly when called from the > VSSDC.c vssd_to_rasd() function. > But when called from EnumInstances() in the Virt_RASD.c the NetworkName > is getting reset to null. Thanks Deepti for providing debug - this helped me track the issue down. The actual error is in the virt_device_dup() function in device_parsing.c I'll follow up with a patch to fix this. >>> ResourceAllocationFromPool - 01_forward.py: FAIL > Though the networkpool information is supplied with the Xen domain while > creating it.. once created the xml will have the bridge information > instead of pool. > Because of the provider would not have the source networkpool > information when queried, this test fails with the following error: > > device_parsing.c(325): No network source defined, leaving blank > Virt_DevicePool.c(444): Unable to determine pool since no network source > defined > This is a consequence of how the libvirt Xen driver works. When the guest is defined, the XML is converted from a "network" type interface to a "bridge" type. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 12 19:54:57 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 12:54:57 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] #2 Add support for generating image XML Message-ID: From kaitlin at linux.vnet.ibm.com Wed Aug 12 19:54:58 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 12:54:58 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] (#2) Image Creation: add functions for generating a storage volume XML In-Reply-To: References: Message-ID: <6a1d6542f10fb0c506ac.1250106898@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1245187550 25200 # Node ID 6a1d6542f10fb0c506aca304020ac64b9e3f98d0 # Parent bf7220c52d7afecf85d7c2a6b11d9ba0f45052f9 (#2) Image Creation: add functions for generating a storage volume XML Updates from 1 to 2: -In res_to_xml() reuse message when formatting CU_DEBUG() in the switch statement Signed-off-by: Kaitlin Rupert diff -r bf7220c52d7a -r 6a1d6542f10f libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Tue Aug 11 14:15:34 2009 -0600 +++ b/libxkutil/xmlgen.c Tue Jun 16 14:25:50 2009 -0700 @@ -39,6 +39,7 @@ typedef const char *(*devfn_t)(xmlNodePtr node, struct domain *dominfo); typedef const char *(*poolfn_t)(xmlNodePtr node, struct virt_pool *pool); +typedef const char *(*resfn_t)(xmlNodePtr node, struct virt_pool_res *res); static char *disk_block_xml(xmlNodePtr root, struct disk_device *dev) { @@ -1056,6 +1057,133 @@ return xml; } +static const char *vol_format_type_to_str(uint16_t type) +{ + switch (type) { + case VOL_FORMAT_RAW: + return "raw"; + default: + CU_DEBUG("Unsupported storage volume type"); + } + + return NULL; +} + +static const char *storage_vol_xml(xmlNodePtr root, + struct virt_pool_res *res) +{ + xmlNodePtr v = NULL; + xmlNodePtr name = NULL; + xmlNodePtr alloc = NULL; + xmlNodePtr cap = NULL; + xmlNodePtr target = NULL; + xmlNodePtr path = NULL; + xmlNodePtr format = NULL; + const char *type = NULL; + struct storage_vol *vol = &res->res.storage_vol; + char *string = NULL; + int ret; + + type = vol_format_type_to_str(vol->format_type); + if (type == NULL) + goto out; + + v = xmlNewChild(root, NULL, BAD_CAST "volume", NULL); + if (v == NULL) + goto out; + + name = xmlNewChild(v, NULL, BAD_CAST "name", BAD_CAST vol->vol_name); + if (name == NULL) + goto out; + + ret = asprintf(&string, "%" PRIu16, vol->alloc); + if (ret == -1) + return XML_ERROR; + + alloc = xmlNewChild(v, NULL, BAD_CAST "allocation", BAD_CAST string); + if (alloc == NULL) + goto out; + + free(string); + ret = asprintf(&string, "%" PRIu16, vol->cap); + if (ret == -1) + return XML_ERROR; + + cap = xmlNewChild(v, NULL, BAD_CAST "capacity", BAD_CAST string); + if (cap == NULL) + goto out; + + free(string); + + if (xmlNewProp(cap, BAD_CAST "unit", BAD_CAST vol->cap_units) == NULL) + goto out; + + target = xmlNewChild(v, NULL, BAD_CAST "target", NULL); + if (target == NULL) + goto out; + + path = xmlNewChild(target, NULL, BAD_CAST "path", BAD_CAST vol->path); + if (path == NULL) + goto out; + + format = xmlNewChild(target, NULL, BAD_CAST "format", NULL); + if (format == NULL) + goto out; + + if (xmlNewProp(format, BAD_CAST "type", BAD_CAST type) == NULL) + goto out; + + /* FIXME: Need to add permissions and label tags here */ + + return NULL; + + out: + free(string); + return XML_ERROR; + } + +char *res_to_xml(struct virt_pool_res *res) { + char *xml = NULL; + xmlNodePtr root = NULL; + int type = res->type; + const char *msg = NULL; + resfn_t func; + + root = xmlNewNode(NULL, BAD_CAST "tmp"); + if (root == NULL) { + msg = XML_ERROR; + goto out; + } + + switch (type) { + case CIM_RES_TYPE_IMAGE: + func = storage_vol_xml; + break; + default: + msg = "res_to_xml: invalid type specified"; + CU_DEBUG("%s %d", msg, type); + goto out; + } + + msg = func(root, res); + if (msg != NULL) + goto out; + + xml = tree_to_xml(root->children); + if (xml == NULL) + msg = "XML generation failed"; + out: + if (msg != NULL) { + CU_DEBUG("Failed to create res XML: %s", msg); + } else { + CU_DEBUG("Created res XML:\n%s\n", xml); + } + + xmlFreeNode(root); + + return xml; +} + /* * Local Variables: * mode: C diff -r bf7220c52d7a -r 6a1d6542f10f libxkutil/xmlgen.h --- a/libxkutil/xmlgen.h Tue Aug 11 14:15:34 2009 -0600 +++ b/libxkutil/xmlgen.h Tue Jun 16 14:25:50 2009 -0700 @@ -36,4 +36,6 @@ char *pool_to_xml(struct virt_pool *pool); +char *res_to_xml(struct virt_pool_res *res); + #endif From kaitlin at linux.vnet.ibm.com Wed Aug 12 19:54:59 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 12:54:59 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Image creation: Add support for CreateResourceInPool() method In-Reply-To: References: Message-ID: <9be84616fbb0b94c0ae1.1250106899@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1245187550 25200 # Node ID 9be84616fbb0b94c0ae1287cb0a6252873790bb3 # Parent 6a1d6542f10fb0c506aca304020ac64b9e3f98d0 Image creation: Add support for CreateResourceInPool() method Signed-off-by: Kaitlin Rupert diff -r 6a1d6542f10f -r 9be84616fbb0 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Tue Jun 16 14:25:50 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Tue Jun 16 14:25:50 2009 -0700 @@ -784,6 +784,9 @@ CMPIObjectPath *pool; struct virt_pool_res *res = NULL; const char* msg = NULL; + const char *id = NULL; + char *pool_id = NULL; + char *xml = NULL; CU_DEBUG("CreateResourceInPool"); @@ -808,12 +811,44 @@ goto out; } + if (cu_get_str_path(pool, "InstanceID", &id) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing InstanceID in resource pool"); + goto out; + } + + pool_id = name_from_pool_id(id); + if (pool_id == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Pool has invalid InstanceID"); + goto out; + } + + free(res->pool_id); + res->pool_id = strdup(pool_id); + + xml = res_to_xml(res); + if (xml == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to generate XML for new resource"); + goto out; + } + + CU_DEBUG("New resource XML:\n%s", xml); + + /*FIXME: Add resource here */ + + out: + free(pool_id); + free(xml); + if (s.rc == CMPI_RC_OK) rc = CIM_SVPC_RETURN_COMPLETED; CMReturnData(results, &rc, CMPI_uint32); - out: - return s; } From kaitlin at linux.vnet.ibm.com Wed Aug 12 21:38:36 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 14:38:36 -0700 Subject: [Libvirt-cim] [PATCH] [Test]Testcase to check for duplicate UUID In-Reply-To: <1250079013.10025.4.camel@yogi-laptop> References: <87e175898a31e7866d67.1249986958@elm3b151.beaverton.ibm.com> <4A818114.3090902@linux.vnet.ibm.com> <1250003219.4544.13.camel@yogi-laptop> <4A81A737.5020102@linux.vnet.ibm.com> <1250079013.10025.4.camel@yogi-laptop> Message-ID: <4A83365C.8050309@linux.vnet.ibm.com> >>>>> >>>>> >>>> Since you are using the UUID of the first domain while defining the >>>> second domain the test fails here with the following error: >>>> >>>> ERROR - (1, u"CIM_ERR_FAILED: Failed to define domain: operation failed: >>>> domain 'uuid_domain' is already defined with uuid >>>> 700ef91b-4eb9-4290-8c46-da67d860bb46") >>>> InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Failed to define >>>> domain: operation failed: domain 'uuid_domain' is already defined with >>>> uuid 700ef91b-4eb9-4290-8c46-da67d860bb46 >>>> >>>> >>> Srry for this, the behavior on the machine I am using is completely >>> different. It does not throw "CIM_ERR_FAILED" when a domain is defined >>> with duplicate UUID. >>> I will update my providers and resubmit the patches again. >>> Was using openpegasus with Revision="934" >>> >>> >>> >> Hey thats no problem. Sure. Thanks for submitting the test case though. >>> > I have recompiled the providers to Revision="945", the behavior on my > machine is still same, no "CIM_ERR_FAILED" is generated, and testcase > seems to work fine. > > Hi Yogi, Can you paste the relevant provider debug? I can take a look to see if I can tell what's happening. Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 12 21:42:14 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 14:42:14 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing get_vssd_mof() to pass uuid param In-Reply-To: <2c8ae164c260b0d8c8df.1250084004@localhost.localdomain> References: <2c8ae164c260b0d8c8df.1250084004@localhost.localdomain> Message-ID: <4A833736.2070102@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1250083990 25200 > # Node ID 2c8ae164c260b0d8c8df07c4e01010daa58a5de1 > # Parent 1388a57c7e40a0e51c095bab1fa93ce320433bdd > [TEST] Fixing get_vssd_mof() to pass uuid param. > > This patch fixes VSSD/02_bootldr.py VSSD/05_set_uuid.py > Signed-off-by: Deepti B. Kalakeri > > diff -r 1388a57c7e40 -r 2c8ae164c260 suites/libvirt-cim/lib/XenKvmLib/vsms.py Hi Deepti, This failed to apply on my tree. I get the following reject file: --- vsms.py +++ vsms.py @@ -128,9 +128,9 @@ class LXC_VirtualSystemSettingData(CIM_VirtualSystemSettingData): pass -def get_vssd_mof(virt, dom_name, bldr=None): +def get_vssd_mof(virt, dom_name, uuid=None, bldr=None): vssd_cn = eval(get_typed_class(virt, "VirtualSystemSettingData")) - vssd = vssd_cn(dom_name, virt, bldr=bldr) + vssd = vssd_cn(dom_name, virt, uuid=uuid, bldr=bldr) return vssd.mof() # classes to define RASD parameters Can you update your tree and see if it still applies? Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Aug 10 16:52:49 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 10 Aug 2009 13:52:49 -0300 Subject: [Libvirt-cim] [PATCH] MigrationJob will write a migration mark to the infostore of the guest migrating Message-ID: <411a3090c6a098de8091.1249923169@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1249923132 10800 # Node ID 411a3090c6a098de809144334edaa41f5d3007b0 # Parent 20528f913ec18441bf1ef2f812d110580fa01015 MigrationJob will write a migration mark to the infostore of the guest migrating This allows ComputerSystem to know when its respective guest is being migrated Signed-off-by: Richard Maciel diff -r 20528f913ec1 -r 411a3090c6a0 src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Jun 16 14:25:50 2009 -0700 +++ b/src/Virt_VSMigrationService.c Mon Aug 10 13:52:12 2009 -0300 @@ -48,6 +48,7 @@ #include "Virt_ComputerSystem.h" #include "Virt_VSMigrationSettingData.h" #include "svpc_types.h" +#include "libxkutil/infostore.h" #include "config.h" @@ -1135,6 +1136,24 @@ return s; } +static void clear_infstore_migration_mark(virDomainPtr dom) +{ + struct infostore_ctx *infp; + bool ret = false; + + infp = infostore_open(dom); + if (infp == NULL) { + CU_DEBUG("Unable to open domain information store." + "Migration mark won't be cleared"); + return; + } + + ret = infostore_set_bool(infp, "migrating", false); + CU_DEBUG("Clearing infostore migrating flag"); + + infostore_close(infp); +} + static CMPIStatus migrate_vs(struct migration_job *job) { CMPIStatus s; @@ -1210,6 +1229,7 @@ CMGetCharPtr(s.msg)); } out: + clear_infstore_migration_mark(dom); raise_deleted_ind(job); free(uri); @@ -1251,6 +1271,45 @@ return NULL; } +static bool set_infstore_migration_mark(const CMPIObjectPath *ref, + const char *domain) +{ + struct infostore_ctx *infp; + bool ret = false; + CMPIStatus s; + virConnectPtr conn = NULL; + virDomainPtr dom = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + goto out; + + dom = virDomainLookupByName(conn, domain); + if (dom == NULL) { + CU_DEBUG("No such domain"); + goto out; + } + + + infp = infostore_open(dom); + if (infp == NULL) { + CU_DEBUG("Unable to open domain information store." + "Migration mark won't be placed"); + goto out; + } + + ret = infostore_set_bool(infp, "migrating", true); + CU_DEBUG("Migration mark set"); + + infostore_close(infp); + + out: + virDomainFree(dom); + virConnectClose(conn); + + return ret; +} + static CMPIInstance *_migrate_job_new_instance(const char *cn, const char *ns) { @@ -1411,6 +1470,10 @@ goto out; } + rc = set_infstore_migration_mark(ref, domain); + if (!rc) + CU_DEBUG("Failed to set migration mark in infostore"); + ind = prepare_indication(_BROKER, inst, job, MIG_CREATED, &s); rc = raise_indication(job->context, MIG_CREATED, job->ref_ns, inst, ind); From rmaciel at linux.vnet.ibm.com Mon Aug 10 17:06:01 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 10 Aug 2009 14:06:01 -0300 Subject: [Libvirt-cim] [PATCH] Add three new OperationalStatus states and map them all to libvirt states Message-ID: # HG changeset patch # User Richard Maciel # Date 1249923352 10800 # Node ID dbd688f6df87435cb97e68051fbc16c47730837d # Parent 411a3090c6a098de809144334edaa41f5d3007b0 Add three new OperationalStatus states and map them all to libvirt states OperationalStatus states added: STARTED SUSPENDED RELOCATED Signed-off-by: Richard Maciel diff -r 411a3090c6a0 -r dbd688f6df87 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Aug 10 13:52:12 2009 -0300 +++ b/src/Virt_ComputerSystem.c Mon Aug 10 13:55:52 2009 -0300 @@ -187,7 +187,7 @@ } } -static uint16_t state_lv_to_cim_os(const char lv_state) +static uint16_t state_lv_to_cim_os(const char lv_state, const bool migrating) { enum CIM_op_status { CIM_OP_STATUS_UNKNOWN = 0, @@ -208,25 +208,33 @@ CIM_OP_STATUS_DORMANT = 15, CIM_OP_STATUS_COMPLETED = 17, CIM_OP_STATUS_POWER_MODE = 18, + CIM_OP_STATUS_STARTED = 32768, + CIM_OP_STATUS_SUSPENDED = 32769, + CIM_OP_STATUS_RELOCATED = 32770, }; + + if (migrating) + return CIM_OP_STATUS_RELOCATED; + switch (lv_state) { case VIR_DOMAIN_NOSTATE: case VIR_DOMAIN_SHUTDOWN: case VIR_DOMAIN_SHUTOFF: - return CIM_OP_STATUS_DORMANT; + return CIM_OP_STATUS_STOPPED; case VIR_DOMAIN_CRASHED: return CIM_OP_STATUS_ERROR; case VIR_DOMAIN_RUNNING: + return CIM_OP_STATUS_STARTED; + case VIR_DOMAIN_BLOCKED: case VIR_DOMAIN_PAUSED: - return CIM_OP_STATUS_OK; + return CIM_OP_STATUS_SUSPENDED; default: return CIM_OP_STATUS_UNKNOWN; - } } @@ -271,6 +279,7 @@ CMPIArray *array; CMPIStatus s; struct infostore_ctx *infostore = NULL; + bool migrating = false; ret = virDomainGetInfo(dom, &info); if (ret != 0) @@ -290,14 +299,19 @@ array = CMNewArray(broker, 1, CMPI_uint16, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) return 0; + + infostore = infostore_open(dom); - op_status = state_lv_to_cim_os((const int)info.state); + if (infostore != NULL) + migrating = infostore_get_bool(infostore, "migrating"); + + op_status = state_lv_to_cim_os((const int)info.state, migrating); + CMSetArrayElementAt(array, 0, &op_status, CMPI_uint16); CMSetProperty(instance, "OperationalStatus", (CMPIValue *)&array, CMPI_uint16A); - infostore = infostore_open(dom); if (infostore != NULL) req_state = (uint16_t)infostore_get_u64(infostore, "reqstate"); else From rmaciel at linux.vnet.ibm.com Thu Aug 13 02:29:41 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 12 Aug 2009 23:29:41 -0300 Subject: [Libvirt-cim] [PATCH 0 of 2] #2 Add support for generating image XML In-Reply-To: References: Message-ID: <4A837A95.1010103@linux.vnet.ibm.com> +1 On 08/12/2009 04:54 PM, Kaitlin Rupert wrote: > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Aug 13 05:07:55 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 13 Aug 2009 10:37:55 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 11 2009): Xen on Red Hat Enterprise Linux Server release 5.3 (Tikanga) with Pegasus In-Reply-To: <4A830D62.4020908@linux.vnet.ibm.com> References: <4A813319.8040806@linux.vnet.ibm.com> <4A81796E.3000107@linux.vnet.ibm.com> <4A82CD75.4050905@linux.vnet.ibm.com> <4A830D62.4020908@linux.vnet.ibm.com> Message-ID: <4A839FAB.2030104@linux.vnet.ibm.com> Kaitlin Rupert wrote: >>>> RASD - 01_verify_rasd_fields.py: FAIL >> The test case do not have any problem. >> I am seeing a peculiar behavior. The EnumerateInstance operation from >> the provider on the RASD is returning None value in the NetworkName >> field. >> I commented out the destroy and undefine part of the test case and >> checked if the wbemcli ein operation on RASD returned proper >> NetworkName value, which did. >> The rasd_from_vdev() function in Virt_RASD.c is indirectly called via >> enu_rasds -> _get_rasds(). >> The NetworkName value seem to be assigned properly when called from >> the VSSDC.c vssd_to_rasd() function. >> But when called from EnumInstances() in the Virt_RASD.c the >> NetworkName is getting reset to null. > > Thanks Deepti for providing debug - this helped me track the issue > down. The actual error is in the virt_device_dup() function in > device_parsing.c I'll follow up with a patch to fix this. > Thats good :) > >>>> ResourceAllocationFromPool - 01_forward.py: FAIL >> Though the networkpool information is supplied with the Xen domain >> while creating it.. once created the xml will have the bridge >> information instead of pool. >> Because of the provider would not have the source networkpool >> information when queried, this test fails with the following error: >> >> device_parsing.c(325): No network source defined, leaving blank >> Virt_DevicePool.c(444): Unable to determine pool since no network >> source defined >> > > This is a consequence of how the libvirt Xen driver works. When the > guest is defined, the XML is converted from a "network" type interface > to a "bridge" type. > Yeah! you had told me about this previously as well. But how should we go about fixing these tests for Xen. I am yet to decide. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 13 05:08:42 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 22:08:42 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Add call to libvirt virStorageVolCreateXML() In-Reply-To: References: Message-ID: <3fbc29cee5f7391a16a2.1250140122@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1245187550 25200 # Node ID 3fbc29cee5f7391a16a2d68d31eda3d732f4a70e # Parent d47e71adaa6285b43f19d2c6eef184c50d8439d7 Add call to libvirt virStorageVolCreateXML() This call creates the storage volume / image that can be used by future guests. Signed-off-by: Kaitlin Rupert diff -r d47e71adaa62 -r 3fbc29cee5f7 libxkutil/pool_parsing.c --- a/libxkutil/pool_parsing.c Tue Aug 11 16:54:03 2009 -0700 +++ b/libxkutil/pool_parsing.c Tue Jun 16 14:25:50 2009 -0700 @@ -329,6 +329,46 @@ return ret; } +#if VIR_USE_LIBVIRT_STORAGE +int create_resource(virConnectPtr conn, + const char *pname, + const char *xml, + int res_type) +{ + int ret = 0; + + if (res_type == CIM_RES_TYPE_IMAGE) { + virStoragePoolPtr ptr = virStoragePoolLookupByName(conn, pname); + if (ptr == NULL) { + CU_DEBUG("Storage pool %s is not defined", pname); + goto out; + } + + virStorageVolPtr vptr = virStorageVolCreateXML(ptr, xml, 0); + if (vptr == NULL) + goto out; + + virStorageVolFree(vptr); + virStoragePoolFree(ptr); + + ret = 1; + } + + out: + + return ret; +} +#else +int create_resource(virConnectPtr conn, + const char *pname, + const char *xml, + int res_type) +{ + CU_DEBUG("Creating resources within libvirt pools not supported"); + return 0; +} +#endif + /* * Local Variables: * mode: C diff -r d47e71adaa62 -r 3fbc29cee5f7 libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Tue Aug 11 16:54:03 2009 -0700 +++ b/libxkutil/pool_parsing.h Tue Jun 16 14:25:50 2009 -0700 @@ -89,6 +89,8 @@ int define_pool(virConnectPtr conn, const char *xml, int res_type); int destroy_pool(virConnectPtr conn, const char *name, int res_type); +int create_resource(virConnectPtr conn, const char *pname, + const char *xml, int res_type); #endif From kaitlin at linux.vnet.ibm.com Thu Aug 13 05:08:41 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 22:08:41 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Add call to libvirt to create storage volume Message-ID: This set also has creates a StorageVolume instance to return to the user. Ideally, the bit of code in patch 3 should be in Virt_RASD, but that takes some signigicant amount of reshuffiling in the Virt_RASD provider. This will be fixed after this set of patches goes in. This is the last set of patches to get basic image creation working. From kaitlin at linux.vnet.ibm.com Thu Aug 13 05:08:43 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 22:08:43 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] Call create_resource() from RPCS In-Reply-To: References: Message-ID: <7159cbef9779e7472012.1250140123@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1250140070 25200 # Node ID 7159cbef9779e747201235c2d6495568065e10b9 # Parent 3fbc29cee5f7391a16a2d68d31eda3d732f4a70e Call create_resource() from RPCS Signed-off-by: Kaitlin Rupert diff -r 3fbc29cee5f7 -r 7159cbef9779 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Tue Jun 16 14:25:50 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Wed Aug 12 22:07:50 2009 -0700 @@ -771,6 +771,36 @@ return msg; } +static CMPIInstance *connect_and_create_res(char *xml, + const CMPIObjectPath *ref, + struct virt_pool_res *res, + CMPIStatus *s) +{ + virConnectPtr conn; + CMPIInstance *inst = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); + if (conn == NULL) { + CU_DEBUG("libvirt connection failed"); + return NULL; + } + + if (create_resource(conn, res->pool_id, xml, res->type) == 0) { + virt_set_status(_BROKER, s, + CMPI_RC_ERR_FAILED, + conn, + "Unable to create storage volume"); + goto out; + } + + /* FIXME: Get instance result here */ + + out: + virConnectClose(conn); + + return inst; +} + static CMPIStatus create_resource_in_pool(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, @@ -787,6 +817,8 @@ const char *id = NULL; char *pool_id = NULL; char *xml = NULL; + CMPIInstance *inst = NULL; + CMPIObjectPath *result; CU_DEBUG("CreateResourceInPool"); @@ -839,7 +871,22 @@ CU_DEBUG("New resource XML:\n%s", xml); - /*FIXME: Add resource here */ + inst = connect_and_create_res(xml, reference, res, &s); + if (s.rc != CMPI_RC_OK) + goto out; + + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to create new resource"); + goto out; + } + + result = CMGetObjectPath(inst, &s); + if ((result != NULL) && (s.rc == CMPI_RC_OK)) { + CMSetNameSpace(result, NAMESPACE(reference)); + CMAddArg(argsout, "Resource", &result, CMPI_ref); + } out: free(pool_id); From kaitlin at linux.vnet.ibm.com Thu Aug 13 05:08:44 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 12 Aug 2009 22:08:44 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Add get_resource_rasd() to return StorageVolumeRASD that represents new image In-Reply-To: References: Message-ID: <8f508c5e32df61f7b586.1250140124@elm3a148.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1250140071 25200 # Node ID 8f508c5e32df61f7b5866ec0f4dfd3bf81f6e071 # Parent 7159cbef9779e747201235c2d6495568065e10b9 Add get_resource_rasd() to return StorageVolumeRASD that represents new image Signed-off-by: Kaitlin Rupert diff -r 7159cbef9779 -r 8f508c5e32df src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Wed Aug 12 22:07:50 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Wed Aug 12 22:07:51 2009 -0700 @@ -771,6 +771,60 @@ return msg; } +static CMPIInstance *get_resource_rasd(struct virt_pool_res *res, + const CMPIObjectPath *ref, + CMPIStatus *s) +{ + CMPIInstance *inst = NULL; + + if (res->type != CIM_RES_TYPE_IMAGE) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Only storage volume resources supported"); + + goto out; + } + + inst = get_typed_instance(_BROKER, + CLASSNAME(ref), + "StorageVolumeResourceAllocationSettingData", + NAMESPACE(ref)); + if (inst == NULL) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Unable to get resource instance"); + + goto out; + } + + CMSetProperty(inst, "InstanceID", + (CMPIValue *)res->res.storage_vol.path, CMPI_chars); + + CMSetProperty(inst, "Path", + (CMPIValue *)res->res.storage_vol.path, CMPI_chars); + + CMSetProperty(inst, "ResourceType", + (CMPIValue *)&(res->type), CMPI_uint16); + + CMSetProperty(inst, "FormatType", + (CMPIValue *)&(res->res.storage_vol.format_type), + CMPI_uint16); + + CMSetProperty(inst, "VolumeName", + (CMPIValue *)res->res.storage_vol.vol_name, CMPI_chars); + CMSetProperty(inst, "AllocationQuantity", + (CMPIValue *)&(res->res.storage_vol.alloc), CMPI_uint16); + + CMSetProperty(inst, "Capacity", + (CMPIValue *)&(res->res.storage_vol.cap), CMPI_uint16); + + CMSetProperty(inst, "AllocationUnits", + (CMPIValue *)res->res.storage_vol.cap_units, CMPI_chars); + + out: + return inst; +} + static CMPIInstance *connect_and_create_res(char *xml, const CMPIObjectPath *ref, struct virt_pool_res *res, @@ -793,7 +847,13 @@ goto out; } - /* FIXME: Get instance result here */ + inst = get_resource_rasd(res, ref, s); + if (s->rc != CMPI_RC_OK) { + CU_DEBUG("Failed to get new resource instance"); + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Failed to lookup resulting resource"); + } out: virConnectClose(conn); From deeptik at linux.vnet.ibm.com Thu Aug 13 06:22:03 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 13 Aug 2009 11:52:03 +0530 Subject: [Libvirt-cim] Test Run Summary (Aug 13 2009): KVM on Fedora release 11 (Leonidas) with Pegasus Message-ID: <4A83B10B.4040209@linux.vnet.ibm.com> ================================================= Test Run Summary (Aug 13 2009): KVM on Fedora release 11 (Leonidas) with Pegasus ================================================= Distro: Fedora release 11 (Leonidas) Kernel: 2.6.27.5-117.fc10.x86_64 libvirt: 0.7.0 Hypervisor: QEMU 0.10.1 CIMOM: Pegasus 2.9.0 Libvirt-cim revision: 945 Libvirt-cim changeset: 2de7d9bdb9af Cimtest revision: 758 Cimtest changeset: 090c55ea601c ================================================= FAIL : 6 XFAIL : 4 SKIP : 10 PASS : 147 ----------------- Total : 167 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL VirtualSystemManagementService - 08_modifyresource.py: FAIL VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL VirtualSystemManagementService - 19_definenetwork_ers.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: PASS -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_NOT_SUPPORTED: State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): CIM_ERR_NOT_SUPPORTED: State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 34_start_disable.py: PASS -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: PASS -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: PASS -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: PASS -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: PASS -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: PASS -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: PASS -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: PASS -------------------------------------------------------------------- Processor - 01_processor.py: PASS -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: PASS -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: PASS -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: PASS -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: PASS -------------------------------------------------------------------- RASD - 02_enum.py: PASS -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL ERROR - Exception in create_pool() ERROR - Exception details: (1, u'CIM_ERR_FAILED: Pool with that name already exists') ERROR - Error in networkpool creation InvokeMethod(CreateChildResourcePool): CIM_ERR_FAILED: Pool with that name already exists -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL ERROR - Exception in create_pool() ERROR - Exception details: (1, u'CIM_ERR_FAILED: Pool with that name already exists') ERROR - Error in networkpool creation InvokeMethod(CreateChildResourcePool): CIM_ERR_FAILED: Pool with that name already exists -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: PASS -------------------------------------------------------------------- SystemDevice - 02_reverse.py: PASS -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: PASS -------------------------------------------------------------------- VSSD - 01_enum.py: PASS -------------------------------------------------------------------- VSSD - 02_bootldr.py: SKIP -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: PASS -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: PASS -------------------------------------------------------------------- VSSD - 05_set_uuid.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: FAIL ERROR - Error invoking ModifyRS: mod_net_res ERROR - (1, u"CIM_ERR_FAILED: Device `None' not found") InvokeMethod(ModifyResourceSettings): CIM_ERR_FAILED: Device `None' not found -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.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 define domain rstest_domain2 ERROR - Unable to define rstest_domain2 InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: VirtualDevice property must be unique for each DiskResourceAllocationSettingData in a single guest -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: FAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to start domain: internal error Failed to add tap interface 'vnet%d' to bridge 'virbr0' : No such device with return code 1 ERROR - Got desc: 'CIM_ERR_FAILED: Unable to start domain: internal error Failed to add tap interface 'vnet%d' to bridge 'virbr0' : No such device', exp 'Valid param ' ERROR - Starting domain with invalid network name None gave unexpected rc code 1 and description: CIM_ERR_FAILED: Unable to start domain: internal error Failed to add tap interface 'vnet%d' to bridge 'virbr0' : No such device InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to start domain: internal error Failed to add tap interface 'vnet%d' to bridge 'virbr0' : No such device -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Error invoking AddRS: add_net_res ERROR - (1, u'CIM_ERR_FAILED: Unable to change (0) device: Error 0') ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unable to change (0) device: Error 0 Bug:<00015> -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Aug 13 08:02:38 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 13 Aug 2009 01:02:38 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Updating VSMS/13*py to align with the Vdev changes Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1250150545 25200 # Node ID e8bb9c334a06962f8fbc5e12d649b9f539c077f8 # Parent 090c55ea601c4ef759475bf1d0b64eae9c8f33b8 [TEST] Updating VSMS/13*py to align with the Vdev changes. Tested with KVM on F10 and Xen on RHEL5.3 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 090c55ea601c -r e8bb9c334a06 suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py Wed Aug 12 04:28:07 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py Thu Aug 13 01:02:25 2009 -0700 @@ -27,7 +27,8 @@ from XenKvmLib import vsms from VirtLib import utils from CimTest.Globals import logger -from XenKvmLib.const import do_main +from XenKvmLib.const import do_main, KVM_secondary_disk_path, \ + Xen_secondary_disk_path from CimTest.ReturnCodes import FAIL, PASS from XenKvmLib.test_doms import destroy_and_undefine_domain from XenKvmLib.classes import get_typed_class @@ -120,7 +121,15 @@ virt_xml = get_class(options.virt) cxml = virt_xml(test_dom, mac=mac1) - cxml2 = virt_xml(test_dom2, mac=mac2) + if options.virt == 'Xen': + test_disk = 'xvdb' + disk_path = Xen_secondary_disk_path + else: + test_disk = 'hdb' + disk_path = KVM_secondary_disk_path + + cxml2 = virt_xml(test_dom2, mac=mac2, + disk=test_disk, disk_file_path=disk_path) try: rc = cxml.cim_define(options.ip) From deeptik at linux.vnet.ibm.com Thu Aug 13 10:52:19 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 13 Aug 2009 03:52:19 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing vsms/19*py Message-ID: <8651eccf3771e09bec36.1250160739@elm3b151.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1250160712 25200 # Node ID 8651eccf3771e09bec36329239452d58c8331843 # Parent e8bb9c334a06962f8fbc5e12d649b9f539c077f8 [TEST] Fixing vsms/19*py Tested with KVM on F10 and Xen on RHEL5.3 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r e8bb9c334a06 -r 8651eccf3771 suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Thu Aug 13 01:02:25 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Thu Aug 13 03:51:52 2009 -0700 @@ -68,8 +68,9 @@ 'network' : "Valid param "} } + libvirt_version = virsh_version(options.ip, options.virt) + inv_empty_network = "Network not found" if options.virt == "Xen" or options.virt == "XenFV": - libvirt_version = virsh_version(options.ip, options.virt) if libvirt_version <= "0.3.3": inv_empty_network = "no network with matching name" @@ -78,7 +79,6 @@ "device invalid')" else: - inv_empty_network = "Network not found" inv_br_str = "POST operation failed: xend_post: error from xen " + \ "daemon: (xend.err 'Device 0 (vif) could not be " + \ @@ -88,6 +88,11 @@ expected_values['empty']['network'] = inv_empty_network expected_values['invalid']['bridge'] = inv_br_str + else: + if libvirt_version >= "0.7.0": + expected_values['empty']['network'] = inv_empty_network + expected_values['invalid']['network'] = inv_empty_network + tc_scen = { 'invalid' : 'invalid', @@ -107,6 +112,7 @@ status = PASS for nettype in nettypes: for tc, field in tc_scen.iteritems(): + logger.error("DEBUG nettype is %s, field is %s, tc is %s", nettype, field, tc) cxml = vxml.get_class(options.virt)(default_dom, mac=nmac, ntype=nettype, net_name=field) diff -r e8bb9c334a06 -r 8651eccf3771 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Aug 13 01:02:25 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Aug 13 03:51:52 2009 -0700 @@ -770,11 +770,12 @@ rc = int(self.err_rc) if rc != exp_rc: - raise Exception("Got rc: %d, exp %d." % (rc, exp_rc)) + raise Exception("Error code Mismatch, Got rc: %d, exp %d." \ + % (rc, exp_rc)) - if self.err_desc.find(exp_desc) < 0: - raise Exception("Got desc: '%s', exp '%s'" % (self.err_desc, - exp_desc)) + if not exp_desc in self.err_desc: + raise Exception("Desc Mismatch, Got desc: '%s', exp '%s'" \ + % (self.err_desc, exp_desc)) except Exception, details: logger.error(details) From rmaciel at linux.vnet.ibm.com Thu Aug 13 14:32:03 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 13 Aug 2009 11:32:03 -0300 Subject: [Libvirt-cim] [PATCH] (#2) MigrationJob will write a migration mark to the infostore of the guest migrating Message-ID: # HG changeset patch # User Richard Maciel # Date 1250173906 10800 # Node ID fc6b58380e5f04b09514bdfe8aef54ed0a013e42 # Parent 20528f913ec18441bf1ef2f812d110580fa01015 (#2) MigrationJob will write a migration mark to the infostore of the guest migrating This allows ComputerSystem to know when its respective guest is being migrated #2: Fixed patch submission date Signed-off-by: Richard Maciel diff -r 20528f913ec1 -r fc6b58380e5f src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Jun 16 14:25:50 2009 -0700 +++ b/src/Virt_VSMigrationService.c Thu Aug 13 11:31:46 2009 -0300 @@ -48,6 +48,7 @@ #include "Virt_ComputerSystem.h" #include "Virt_VSMigrationSettingData.h" #include "svpc_types.h" +#include "libxkutil/infostore.h" #include "config.h" @@ -1135,6 +1136,24 @@ return s; } +static void clear_infstore_migration_mark(virDomainPtr dom) +{ + struct infostore_ctx *infp; + bool ret = false; + + infp = infostore_open(dom); + if (infp == NULL) { + CU_DEBUG("Unable to open domain information store." + "Migration mark won't be cleared"); + return; + } + + ret = infostore_set_bool(infp, "migrating", false); + CU_DEBUG("Clearing infostore migrating flag"); + + infostore_close(infp); +} + static CMPIStatus migrate_vs(struct migration_job *job) { CMPIStatus s; @@ -1210,6 +1229,7 @@ CMGetCharPtr(s.msg)); } out: + clear_infstore_migration_mark(dom); raise_deleted_ind(job); free(uri); @@ -1251,6 +1271,45 @@ return NULL; } +static bool set_infstore_migration_mark(const CMPIObjectPath *ref, + const char *domain) +{ + struct infostore_ctx *infp; + bool ret = false; + CMPIStatus s; + virConnectPtr conn = NULL; + virDomainPtr dom = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + goto out; + + dom = virDomainLookupByName(conn, domain); + if (dom == NULL) { + CU_DEBUG("No such domain"); + goto out; + } + + + infp = infostore_open(dom); + if (infp == NULL) { + CU_DEBUG("Unable to open domain information store." + "Migration mark won't be placed"); + goto out; + } + + ret = infostore_set_bool(infp, "migrating", true); + CU_DEBUG("Migration mark set"); + + infostore_close(infp); + + out: + virDomainFree(dom); + virConnectClose(conn); + + return ret; +} + static CMPIInstance *_migrate_job_new_instance(const char *cn, const char *ns) { @@ -1411,6 +1470,10 @@ goto out; } + rc = set_infstore_migration_mark(ref, domain); + if (!rc) + CU_DEBUG("Failed to set migration mark in infostore"); + ind = prepare_indication(_BROKER, inst, job, MIG_CREATED, &s); rc = raise_indication(job->context, MIG_CREATED, job->ref_ns, inst, ind); From rmaciel at linux.vnet.ibm.com Thu Aug 13 14:32:52 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 13 Aug 2009 11:32:52 -0300 Subject: [Libvirt-cim] [PATCH] (#2) Add three new OperationalStatus states and map them all to libvirt states Message-ID: # HG changeset patch # User Richard Maciel # Date 1250173962 10800 # Node ID cb885d38b2d89130c13342aa6e7455f991e8fda5 # Parent fc6b58380e5f04b09514bdfe8aef54ed0a013e42 (#2) Add three new OperationalStatus states and map them all to libvirt states OperationalStatus states added: STARTED SUSPENDED RELOCATED #2: Fixed patch submission date Signed-off-by: Richard Maciel diff -r fc6b58380e5f -r cb885d38b2d8 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Aug 13 11:31:46 2009 -0300 +++ b/src/Virt_ComputerSystem.c Thu Aug 13 11:32:42 2009 -0300 @@ -187,7 +187,7 @@ } } -static uint16_t state_lv_to_cim_os(const char lv_state) +static uint16_t state_lv_to_cim_os(const char lv_state, const bool migrating) { enum CIM_op_status { CIM_OP_STATUS_UNKNOWN = 0, @@ -208,25 +208,33 @@ CIM_OP_STATUS_DORMANT = 15, CIM_OP_STATUS_COMPLETED = 17, CIM_OP_STATUS_POWER_MODE = 18, + CIM_OP_STATUS_STARTED = 32768, + CIM_OP_STATUS_SUSPENDED = 32769, + CIM_OP_STATUS_RELOCATED = 32770, }; + + if (migrating) + return CIM_OP_STATUS_RELOCATED; + switch (lv_state) { case VIR_DOMAIN_NOSTATE: case VIR_DOMAIN_SHUTDOWN: case VIR_DOMAIN_SHUTOFF: - return CIM_OP_STATUS_DORMANT; + return CIM_OP_STATUS_STOPPED; case VIR_DOMAIN_CRASHED: return CIM_OP_STATUS_ERROR; case VIR_DOMAIN_RUNNING: + return CIM_OP_STATUS_STARTED; + case VIR_DOMAIN_BLOCKED: case VIR_DOMAIN_PAUSED: - return CIM_OP_STATUS_OK; + return CIM_OP_STATUS_SUSPENDED; default: return CIM_OP_STATUS_UNKNOWN; - } } @@ -271,6 +279,7 @@ CMPIArray *array; CMPIStatus s; struct infostore_ctx *infostore = NULL; + bool migrating = false; ret = virDomainGetInfo(dom, &info); if (ret != 0) @@ -290,14 +299,19 @@ array = CMNewArray(broker, 1, CMPI_uint16, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) return 0; + + infostore = infostore_open(dom); - op_status = state_lv_to_cim_os((const int)info.state); + if (infostore != NULL) + migrating = infostore_get_bool(infostore, "migrating"); + + op_status = state_lv_to_cim_os((const int)info.state, migrating); + CMSetArrayElementAt(array, 0, &op_status, CMPI_uint16); CMSetProperty(instance, "OperationalStatus", (CMPIValue *)&array, CMPI_uint16A); - infostore = infostore_open(dom); if (infostore != NULL) req_state = (uint16_t)infostore_get_u64(infostore, "reqstate"); else From kaitlin at linux.vnet.ibm.com Thu Aug 13 15:41:27 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 13 Aug 2009 08:41:27 -0700 Subject: [Libvirt-cim] [PATCH] MigrationJob will write a migration mark to the infostore of the guest migrating In-Reply-To: <411a3090c6a098de8091.1249923169@localhost.localdomain> References: <411a3090c6a098de8091.1249923169@localhost.localdomain> Message-ID: <4A843427.5070707@linux.vnet.ibm.com> > @@ -1135,6 +1136,24 @@ > return s; > } > > +static void clear_infstore_migration_mark(virDomainPtr dom) I would change "mark' to "flag" as I think flag makes a little more sense. > +{ > + struct infostore_ctx *infp; > + bool ret = false; > + > + infp = infostore_open(dom); > + if (infp == NULL) { > + CU_DEBUG("Unable to open domain information store." > + "Migration mark won't be cleared"); Same here, change "mark" to "flag" > + return; > + } > + > + ret = infostore_set_bool(infp, "migrating", false); > + CU_DEBUG("Clearing infostore migrating flag"); > + > + infostore_close(infp); > +} > + > static CMPIStatus migrate_vs(struct migration_job *job) > { > CMPIStatus s; > @@ -1210,6 +1229,7 @@ > CMGetCharPtr(s.msg)); > } > out: > + clear_infstore_migration_mark(dom); > raise_deleted_ind(job); > > free(uri); > @@ -1251,6 +1271,45 @@ > return NULL; > } > > +static bool set_infstore_migration_mark(const CMPIObjectPath *ref, > + const char *domain) Same here. > +{ > + struct infostore_ctx *infp; > + bool ret = false; > + CMPIStatus s; > + virConnectPtr conn = NULL; > + virDomainPtr dom = NULL; > + > + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > + if (conn == NULL) > + goto out; Instead of getting the connection here, why not take a virConnectPtr parameter? > + > + dom = virDomainLookupByName(conn, domain); > + if (dom == NULL) { > + CU_DEBUG("No such domain"); > + goto out; > + } > + > + > + infp = infostore_open(dom); > + if (infp == NULL) { > + CU_DEBUG("Unable to open domain information store." > + "Migration mark won't be placed"); Change "mark" to "flag" > + goto out; > + } > + > + ret = infostore_set_bool(infp, "migrating", true); > + CU_DEBUG("Migration mark set"); Same here. > + > + infostore_close(infp); > + > + out: > + virDomainFree(dom); > + virConnectClose(conn); > + > + return ret; > +} > + > static CMPIInstance *_migrate_job_new_instance(const char *cn, > const char *ns) > { > @@ -1411,6 +1470,10 @@ > goto out; > } > > + rc = set_infstore_migration_mark(ref, domain); > + if (!rc) > + CU_DEBUG("Failed to set migration mark in infostore"); > + Change "mark" to "flag". -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 13 16:23:12 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 13 Aug 2009 09:23:12 -0700 Subject: [Libvirt-cim] [PATCH] (#2) Add three new OperationalStatus states and map them all to libvirt states In-Reply-To: References: Message-ID: <4A843DF0.3010203@linux.vnet.ibm.com> Richard Maciel wrote: > # HG changeset patch > # User Richard Maciel > # Date 1250173962 10800 > # Node ID cb885d38b2d89130c13342aa6e7455f991e8fda5 > # Parent fc6b58380e5f04b09514bdfe8aef54ed0a013e42 > (#2) Add three new OperationalStatus states and map them all to libvirt states These states look like values for OperatingStatus.. is that what you meant instead of OperationalStatus? > > OperationalStatus states added: > STARTED > SUSPENDED > RELOCATED > > #2: > Fixed patch submission date > > Signed-off-by: Richard Maciel > > diff -r fc6b58380e5f -r cb885d38b2d8 src/Virt_ComputerSystem.c > --- a/src/Virt_ComputerSystem.c Thu Aug 13 11:31:46 2009 -0300 > +++ b/src/Virt_ComputerSystem.c Thu Aug 13 11:32:42 2009 -0300 > @@ -187,7 +187,7 @@ > } > } > > -static uint16_t state_lv_to_cim_os(const char lv_state) > +static uint16_t state_lv_to_cim_os(const char lv_state, const bool migrating) > { > enum CIM_op_status { > CIM_OP_STATUS_UNKNOWN = 0, > @@ -208,25 +208,33 @@ > CIM_OP_STATUS_DORMANT = 15, > CIM_OP_STATUS_COMPLETED = 17, > CIM_OP_STATUS_POWER_MODE = 18, > + CIM_OP_STATUS_STARTED = 32768, > + CIM_OP_STATUS_SUSPENDED = 32769, > + CIM_OP_STATUS_RELOCATED = 32770, If you're trying to add support for OperatingStatus, then I would create a new enum specifically for OperatingStatus values. I would name them differently too so that it is clear the values are different from the OperationalStatus ones. > }; > > + > + if (migrating) > + return CIM_OP_STATUS_RELOCATED; > + > switch (lv_state) { > case VIR_DOMAIN_NOSTATE: > case VIR_DOMAIN_SHUTDOWN: > case VIR_DOMAIN_SHUTOFF: > - return CIM_OP_STATUS_DORMANT; > + return CIM_OP_STATUS_STOPPED; This should be left as is. This is the correct state for OperationalStatus. > > case VIR_DOMAIN_CRASHED: > return CIM_OP_STATUS_ERROR; > > case VIR_DOMAIN_RUNNING: > + return CIM_OP_STATUS_STARTED; > + > case VIR_DOMAIN_BLOCKED: > case VIR_DOMAIN_PAUSED: > - return CIM_OP_STATUS_OK; > + return CIM_OP_STATUS_SUSPENDED; > > default: > return CIM_OP_STATUS_UNKNOWN; > - > } > } > > @@ -271,6 +279,7 @@ > CMPIArray *array; > CMPIStatus s; > struct infostore_ctx *infostore = NULL; > + bool migrating = false; > > ret = virDomainGetInfo(dom, &info); > if (ret != 0) > @@ -290,14 +299,19 @@ > array = CMNewArray(broker, 1, CMPI_uint16, &s); > if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) > return 0; > + > + infostore = infostore_open(dom); > > - op_status = state_lv_to_cim_os((const int)info.state); > + if (infostore != NULL) > + migrating = infostore_get_bool(infostore, "migrating"); > + > + op_status = state_lv_to_cim_os((const int)info.state, migrating); If migrating is false, then the state is set to "Unknown" > + > CMSetArrayElementAt(array, 0, &op_status, CMPI_uint16); > > CMSetProperty(instance, "OperationalStatus", > (CMPIValue *)&array, CMPI_uint16A); > > - infostore = infostore_open(dom); > if (infostore != NULL) > req_state = (uint16_t)infostore_get_u64(infostore, "reqstate"); > else -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Thu Aug 13 16:19:56 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 13 Aug 2009 13:19:56 -0300 Subject: [Libvirt-cim] [PATCH] Ensure hostname always returns a value In-Reply-To: References: Message-ID: <4A843D2C.1010007@linux.vnet.ibm.com> +1 On 08/12/2009 01:27 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1250034843 25200 > # Node ID c7fa7f2f08f01abe23da18e3ed3a22efbae718af > # Parent bf7220c52d7afecf85d7c2a6b11d9ba0f45052f9 > Ensure hostname always returns a value. > > Signed-off-by: Kaitlin Rupert > > diff -r bf7220c52d7a -r c7fa7f2f08f0 src/Virt_HostSystem.c > --- a/src/Virt_HostSystem.c Tue Aug 11 14:15:34 2009 -0600 > +++ b/src/Virt_HostSystem.c Tue Aug 11 16:54:03 2009 -0700 > @@ -58,7 +58,20 @@ > } > > CU_DEBUG("Unable to find FQDN, using hostname."); > - strncpy(buf, he->h_name, size); > + > + /* FIXME: An ugly hack to ensure we return something for the hostname, > + but also be sure the value isn't empty and that it doesn't > + contain "localhost" */ > + if ((he->h_name != NULL)&& (!STREQC(he->h_name, ""))&& > + (strstr(he->h_name, "localhost") == NULL)) > + strncpy(buf, he->h_name, size); > + else if ((host != NULL)&& (!STREQC(host, ""))&& > + (strstr(host, "localhost") == NULL)) > + strncpy(buf, host, size); > + else { > + CU_DEBUG("Unable to find valid hostname value."); > + return -1; > + } > > return 0; > } > @@ -78,7 +91,7 @@ > else > ret = resolve_host(host, buf, size); > > - return 0; > + return ret; > } > > static int set_host_system_properties(CMPIInstance *instance) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Aug 13 16:52:41 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 13 Aug 2009 22:22:41 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 13 2009): KVM on Fedora release 11 (Leonidas) with Pegasus In-Reply-To: <4A83B10B.4040209@linux.vnet.ibm.com> References: <4A83B10B.4040209@linux.vnet.ibm.com> Message-ID: <4A8444D9.3020901@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > ================================================= > Test Run Summary (Aug 13 2009): KVM on Fedora release 11 (Leonidas) > with Pegasus > ================================================= > Distro: Fedora release 11 (Leonidas) > Kernel: 2.6.27.5-117.fc10.x86_64 > libvirt: 0.7.0 > Hypervisor: QEMU 0.10.1 > CIMOM: Pegasus 2.9.0 > Libvirt-cim revision: 945 > Libvirt-cim changeset: 2de7d9bdb9af > Cimtest revision: 758 > Cimtest changeset: 090c55ea601c > ================================================= > FAIL : 6 > XFAIL : 4 > SKIP : 10 > PASS : 147 > ----------------- > Total : 167 > ================================================= > FAIL Test Summary: > ComputerSystemIndication - 01_created_indication.py: FAIL > ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL > ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL The pool tests failed because the pools which were being tested in the test case were already present on the machine. Deleted the network pool and when the tests were run they passed. > VirtualSystemManagementService - 08_modifyresource.py: FAIL Running this test is killing the libvirtd. Will verify this. > VirtualSystemManagementService - 13_refconfig_additional_devs.py: FAIL Providers has been updated to verify for the presence of duplicate vdev in the guest. The tc was updated for this. Fix submitted for review. > > VirtualSystemManagementService - 19_definenetwork_ers.py: FAIL > The error message have changed in libvirt, updated the test case and submitted the patch for review. -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 13 16:59:09 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 13 Aug 2009 09:59:09 -0700 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 13 2009): KVM on Fedora release 11 (Leonidas) with Pegasus In-Reply-To: <4A8444D9.3020901@linux.vnet.ibm.com> References: <4A83B10B.4040209@linux.vnet.ibm.com> <4A8444D9.3020901@linux.vnet.ibm.com> Message-ID: <4A84465D.4080709@linux.vnet.ibm.com> >> VirtualSystemManagementService - 08_modifyresource.py: FAIL > Running this test is killing the libvirtd. Will verify this. I've seen issues with libvirt 0.7.0 - are you seeing a seg fault? If so, it might be the same issue I raised on the libvirt mailing list. The seg fault actually appears to be occurring in libxslt. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Aug 13 17:01:20 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 13 Aug 2009 22:31:20 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 13 2009): KVM on Fedora release 11 (Leonidas) with Pegasus In-Reply-To: <4A84465D.4080709@linux.vnet.ibm.com> References: <4A83B10B.4040209@linux.vnet.ibm.com> <4A8444D9.3020901@linux.vnet.ibm.com> <4A84465D.4080709@linux.vnet.ibm.com> Message-ID: <4A8446E0.7090708@linux.vnet.ibm.com> Kaitlin Rupert wrote: >>> VirtualSystemManagementService - 08_modifyresource.py: FAIL >> Running this test is killing the libvirtd. Will verify this. > > I've seen issues with libvirt 0.7.0 - are you seeing a seg fault? If > so, it might be the same issue I raised on the libvirt mailing list. > The seg fault actually appears to be occurring in libxslt. > yes this is with libvirt 0.7.0. The libvirtd daemon gets killed when the test is run. Can you share the bug no ? -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 13 17:05:03 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 13 Aug 2009 10:05:03 -0700 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 13 2009): KVM on Fedora release 11 (Leonidas) with Pegasus In-Reply-To: <4A8446E0.7090708@linux.vnet.ibm.com> References: <4A83B10B.4040209@linux.vnet.ibm.com> <4A8444D9.3020901@linux.vnet.ibm.com> <4A84465D.4080709@linux.vnet.ibm.com> <4A8446E0.7090708@linux.vnet.ibm.com> Message-ID: <4A8447BF.4060507@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > > > Kaitlin Rupert wrote: >>>> VirtualSystemManagementService - 08_modifyresource.py: FAIL >>> Running this test is killing the libvirtd. Will verify this. >> >> I've seen issues with libvirt 0.7.0 - are you seeing a seg fault? If >> so, it might be the same issue I raised on the libvirt mailing list. >> The seg fault actually appears to be occurring in libxslt. >> > yes this is with libvirt 0.7.0. The libvirtd daemon gets killed when the > test is run. > Can you share the bug no ? > There's not a corresponding bug on the libvirt side. Here's the discussion thread from the libvirt list: https://www.redhat.com/archives/libvir-list/2009-August/msg00250.html -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Aug 13 17:21:48 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Thu, 13 Aug 2009 10:21:48 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing get_vssd_mof() to pass uuid param Message-ID: <125d6eb391eeab673f08.1250184108@elm3b151.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1250183951 25200 # Node ID 125d6eb391eeab673f087f7df2ade5e993f0cbe8 # Parent 090c55ea601c4ef759475bf1d0b64eae9c8f33b8 [TEST] Fixing get_vssd_mof() to pass uuid param. Rebased to the latest cimtest This patch fixes VSSD/02_bootldr.py VSSD/05_set_uuid.py Signed-off-by: Deepti B. Kalakeri diff -r 090c55ea601c -r 125d6eb391ee suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Aug 12 04:28:07 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Thu Aug 13 10:19:11 2009 -0700 @@ -128,9 +128,9 @@ class LXC_VirtualSystemSettingData(CIM_VirtualSystemSettingData): pass -def get_vssd_mof(virt, dom_name, bldr=None): +def get_vssd_mof(virt, dom_name, uuid=None, bldr=None): vssd_cn = eval(get_typed_class(virt, "VirtualSystemSettingData")) - vssd = vssd_cn(dom_name, virt, bldr) + vssd = vssd_cn(dom_name, virt, uuid=uuid, bldr=bldr) return vssd.mof() # classes to define RASD parameters diff -r 090c55ea601c -r 125d6eb391ee suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Aug 12 04:28:07 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Thu Aug 13 10:19:11 2009 -0700 @@ -563,7 +563,7 @@ self.domain_name = dom_name self.err_rc = None self.err_desc = None - self.vssd = vsms.get_vssd_mof(virt, dom_name, uuid) + self.vssd = vsms.get_vssd_mof(virt, dom_name, uuid=uuid) self.nasd = vsms.get_nasd_class(virt)(type=net_type, mac=net_mac, name=dom_name, @@ -836,7 +836,7 @@ def set_bootloader(self, ip, gtype=0): bldr = bootloader(ip, gtype) self.add_sub_node('/domain', 'bootloader', bldr) - self.vssd = vsms.get_vssd_mof(self.virt, self.domain_name, bldr) + self.vssd = vsms.get_vssd_mof(self.virt, self.domain_name, bldr=bldr) return bldr def set_bridge(self, ip): From hollisb at us.ibm.com Thu Aug 13 17:56:45 2009 From: hollisb at us.ibm.com (Hollis Blanchard) Date: Thu, 13 Aug 2009 17:56:45 -0000 Subject: [Libvirt-cim] [PATCH] [RFC] Implement libvirt event callback management Message-ID: <36aa26ca62cabda72e02.1250186205@slab.beaverton.ibm.com> # HG changeset patch # User Hollis Blanchard # Date 1250181138 25200 # Node ID 36aa26ca62cabda72e027f075889c7a0973a4e6b # Parent c345ed88f03432da53efee161d505bd64c02c32e [RFC] Implement libvirt event callback management. Libvirt requires that users implement their own event monitoring and callback-management infrastructure. Actually, two similar lists are needed: one for file descriptors to monitor, and one for pending timers. This patch starts exactly one event-monitoring thread per libvirt-cim instance. Multiple provider threads in the same process will share this thread. Signed-off-by: Hollis Blanchard --- This builds but isn't tested, and may very well contain embarrassing list manipulation or locking bugs. It really needs a consumer to test, i.e. for someone to register a domain event callback. Comments welcome. Please CC me on replies. diff --git a/libxkutil/Makefile.am b/libxkutil/Makefile.am --- a/libxkutil/Makefile.am +++ b/libxkutil/Makefile.am @@ -5,14 +5,14 @@ SUBDIRS = tests CFLAGS += $(CFLAGS_STRICT) noinst_HEADERS = cs_util.h misc_util.h device_parsing.h xmlgen.h infostore.h \ - pool_parsing.h + pool_parsing.h event.h lib_LTLIBRARIES = libxkutil.la AM_LDFLAGS = -lvirt -luuid libxkutil_la_SOURCES = cs_util_instance.c misc_util.c device_parsing.c \ - xmlgen.c infostore.c pool_parsing.c + xmlgen.c infostore.c pool_parsing.c event.c noinst_PROGRAMS = xml_parse_test diff --git a/libxkutil/event.c b/libxkutil/event.c new file mode 100644 --- /dev/null +++ b/libxkutil/event.c @@ -0,0 +1,367 @@ +/* + * Copyright IBM Corp. 2009 + * + * Authors: + * Hollis Blanchard + * + * 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 +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "event.h" + +struct timer { + int id; + int timeout; + void *opaque; + virFreeCallback ff; + struct timer *next; + bool deleted; +}; + +struct watch { + int id; + int fd; + int events; + virEventHandleCallback cb; + void *opaque; + virFreeCallback ff; + struct watch *next; + bool deleted; +}; + +static pthread_t watch_thread_id; + +static int next_watch_id; +static struct watch *watch_list; +static int watch_count; +static pthread_mutex_t watch_list_mutex = PTHREAD_MUTEX_INITIALIZER; + +static int next_timer_id; +static struct timer *timer_list; +static pthread_mutex_t timer_list_mutex = PTHREAD_MUTEX_INITIALIZER; + + +static int eventAddHandle(int fd, int events, virEventHandleCallback cb, + void *opaque, virFreeCallback ff) +{ + struct watch *watch; + + CU_DEBUG("%s", __func__); + + watch = malloc(sizeof(struct watch)); + if (!watch) + return -ENOMEM; + + watch->id = next_watch_id++; + watch->fd = fd; + watch->events = events; + watch->cb = cb; + watch->opaque = opaque; + watch->ff = ff; + + pthread_mutex_lock(&watch_list_mutex); + + watch->next = watch_list; + watch_list = watch; + watch_count++; + + pthread_mutex_unlock(&watch_list_mutex); + + return watch->id; +} + +static void eventUpdateHandle(int id, int events) +{ + struct watch *cur; + + CU_DEBUG("%s %d", __func__, id); + + for (cur = watch_list; cur != NULL; cur = cur->next) { + if (cur->id == id) { + cur->events = events; + break; + } + } +} + +/* To avoid locking problems, watches are just flagged here, and the memory is + * freed later. */ +static int eventRemoveHandle(int id) +{ + struct watch *cur; + + CU_DEBUG("%s %d", __func__, id); + + for (cur = watch_list; cur != NULL; cur = cur->next) { + if (cur->id == id) { + cur->deleted = 1; + break; + } + } + + return 0; +} + +/* Delete all watches marked for deletion. */ +static void event_watch_free_deleted(void) +{ + struct watch *cur; + struct watch **link; + + CU_DEBUG("%s", __func__); + + pthread_mutex_lock(&watch_list_mutex); + + cur = watch_list; + link = &watch_list; + while (cur != NULL) { + struct watch *next = cur->next; + + if (cur->deleted) { + *link = next; + + cur->ff(cur->opaque); + free(cur); + watch_count--; + } else + link = &cur->next; + + cur = next; + } + + pthread_mutex_unlock(&watch_list_mutex); +} + +static int eventAddTimeout(int timeout, virEventTimeoutCallback cb, + void *opaque, virFreeCallback ff) +{ + struct timer *timer; + + CU_DEBUG("%s", __func__); + + timer = malloc(sizeof(struct timer)); + if (!timer) + return -ENOMEM; + + timer->id = next_timer_id++; + timer->timeout = timeout; + timer->opaque = opaque; + timer->ff = ff; + + pthread_mutex_lock(&timer_list_mutex); + + timer->next = timer_list; + timer_list = timer; + + pthread_mutex_unlock(&timer_list_mutex); + + return timer->id; +} + +static void eventUpdateTimeout(int id, int timeout) +{ + struct timer *cur; + + CU_DEBUG("%s %d", __func__, id); + + for (cur = timer_list; cur != NULL; cur = cur->next) { + if (cur->id == id) { + cur->timeout = timeout; + break; + } + } +} + +static int eventRemoveTimeout(int id) +{ + struct timer *cur; + + CU_DEBUG("%s %d", __func__, id); + + for (cur = timer_list; cur != NULL; cur = cur->next) { + if (cur->id == id) { + cur->deleted = 1; + break; + } + } + + return 0; +} + +/* Delete all timers marked for deletion. */ +static void event_timer_free_deleted(void) +{ + struct timer *cur; + struct timer **link; + + CU_DEBUG("%s", __func__); + + pthread_mutex_lock(&timer_list_mutex); + + cur = timer_list; + link = &timer_list; + while (cur != NULL) { + struct timer *next = cur->next; + + if (cur->deleted) { + *link = next; + + cur->ff(cur->opaque); + free(cur); + } else + link = &cur->next; + + cur = next; + } + + pthread_mutex_unlock(&timer_list_mutex); +} + + + +static int poll_to_libvirt_events(int pevents) +{ + int vevents = 0; + + if (pevents & POLLIN) + vevents |= VIR_EVENT_HANDLE_READABLE; + + if (pevents & POLLOUT) + vevents |= VIR_EVENT_HANDLE_WRITABLE; + + if (pevents & POLLERR) + vevents |= VIR_EVENT_HANDLE_ERROR; + + if (pevents & POLLHUP) + vevents |= VIR_EVENT_HANDLE_HANGUP; + + return vevents; +} + +static int libvirt_to_poll_events(int vevents) +{ + int pevents = 0; + + if (vevents & VIR_EVENT_HANDLE_READABLE) + pevents |= POLLIN; + + if (vevents & VIR_EVENT_HANDLE_WRITABLE) + pevents |= POLLOUT; + + if (vevents & VIR_EVENT_HANDLE_ERROR) + pevents |= POLLERR; + + if (vevents & VIR_EVENT_HANDLE_HANGUP) + pevents |= POLLHUP; + + return pevents; +} + +static void invoke_callback(struct watch *watch, struct pollfd *pollfd) +{ + int vevents = poll_to_libvirt_events(watch->events); + + watch->cb(watch->id, watch->fd, vevents, watch->opaque); +} + +static int event_next_timeout(void) +{ + struct timer *cur; + int closest = MAXINT; + + for (cur = timer_list; cur != NULL; cur = cur->next) + if (cur->timeout < closest) + closest = cur->timeout; + + return closest; +} + +/* One thread to watch all fds for all events for all libvirt threads. */ +static void *event_thread(void *ptr) +{ + while (1) { + struct watch *cur; + struct pollfd *pollfds; + struct pollfd *pollfd; + int timeout; + int i; + + pollfds = malloc(sizeof(struct pollfd) * watch_count); + + /* fill in pollfds array from our watch list */ + for (pollfd = &pollfds[0], cur = watch_list; + cur != NULL; + pollfd++, cur = cur->next) { + pollfd->fd = cur->fd; + pollfd->events = libvirt_to_poll_events(cur->events); + } + + timeout = event_next_timeout(); + + poll(pollfds, watch_count, timeout); + + /* invoke callbacks */ + for (i = 0; i < watch_count; i++) + for (cur = watch_list; cur != NULL; cur = cur->next) + if (cur->fd == pollfds[i].fd + && !cur->deleted) { + invoke_callback(cur, &pollfds[i]); + break; + } + + free(pollfds); + + event_watch_free_deleted(); + event_timer_free_deleted(); + } + + return NULL; +} + +void init_events(void) +{ + static pthread_mutex_t thread_mutex = PTHREAD_MUTEX_INITIALIZER; + + CU_DEBUG("%s", __func__); + + pthread_mutex_lock(&thread_mutex); + + if (!watch_thread_id) { + virEventRegisterImpl(eventAddHandle, + eventUpdateHandle, + eventRemoveHandle, + eventAddTimeout, + eventUpdateTimeout, + eventRemoveTimeout); + + pthread_create(&watch_thread_id, NULL, event_thread, NULL); + } + + pthread_mutex_unlock(&thread_mutex); +} diff --git a/libxkutil/event.h b/libxkutil/event.h new file mode 100644 --- /dev/null +++ b/libxkutil/event.h @@ -0,0 +1,29 @@ +/* + * Copyright IBM Corp. 2009 + * + * Authors: + * Hollis Blanchard + * + * 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 + */ + +#ifndef __EVENT_H +#define __EVENT_H + +#include + +void init_events(void); + +#endif /* __EVENT_H */ diff --git a/libxkutil/misc_util.c b/libxkutil/misc_util.c --- a/libxkutil/misc_util.c +++ b/libxkutil/misc_util.c @@ -38,6 +38,7 @@ #include "misc_util.h" #include "cs_util.h" +#include "event.h" #include @@ -490,6 +491,7 @@ bool parse_instanceid(const CMPIObjectPa bool libvirt_cim_init(void) { + init_events(); return virInitialize() == 0; } From rmaciel at linux.vnet.ibm.com Thu Aug 13 18:07:13 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 13 Aug 2009 15:07:13 -0300 Subject: [Libvirt-cim] [PATCH] (#3) MigrationJob will write a migration flag to the infostore of the guest migrating Message-ID: <69ee9e708fe8fb2f5af5.1250186833@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1250182294 10800 # Node ID 69ee9e708fe8fb2f5af562fdc412290e30fa41e7 # Parent 20528f913ec18441bf1ef2f812d110580fa01015 (#3) MigrationJob will write a migration flag to the infostore of the guest migrating This allows ComputerSystem to know when its respective guest is being migrated #2: Fixed patch submission date #3: Changed 'mark' word to 'flag' Removed unneeded code Signed-off-by: Richard Maciel diff -r 20528f913ec1 -r 69ee9e708fe8 src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Jun 16 14:25:50 2009 -0700 +++ b/src/Virt_VSMigrationService.c Thu Aug 13 13:51:34 2009 -0300 @@ -48,6 +48,7 @@ #include "Virt_ComputerSystem.h" #include "Virt_VSMigrationSettingData.h" #include "svpc_types.h" +#include "libxkutil/infostore.h" #include "config.h" @@ -1135,6 +1136,24 @@ return s; } +static void clear_infstore_migration_flag(virDomainPtr dom) +{ + struct infostore_ctx *infp; + bool ret = false; + + infp = infostore_open(dom); + if (infp == NULL) { + CU_DEBUG("Unable to open domain information store." + "Migration flag won't be cleared"); + return; + } + + ret = infostore_set_bool(infp, "migrating", false); + CU_DEBUG("Clearing infostore migrating flag"); + + infostore_close(infp); +} + static CMPIStatus migrate_vs(struct migration_job *job) { CMPIStatus s; @@ -1210,6 +1229,7 @@ CMGetCharPtr(s.msg)); } out: + clear_infstore_migration_flag(dom); raise_deleted_ind(job); free(uri); @@ -1251,6 +1271,38 @@ return NULL; } +static bool set_infstore_migration_flag(const virConnectPtr conn, + const char *domain) +{ + struct infostore_ctx *infp; + bool ret = false; + virDomainPtr dom = NULL; + + dom = virDomainLookupByName(conn, domain); + if (dom == NULL) { + CU_DEBUG("No such domain"); + goto out; + } + + infp = infostore_open(dom); + if (infp == NULL) { + CU_DEBUG("Unable to open domain information store." + "Migration flag won't be placed"); + goto out; + } + + ret = infostore_set_bool(infp, "migrating", true); + CU_DEBUG("Migration flag set"); + + infostore_close(infp); + + out: + virDomainFree(dom); + virConnectClose(conn); + + return ret; +} + static CMPIInstance *_migrate_job_new_instance(const char *cn, const char *ns) { @@ -1411,6 +1463,10 @@ goto out; } + rc = set_infstore_migration_flag(job->conn, domain); + if (!rc) + CU_DEBUG("Failed to set migration flag in infostore"); + ind = prepare_indication(_BROKER, inst, job, MIG_CREATED, &s); rc = raise_indication(job->context, MIG_CREATED, job->ref_ns, inst, ind); From rmaciel at linux.vnet.ibm.com Thu Aug 13 18:07:40 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 13 Aug 2009 15:07:40 -0300 Subject: [Libvirt-cim] [PATCH] (#3) Add a new OperatingStatus state and map them all to libvirt states Message-ID: # HG changeset patch # User Richard Maciel # Date 1250185820 10800 # Node ID edde8b4607e96d45d2c784070c84143be4d57fef # Parent 69ee9e708fe8fb2f5af562fdc412290e30fa41e7 (#3) Add a new OperatingStatus state and map them all to libvirt states OperatingStatus state added: STARTED #2: Fixed patch submission date #3: Previous patches were setting the wrong provider variable (OperationalStatus). Signed-off-by: Richard Maciel diff -r 69ee9e708fe8 -r edde8b4607e9 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Aug 13 13:51:34 2009 -0300 +++ b/src/Virt_ComputerSystem.c Thu Aug 13 14:50:20 2009 -0300 @@ -187,6 +187,54 @@ } } +static uint16_t state_lv_to_cim_oings(const char lv_state, const bool migrating) +{ + enum CIM_oping_status { + CIM_OPING_STATUS_UNKNOWN = 0, + CIM_OPING_STATUS_NOT_AVAILABLE = 1, + CIM_OPING_STATUS_SERVICING = 2, + CIM_OPING_STATUS_STARTING = 3, + CIM_OPING_STATUS_STOPPING = 4, + CIM_OPING_STATUS_STOPPED = 5, + CIM_OPING_STATUS_ABORTED = 6, + CIM_OPING_STATUS_DORMANT = 7, + CIM_OPING_STATUS_COMPLETED = 8, + CIM_OPING_STATUS_MIGRATING = 9, + CIM_OPING_STATUS_EMIGRATING = 10, + CIM_OPING_STATUS_IMMIGRATING = 11, + CIM_OPING_STATUS_SNAPSHOTTING = 12, + CIM_OPING_STATUS_SHUTTING_DOWN = 13, + CIM_OPING_STATUS_IN_TEST = 14, + CIM_OPING_STATUS_TRANSITIONING = 15, + CIM_OPING_STATUS_IN_SERVICE = 16, + CIM_OPING_STATUS_STARTED = 32768, + }; + + + if (migrating) + return CIM_OPING_STATUS_MIGRATING; + + switch (lv_state) { + case VIR_DOMAIN_NOSTATE: + case VIR_DOMAIN_SHUTDOWN: + case VIR_DOMAIN_SHUTOFF: + return CIM_OPING_STATUS_STOPPED; + + case VIR_DOMAIN_CRASHED: + return CIM_OPING_STATUS_ABORTED; + + case VIR_DOMAIN_RUNNING: + return CIM_OPING_STATUS_STARTED; + + case VIR_DOMAIN_BLOCKED: + case VIR_DOMAIN_PAUSED: + return CIM_OPING_STATUS_DORMANT; + + default: + return CIM_OPING_STATUS_UNKNOWN; + } +} + static uint16_t state_lv_to_cim_os(const char lv_state) { enum CIM_op_status { @@ -268,9 +316,11 @@ uint16_t health_state; uint16_t req_state; uint16_t op_status; + uint16_t oping_status; CMPIArray *array; CMPIStatus s; struct infostore_ctx *infostore = NULL; + bool migrating = false; ret = virDomainGetInfo(dom, &info); if (ret != 0) @@ -298,6 +348,14 @@ (CMPIValue *)&array, CMPI_uint16A); infostore = infostore_open(dom); + + if (infostore != NULL) + migrating = infostore_get_bool(infostore, "migrating"); + + oping_status = state_lv_to_cim_oings((const int)info.state, migrating); + CMSetProperty(instance, "OperatingStatus", + (CMPIValue *)&oping_status, CMPI_uint16); + if (infostore != NULL) req_state = (uint16_t)infostore_get_u64(infostore, "reqstate"); else From rmaciel at linux.vnet.ibm.com Thu Aug 13 18:55:52 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 13 Aug 2009 15:55:52 -0300 Subject: [Libvirt-cim] [PATCH 0 of 3] Add call to libvirt to create storage volume In-Reply-To: References: Message-ID: <4A8461B8.2060006@linux.vnet.ibm.com> +1 On 08/13/2009 02:08 AM, Kaitlin Rupert wrote: > This set also has creates a StorageVolume instance to return to the user. > Ideally, the bit of code in patch 3 should be in Virt_RASD, but that takes some > signigicant amount of reshuffiling in the Virt_RASD provider. This will be > fixed after this set of patches goes in. > > This is the last set of patches to get basic image creation working. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 13 22:13:22 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 13 Aug 2009 22:13:22 -0000 Subject: [Libvirt-cim] [PATCH] [TEST] Clean up HostedDependency 04 - older test, needs restructuring Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1250201576 25200 # Node ID fae006fcf2478e28934ae764d153665bd2e139b3 # Parent 85a07c7dadb889ffeb0e38ba7de31cd42dcfcc79 [TEST] Clean up HostedDependency 04 - older test, needs restructuring This is a major overhaul of this test case. There are several issues this fix resolves: -Remove cim_undefine() calls. This call doesn't exist. Instead of cleaning up the guest in the verify_fields() call, just call try_assoc() directly from main and cleanup the guest at the end of the test -Remove "INVALID_KeyName" and "INVALID_CCNKeyName" scenarios. These test the CIMOM itself and not the providers, which outside of the scope of the test suite. Signed-off-by: Kaitlin Rupert diff -r 85a07c7dadb8 -r fae006fcf247 suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Thu Aug 13 10:19:11 2009 -0700 +++ b/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Thu Aug 13 15:12:56 2009 -0700 @@ -55,31 +55,12 @@ exp_d2 = "No such instance (CreationClassName)" expr_values = { - "INVALID_KeyName" : { 'rc' : exp_rc, 'desc' : exp_d1 }, "INVALID_NameValue" : { 'rc' : exp_rc, 'desc' : exp_d1 }, - "INVALID_CCNKeyName" : { 'rc' : exp_rc, 'desc' : exp_d2 }, "INVALID_CCNameValue" : { 'rc' : exp_rc, 'desc' : exp_d2 } } return expr_values -def verify_err_fields(cxml, server, conn, keys, classname, - assoc_classname, msg, field, expr_values): - try: - ret = try_assoc(conn, classname, assoc_classname, keys, - field_name=field, expr_values=expr_values[field], - bug_no="") - if ret != PASS: - logger.error("--- FAILED: %s---", msg) - cxml.cim_destroy(server) - cxml.cim_undefine(server) - except Exception, details: - logger.error("Exception: %s", details) - cxml.cim_destroy(server) - cxml.cim_undefine(server) - return FAIL - return ret - @do_main(sup_types) def main(): options = main.options @@ -103,55 +84,45 @@ logger.error("Failed to start the dom: %s", test_dom) return FAIL - conn = assoc.myWBEMConnection('http://%s' % server, - (CIM_USER, CIM_PASS), CIM_NS) + status = FAIL - acn = get_typed_class(virt, 'HostedDependency') - status, host_inst = get_host_info(server, virt) - if status: - logger.error("Unable to get host info") - cxml.cim_destroy(server) - cxml.undefine(server) - return status + try: + conn = assoc.myWBEMConnection('http://%s' % server, + (CIM_USER, CIM_PASS), CIM_NS) - classname = host_inst.CreationClassName - host_name = host_inst.Name + acn = get_typed_class(virt, 'HostedDependency') + status, host_inst = get_host_info(server, virt) + if status: + raise Exception("Unable to get host info") - expr_values = set_expr_values(classname) + classname = host_inst.CreationClassName + host_name = host_inst.Name - msg = 'Invalid Name Key Name' - field = 'INVALID_KeyName' - keys = { 'CreationClassName' : classname, field : host_name } - ret_value = verify_err_fields(cxml, server, conn, keys, classname, - acn, msg, field, expr_values) - if ret_value != PASS: - return ret_value - - msg = 'Invalid Name Key Value' - field='INVALID_NameValue' - keys = { 'CreationClassName' : classname, 'Name' : field } - ret_value = verify_err_fields(cxml, server, conn, keys, classname, - acn, msg, field, expr_values) - if ret_value != PASS: - return ret_value + expr_values = set_expr_values(classname) - msg = 'Invalid CreationClassName Key Name' - field='INVALID_CCNKeyName' - keys = { field : classname, 'Name' : host_name } - ret_value = verify_err_fields(cxml, server, conn, keys, classname, - acn, msg, field, expr_values) - if ret_value != PASS: - return ret_value + msg = 'Invalid Name Key Value' + field='INVALID_NameValue' + keys = { 'CreationClassName' : classname, 'Name' : field } - msg = 'Invalid CreationClassName Key Value' - field='INVALID_CCNameValue' - keys = { 'CreationClassName' : field, 'Name' : host_name } - ret_value = verify_err_fields(cxml, server, conn, keys, classname, - acn, msg, field, expr_values) - if ret_value == PASS: - cxml.cim_destroy(server) - cxml.undefine(server) - return ret_value + status = try_assoc(conn, classname, acn, keys, field_name=field, + expr_values=expr_values[field], bug_no="") + if status != PASS: + raise Exception("Test is %s failed" % field) + + msg = 'Invalid CreationClassName Key Value' + field='INVALID_CCNameValue' + keys = { 'CreationClassName' : field, 'Name' : host_name } + + status = try_assoc(conn, classname, acn, keys, field_name=field, + expr_values=expr_values[field], bug_no="") + + except Exception, details: + logger.error(details) + + cxml.cim_destroy(server) + cxml.undefine(server) + + return status if __name__ == "__main__": sys.exit(main()) From veillard at redhat.com Fri Aug 14 08:00:19 2009 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 14 Aug 2009 10:00:19 +0200 Subject: [Libvirt-cim] Problem of Python dependancies Message-ID: <20090814080019.GF15737@redhat.com> Hi, trying to run the testsuite as checkout from hg today on a Fedora 11 box I got the following error: [root at paphio cimtest]# CIM_NS=root/virt CIM_USER=root CIM_PASS=xxxxxx ./runtests libvirt-cim -v KVM -i localhost Starting test suite: libvirt-cim Traceback (most recent call last): File "main.py", line 41, in from XenKvmLib.common_util import create_netpool_conf, destroy_netpool, \ File "./lib/XenKvmLib/common_util.py", line 29, in from XenKvmLib.test_xml import * File "./lib/XenKvmLib/test_xml.py", line 32, in from xml import xpath ImportError: cannot import name xpath Looking at suites/libvirt-cim/lib/XenKvmLib/test_xml.py it seems to try to use the native xml support of Python from xml import xpath from xml.dom import minidom, Node to implement: ------------------------------------------------ def get_value_xpath(xmlStr, xpathStr): xmldoc = minidom.parseString(xmlStr) nodes = xpath.Evaluate(xpathStr, xmldoc.documentElement) if len(nodes) != 1: raise LookupError('Zero or multiple xpath results found!') node = nodes[0] if node.nodeType == Node.ATTRIBUTE_NODE: return node.value if node.nodeType == Node.TEXT_NODE: return node.toxml() if node.nodeType == Node.ELEMENT_NODE: ret = '' for child in node.childNodes: ret = ret + child.toxml() return ret -------------------------------------------------- Then get_value_xpath() is used in the module to poke various values. First it's not really optimal, the XML should probably be parsed once but the performance impact is really neglectible :-) Is there a workaround to have that code run on a standard Fedora 11 setup or did I missed anything ? I wonder if there are other uses of xml::xpath in the regression suite. In any case it might be a good idea to use libxml2 bindings instead since libvirt uses libxml2 it's not likely to be a problem and would avoid this kind of Python XML portability problems. I may even provide the trivial patch to replace that fragment of code (but if there is many other use of python xml code in the test suite, that's a different matter :-) thanks, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ From anantyog at linux.vnet.ibm.com Fri Aug 14 12:25:44 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Fri, 14 Aug 2009 05:25:44 -0700 Subject: [Libvirt-cim] [PATCH] [Test](#2)Testcase to check for duplicate UUID Message-ID: <9169e2a0e51a841e35ab.1250252744@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at in.ibm.com # Date 1250252541 25200 # Node ID 9169e2a0e51a841e35ab75ad7072c3924ed2cf91 # Parent 85a07c7dadb889ffeb0e38ba7de31cd42dcfcc79 [Test](#2)Testcase to check for duplicate UUID ModifySystemSetting does thrw an error for duplicate UUID, as Deepti Kalakeri, had indicated. I have updated my providers and redesigned the test accourdingly. Have also removed bug 00016 from 'know provider issues' wiki page. Signed-off-by: Yogananth Subramanian diff -r 85a07c7dadb8 -r 9169e2a0e51a suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py Fri Aug 14 05:22:21 2009 -0700 @@ -0,0 +1,115 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth Subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +#Steps: +#1) Define 2 domains,'default' and 'test', both with random UUID +#2) Reset the uuid of the second domain, 'test', to the uuid of the +# first domain, using ModifySystemSettings +# + +import sys +import time +from XenKvmLib import vsms +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.const import do_main +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.enumclass import GetInstance + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'uuid_domain' +test_dom = 'test_domain' +nmac = '99:aa:bb:cc:ee:ff' + +def get_vssd(ip, virt, get_cim_inst, default_dom): + cn = get_typed_class(virt, "VirtualSystemSettingData") + inst = None + + try: + if virt == "XenFV": + virt = "Xen" + + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } + inst = GetInstance(ip, cn, key_list, get_cim_inst) + + except Exception, details: + logger.error(details) + return FAIL, inst + + if inst is None: + return FAIL, inst + + return PASS, inst + + at do_main(sup_types) +def main(): + options = main.options + + service = vsms.get_vsms_class(options.virt)(options.ip) + + cxml = vxml.get_class(options.virt)(default_dom) + ret = cxml.cim_define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + + try: + status, inst = get_vssd(options.ip, options.virt, True,default_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s"% + default_dom) + + uuid = inst['UUID'] + + sxml = vxml.get_class(options.virt)(test_dom, uuid, mac=nmac) + ret = sxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s"% test_dom) + + status, inst = get_vssd(options.ip, options.virt, True,test_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s"% + test_dom) + + inst['UUID'] = uuid + vssd = inst_to_mof(inst) + ret = service.ModifySystemSettings(SystemSettings=vssd) + if ret[0] == 0: + raise Exception("Was able to define domains with duplicate UUID") + + except Exception, details: + err_no = details[0] + err_desc = details[1] + if err_desc.find("domain 'uuid_domain' is already defined"): + logger.info('Got expected error desc') + status = PASS + else: + logger.error(details) + status = FAIL + + sxml.undefine(options.ip) + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) + From kaitlin at linux.vnet.ibm.com Fri Aug 14 22:30:36 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 14 Aug 2009 15:30:36 -0700 Subject: [Libvirt-cim] Problem of Python dependancies In-Reply-To: <20090814080019.GF15737@redhat.com> References: <20090814080019.GF15737@redhat.com> Message-ID: <4A85E58C.8060803@linux.vnet.ibm.com> Daniel Veillard wrote: > Hi, > > trying to run the testsuite as checkout from hg today on a Fedora 11 > box I got the following error: > > [root at paphio cimtest]# CIM_NS=root/virt CIM_USER=root CIM_PASS=xxxxxx > ./runtests libvirt-cim -v KVM -i localhost > Starting test suite: libvirt-cim > Traceback (most recent call last): > File "main.py", line 41, in > from XenKvmLib.common_util import create_netpool_conf, > destroy_netpool, \ > File "./lib/XenKvmLib/common_util.py", line 29, in > from XenKvmLib.test_xml import * > File "./lib/XenKvmLib/test_xml.py", line 32, in > from xml import xpath > ImportError: cannot import name xpath This error is caused by a missing PyXML / pyxml package. This is mentioned as a requirement on our wiki (http://wiki.libvirt.org/page/Cimtest_setup), but not on our main webpage. I've been meaning to update the documentation on the webpage for awhile now. I'll add cimtest instructions to the list of items I need to update. =) > > Looking at suites/libvirt-cim/lib/XenKvmLib/test_xml.py This file should be removed, as it is obsolete. A few tests still reference it, but those should be updated as the functionality in test_xml.py has been replaced by suites/libvirt-cim/lib/XenKvmLib/vxml.py > it seems to try to use the native xml support of Python > > from xml import xpath > from xml.dom import minidom, Node > > to implement: > > ------------------------------------------------ > def get_value_xpath(xmlStr, xpathStr): > xmldoc = minidom.parseString(xmlStr) > nodes = xpath.Evaluate(xpathStr, xmldoc.documentElement) > > if len(nodes) != 1: > raise LookupError('Zero or multiple xpath results found!') > > node = nodes[0] > if node.nodeType == Node.ATTRIBUTE_NODE: > return node.value > if node.nodeType == Node.TEXT_NODE: > return node.toxml() > if node.nodeType == Node.ELEMENT_NODE: > ret = '' > for child in node.childNodes: > ret = ret + child.toxml() > return ret > -------------------------------------------------- > > Then get_value_xpath() is used in the module to poke various values. > First it's not really optimal, the XML should probably be parsed once > but the performance impact is really neglectible :-) > > Is there a workaround to have that code run on a standard Fedora 11 > setup or did I missed anything ? > > I wonder if there are other uses of xml::xpath in the regression > suite. In any case it might be a good idea to use libxml2 bindings > instead since libvirt uses libxml2 it's not likely to be a problem Would you recommend using libxml2 over using PyXML? > and would avoid this kind of Python XML portability problems. I may > even provide the trivial patch to replace that fragment of code (but > if there is many other use of python xml code in the test suite, that's > a different matter :-) > > thanks, > > Daniel > -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Aug 14 22:31:17 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 14 Aug 2009 15:31:17 -0700 Subject: [Libvirt-cim] [PATCH] Dup all necessary fields of the net_device struct in virt_device_dup() Message-ID: <6f6393788fc52d942a53.1250289077@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1250281843 25200 # Node ID 6f6393788fc52d942a53fdf2b93cf2a83a0559e4 # Parent 77db61a05abb9eb2e5db719677f4e15cd0626168 Dup all necessary fields of the net_device struct in virt_device_dup() Signed-off-by: Kaitlin Rupert diff -r 77db61a05abb -r 6f6393788fc5 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Wed Aug 12 22:07:51 2009 -0700 +++ b/libxkutil/device_parsing.c Fri Aug 14 13:30:43 2009 -0700 @@ -659,6 +659,8 @@ DUP_FIELD(dev, _dev, dev.net.mac); DUP_FIELD(dev, _dev, dev.net.type); DUP_FIELD(dev, _dev, dev.net.source); + DUP_FIELD(dev, _dev, dev.net.name); + DUP_FIELD(dev, _dev, dev.net.model); } else if (dev->type == CIM_RES_TYPE_DISK) { DUP_FIELD(dev, _dev, dev.disk.type); DUP_FIELD(dev, _dev, dev.disk.device); From kaitlin at linux.vnet.ibm.com Fri Aug 14 22:31:43 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 14 Aug 2009 15:31:43 -0700 Subject: [Libvirt-cim] [PATCH] Be sure to initialize msg in storage_vol_rasd_to_res() Message-ID: <9dec453226dadbd358fd.1250289103@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1250287987 25200 # Node ID 9dec453226dadbd358fdd87cbbaffe0528d25308 # Parent 6f6393788fc52d942a53fdf2b93cf2a83a0559e4 Be sure to initialize msg in storage_vol_rasd_to_res() Some versions of gcc will complain about this variable being uninitialized. Signed-off-by: Kaitlin Rupert diff -r 6f6393788fc5 -r 9dec453226da src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Fri Aug 14 13:30:43 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Fri Aug 14 15:13:07 2009 -0700 @@ -695,7 +695,7 @@ { uint16_t int_val; const char *val; - const char *msg; + const char *msg = NULL; if (cu_get_u16_prop(inst, "FormatType", &int_val) != CMPI_RC_OK) { msg = "StorageVolumeRASD FormatType field not valid"; From deeptik at linux.vnet.ibm.com Mon Aug 17 08:18:04 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 17 Aug 2009 13:48:04 +0530 Subject: [Libvirt-cim] [PATCH] [Test](#2)Testcase to check for duplicate UUID In-Reply-To: <9169e2a0e51a841e35ab.1250252744@elm3b151.beaverton.ibm.com> References: <9169e2a0e51a841e35ab.1250252744@elm3b151.beaverton.ibm.com> Message-ID: <4A89123C.9090505@linux.vnet.ibm.com> Yogananth Subramanian wrote: > # HG changeset patch > # User anantyog at in.ibm.com > # Date 1250252541 25200 > # Node ID 9169e2a0e51a841e35ab75ad7072c3924ed2cf91 > # Parent 85a07c7dadb889ffeb0e38ba7de31cd42dcfcc79 > [Test](#2)Testcase to check for duplicate UUID > > ModifySystemSetting does thrw an error for duplicate UUID, as Deepti Kalakeri, > had indicated. I have updated my providers and redesigned the test accourdingly. > Have also removed bug 00016 from 'know provider issues' wiki page. > > Signed-off-by: Yogananth Subramanian > > diff -r 85a07c7dadb8 -r 9169e2a0e51a suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/VSSD/06_dupicate_uuid.py Fri Aug 14 05:22:21 2009 -0700 > @@ -0,0 +1,115 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Yogananth Subramanian > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU 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 > +# General Public License for more details. > +# > +# You should have received a copy of the GNU 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 > +# > +#Steps: > +#1) Define 2 domains,'default' and 'test', both with random UUID > +#2) Reset the uuid of the second domain, 'test', to the uuid of the > +# first domain, using ModifySystemSettings > +# > + > +import sys > +import time > +from XenKvmLib import vsms > +from XenKvmLib import vxml > +from CimTest.Globals import logger > +from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.const import do_main > +from XenKvmLib.classes import get_typed_class, inst_to_mof > +from XenKvmLib.enumclass import GetInstance > + > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > +default_dom = 'uuid_domain' > +test_dom = 'test_domain' > +nmac = '99:aa:bb:cc:ee:ff' > + > +def get_vssd(ip, virt, get_cim_inst, default_dom): > Since you expect get_cim_inst to be True no need to pass the parameter here. Instead use get_cim_inst = True in the GetInstance() call. > + cn = get_typed_class(virt, "VirtualSystemSettingData") > + inst = None > + > + try: > + if virt == "XenFV": > + virt = "Xen" > + > + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } > + inst = GetInstance(ip, cn, key_list, get_cim_inst) > For the reasons mentioned above, this could be changed to: inst = GetInstance(ip, cn, key_list, get_cim_inst=True) > + > + except Exception, details: > + logger.error(details) > + return FAIL, inst > + > + if inst is None: > + return FAIL, inst > + > + return PASS, inst > + > + at do_main(sup_types) > +def main(): > + options = main.options > + > + service = vsms.get_vsms_class(options.virt)(options.ip) > + > + cxml = vxml.get_class(options.virt)(default_dom) > + ret = cxml.cim_define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) > + return FAIL > + > + try: > + status, inst = get_vssd(options.ip, options.virt, True,default_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s"% > + default_dom) > Need space before % > + > + uuid = inst['UUID'] > + > + sxml = vxml.get_class(options.virt)(test_dom, uuid, mac=nmac) > Don't pass uuid here, let the libvirt-cim assing one. FYI...Also, its always better to pass the arguments in the Key=Value format. This will be helpful in case the get_class() adds one more param as the second argument in which case it would make uuid would be third argument of the function get_class(). > + ret = sxml.cim_define(options.ip) > + if not ret: > + raise Exception("Failed to define the dom: %s"% test_dom) > + > + status, inst = get_vssd(options.ip, options.virt, True,test_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s"% > Need space before % > + test_dom) > + > + inst['UUID'] = uuid > I am little selfish here. Move the call for the get_vssd() for the first domain here, or change the name uuid of the first domain to uuid_defaultdomain. otherwise the tracking of the uuid information becomes little difficult. > + vssd = inst_to_mof(inst) > + ret = service.ModifySystemSettings(SystemSettings=vssd) > + if ret[0] == 0: > + raise Exception("Was able to define domains with duplicate UUID") > The log message could be changed to "Was able to Modify the domain with duplicate UUID" > + > + except Exception, details: > + err_no = details[0] > + err_desc = details[1] > + if err_desc.find("domain 'uuid_domain' is already defined"): > + logger.info('Got expected error desc') > + status = PASS > + else: > + logger.error(details) > + status = FAIL > + > + sxml.undefine(options.ip) > + cxml.undefine(options.ip) > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > + > > Also, can you change the name of the test case from 06_dupicate_uuid.py to 06_duplicate_uuid.py. > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Aug 17 08:42:01 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 17 Aug 2009 14:12:01 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Clean up HostedDependency 04 - older test, needs restructuring In-Reply-To: References: Message-ID: <4A8917D9.7050208@linux.vnet.ibm.com> +1 -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Aug 17 09:23:18 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 17 Aug 2009 14:53:18 +0530 Subject: [Libvirt-cim] Test Run Summary (Aug 17 2009): KVM on Fedora release 11 (Leonidas) with Pegasus Message-ID: <4A892186.8000007@linux.vnet.ibm.com> ================================================= Test Run Summary (Aug 17 2009): KVM on Fedora release 11 (Leonidas) with Pegasus ================================================= Distro: Fedora release 11 (Leonidas) Kernel: 2.6.27.5-117.fc10.x86_64 libvirt: 0.7.0 Hypervisor: QEMU 0.10.1 CIMOM: Pegasus 2.9.0 Libvirt-cim revision: 956 Libvirt-cim changeset: 77db61a05abb Cimtest revision: 761 Cimtest changeset: 85a07c7dadb8 ================================================= FAIL : 3 XFAIL : 3 SKIP : 10 PASS : 151 ----------------- Total : 167 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL VirtualSystemManagementService - 08_modifyresource.py: FAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: PASS -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_NOT_SUPPORTED: State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): CIM_ERR_NOT_SUPPORTED: State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 34_start_disable.py: PASS -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: PASS -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: PASS -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: PASS -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: PASS -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: PASS -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: PASS -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: PASS -------------------------------------------------------------------- Processor - 01_processor.py: PASS -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: PASS -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: PASS -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: PASS -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: PASS -------------------------------------------------------------------- RASD - 02_enum.py: PASS -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: PASS -------------------------------------------------------------------- SystemDevice - 02_reverse.py: PASS -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: PASS -------------------------------------------------------------------- VSSD - 01_enum.py: PASS -------------------------------------------------------------------- VSSD - 02_bootldr.py: SKIP -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: PASS -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: PASS -------------------------------------------------------------------- VSSD - 05_set_uuid.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: FAIL ERROR - Error invoking ModifyRS: mod_net_res ERROR - (1, u"CIM_ERR_FAILED: Device `None' not found") InvokeMethod(ModifyResourceSettings): CIM_ERR_FAILED: Device `None' not found -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: FAIL ERROR - Failed to create Virtual Network 'my_network1' ERROR - Unable to create network pool my_network1 -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Aug 17 09:25:17 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 17 Aug 2009 14:55:17 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 17 2009): KVM on Fedora release 11 (Leonidas) with Pegasus In-Reply-To: <4A892186.8000007@linux.vnet.ibm.com> References: <4A892186.8000007@linux.vnet.ibm.com> Message-ID: <4A8921FD.7010501@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > ================================================= > Test Run Summary (Aug 17 2009): KVM on Fedora release 11 (Leonidas) > with Pegasus > ================================================= > Distro: Fedora release 11 (Leonidas) > Kernel: 2.6.27.5-117.fc10.x86_64 > libvirt: 0.7.0 > Hypervisor: QEMU 0.10.1 > CIMOM: Pegasus 2.9.0 > Libvirt-cim revision: 956 > Libvirt-cim changeset: 77db61a05abb > Cimtest revision: 761 > Cimtest changeset: 85a07c7dadb8 > ================================================= > FAIL : 3 > XFAIL : 3 > SKIP : 10 > PASS : 151 > ----------------- > Total : 167 > ================================================= > FAIL Test Summary: > ComputerSystemIndication - 01_created_indication.py: FAIL > VirtualSystemManagementService - 08_modifyresource.py: FAIL Known issues > VirtualSystemManagementService - 22_addmulti_brg_interface.py: FAIL This XFAILed as expected when run manually. > > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Aug 17 11:17:35 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Mon, 17 Aug 2009 04:17:35 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Removing the unused reference to test_xml from the tc Message-ID: <6234055ffd27ae76486c.1250507855@elm3b151.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1250507810 25200 # Node ID 6234055ffd27ae76486caf7a07eeccd4cc2589b7 # Parent 85a07c7dadb889ffeb0e38ba7de31cd42dcfcc79 [TEST] Removing the unused reference to test_xml from the tc. Tested with KVM on F10 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 85a07c7dadb8 -r 6234055ffd27 suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Thu Aug 13 10:19:11 2009 -0700 +++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Mon Aug 17 04:16:50 2009 -0700 @@ -38,7 +38,6 @@ import sys from pywbem.cim_obj import CIMInstanceName -from XenKvmLib.test_xml import testxml from VirtLib import utils from CimTest import Globals from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS diff -r 85a07c7dadb8 -r 6234055ffd27 suites/libvirt-cim/cimtest/Processor/01_processor.py --- a/suites/libvirt-cim/cimtest/Processor/01_processor.py Thu Aug 13 10:19:11 2009 -0700 +++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py Mon Aug 17 04:16:50 2009 -0700 @@ -27,7 +27,6 @@ from VirtLib import utils from XenKvmLib.xm_virt_util import active_domain_list from XenKvmLib.enumclass import GetInstance -from XenKvmLib.test_xml import testxml from XenKvmLib.classes import get_typed_class from XenKvmLib.vxml import XenXML, KVMXML, get_class from CimTest.Globals import logger From kaitlin at linux.vnet.ibm.com Mon Aug 17 20:05:36 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 17 Aug 2009 13:05:36 -0700 Subject: [Libvirt-cim] [PATCH] [RFC] Implement libvirt event callback management In-Reply-To: <36aa26ca62cabda72e02.1250186205@slab.beaverton.ibm.com> References: <36aa26ca62cabda72e02.1250186205@slab.beaverton.ibm.com> Message-ID: <4A89B810.2000300@linux.vnet.ibm.com> Hollis Blanchard wrote: > # HG changeset patch > # User Hollis Blanchard > # Date 1250181138 25200 > # Node ID 36aa26ca62cabda72e027f075889c7a0973a4e6b > # Parent c345ed88f03432da53efee161d505bd64c02c32e > [RFC] Implement libvirt event callback management. > > Libvirt requires that users implement their own event monitoring and > callback-management infrastructure. Actually, two similar lists are needed: one > for file descriptors to monitor, and one for pending timers. > > This patch starts exactly one event-monitoring thread per libvirt-cim instance. > Multiple provider threads in the same process will share this thread. > > Signed-off-by: Hollis Blanchard > > --- > This builds but isn't tested, and may very well contain embarrassing list > manipulation or locking bugs. It really needs a consumer to test, i.e. for > someone to register a domain event callback. > > Comments welcome. This looks great Hollis. Thanks! I haven't had a chance to test it, but Richard is working on some code that will utilize this. > static int eventAddHandle(int fd, int events, virEventHandleCallback cb, > + void *opaque, virFreeCallback ff) > +{ > + struct watch *watch; > + > + CU_DEBUG("%s", __func__); > + We really should include the function name in our CU_DEBUG() statement. I have some other ideas as to how to improve CU_DEBUG, so I will include the function when I work on those enhancements. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Tue Aug 18 11:45:47 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 18 Aug 2009 17:15:47 +0530 Subject: [Libvirt-cim] [PATCH] (#3) Add a new OperatingStatus state and map them all to libvirt states In-Reply-To: References: Message-ID: <4A8A946B.40303@linux.vnet.ibm.com> Richard Maciel wrote: > # HG changeset patch > # User Richard Maciel > # Date 1250185820 10800 > # Node ID edde8b4607e96d45d2c784070c84143be4d57fef > # Parent 69ee9e708fe8fb2f5af562fdc412290e30fa41e7 > (#3) Add a new OperatingStatus state and map them all to libvirt states > > OperatingStatus state added: > STARTED > > #2: > Fixed patch submission date > > #3: > Previous patches were setting the wrong provider variable (OperationalStatus). > > Signed-off-by: Richard Maciel > > diff -r 69ee9e708fe8 -r edde8b4607e9 src/Virt_ComputerSystem.c > --- a/src/Virt_ComputerSystem.c Thu Aug 13 13:51:34 2009 -0300 > +++ b/src/Virt_ComputerSystem.c Thu Aug 13 14:50:20 2009 -0300 > @@ -187,6 +187,54 @@ > } > } > > +static uint16_t state_lv_to_cim_oings(const char lv_state, const bool migrating) > +{ > + enum CIM_oping_status { > + CIM_OPING_STATUS_UNKNOWN = 0, > + CIM_OPING_STATUS_NOT_AVAILABLE = 1, > + CIM_OPING_STATUS_SERVICING = 2, > What does SERVICING Mean ? > + CIM_OPING_STATUS_STARTING = 3, > + CIM_OPING_STATUS_STOPPING = 4, > Whats the difference between STOPPED and STOPPING ? > + CIM_OPING_STATUS_STOPPED = 5, > + CIM_OPING_STATUS_ABORTED = 6, > + CIM_OPING_STATUS_DORMANT = 7, > + CIM_OPING_STATUS_COMPLETED = 8, > + CIM_OPING_STATUS_MIGRATING = 9, > + CIM_OPING_STATUS_EMIGRATING = 10, > When does the VM go to CIM_OPING_STATUS_EMIGRATING state ? > + CIM_OPING_STATUS_IMMIGRATING = 11, > When does the VM go to CIM_OPING_STATUS_IMMIGRATING state ? > + CIM_OPING_STATUS_SNAPSHOTTING = 12, > + CIM_OPING_STATUS_SHUTTING_DOWN = 13, > + CIM_OPING_STATUS_IN_TEST = 14, > + CIM_OPING_STATUS_TRANSITIONING = 15, > Also,CIM_OPING_STATUS_IN_TEST , CIM_OPING_STATUS_TRANSITIONING? > + CIM_OPING_STATUS_IN_SERVICE = 16, > Which SERVICE does the VM will be in to use the CIM_OPING_STATUS_IN_SERVICE State ? > + CIM_OPING_STATUS_STARTED = 32768, > + }; > Not all of these states used as of now in libvirt-cim providers aint ? > + > + > + if (migrating) > + return CIM_OPING_STATUS_MIGRATING; > + > + switch (lv_state) { > + case VIR_DOMAIN_NOSTATE: > + case VIR_DOMAIN_SHUTDOWN: > + case VIR_DOMAIN_SHUTOFF: > + return CIM_OPING_STATUS_STOPPED; > + > + case VIR_DOMAIN_CRASHED: > + return CIM_OPING_STATUS_ABORTED; > + > + case VIR_DOMAIN_RUNNING: > + return CIM_OPING_STATUS_STARTED; > + > + case VIR_DOMAIN_BLOCKED: > + case VIR_DOMAIN_PAUSED: > + return CIM_OPING_STATUS_DORMANT; > + > + default: > + return CIM_OPING_STATUS_UNKNOWN; > + } > +} > + > static uint16_t state_lv_to_cim_os(const char lv_state) > { > enum CIM_op_status { > @@ -268,9 +316,11 @@ > uint16_t health_state; > uint16_t req_state; > uint16_t op_status; > + uint16_t oping_status; > CMPIArray *array; > CMPIStatus s; > struct infostore_ctx *infostore = NULL; > + bool migrating = false; > > ret = virDomainGetInfo(dom, &info); > if (ret != 0) > @@ -298,6 +348,14 @@ > (CMPIValue *)&array, CMPI_uint16A); > > infostore = infostore_open(dom); > + > + if (infostore != NULL) > + migrating = infostore_get_bool(infostore, "migrating"); > + > + oping_status = state_lv_to_cim_oings((const int)info.state, migrating); > + CMSetProperty(instance, "OperatingStatus", > + (CMPIValue *)&oping_status, CMPI_uint16); > + > if (infostore != NULL) > req_state = (uint16_t)infostore_get_u64(infostore, "reqstate"); > else > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Tue Aug 18 13:03:34 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Tue, 18 Aug 2009 10:03:34 -0300 Subject: [Libvirt-cim] [PATCH] (#3) Add a new OperatingStatus state and map them all to libvirt states In-Reply-To: <4A8A946B.40303@linux.vnet.ibm.com> References: <4A8A946B.40303@linux.vnet.ibm.com> Message-ID: <4A8AA6A6.7040302@linux.vnet.ibm.com> Hi Deepti! Please refer to the CIM_ManagedSystemElement.mof to see the meaning of each state. As you already noticed, I only use some of the states defined. I do this, because libvirt only returns a few states. That means you can safely ignore the libvirt-cim states not mapped to libvirt states. About the logic used to map states, follows the method used: I added only one state to the "OperatingStatus" attribute: Started Now the mapping was done using the following instructions (libvirt-cim state: libvirt state): Started: VIR_RUNNING Dormant (equivalent to suspend): VIR_BLOCKED or VIR_PAUSED Migrating (equivalent to relocated): There isn't really a libvirt state to track down migrations. So, I submitted a patch to write migration information to the infostore when a MigrationJob is created and to clean that information when a MigrationJob is deleted. Stopped: VIR_NOSTATE, VIR_SHUTDOWN or VIR_SHUTOFF Aborted: VIR_CRASHED Unknown: Every other state not mentioned here On 08/18/2009 08:45 AM, Deepti B Kalakeri wrote: > > > Richard Maciel wrote: >> # HG changeset patch >> # User Richard Maciel >> # Date 1250185820 10800 >> # Node ID edde8b4607e96d45d2c784070c84143be4d57fef >> # Parent 69ee9e708fe8fb2f5af562fdc412290e30fa41e7 >> (#3) Add a new OperatingStatus state and map them all to libvirt states >> >> OperatingStatus state added: >> STARTED >> >> #2: >> Fixed patch submission date >> >> #3: >> Previous patches were setting the wrong provider variable >> (OperationalStatus). >> >> Signed-off-by: Richard Maciel >> >> diff -r 69ee9e708fe8 -r edde8b4607e9 src/Virt_ComputerSystem.c >> --- a/src/Virt_ComputerSystem.c Thu Aug 13 13:51:34 2009 -0300 >> +++ b/src/Virt_ComputerSystem.c Thu Aug 13 14:50:20 2009 -0300 >> @@ -187,6 +187,54 @@ >> } >> } >> >> +static uint16_t state_lv_to_cim_oings(const char lv_state, const bool >> migrating) >> +{ >> + enum CIM_oping_status { >> + CIM_OPING_STATUS_UNKNOWN = 0, >> + CIM_OPING_STATUS_NOT_AVAILABLE = 1, >> + CIM_OPING_STATUS_SERVICING = 2, > What does SERVICING Mean ? >> + CIM_OPING_STATUS_STARTING = 3, >> + CIM_OPING_STATUS_STOPPING = 4, > Whats the difference between STOPPED and STOPPING ? >> + CIM_OPING_STATUS_STOPPED = 5, >> + CIM_OPING_STATUS_ABORTED = 6, >> + CIM_OPING_STATUS_DORMANT = 7, >> + CIM_OPING_STATUS_COMPLETED = 8, >> + CIM_OPING_STATUS_MIGRATING = 9, >> + CIM_OPING_STATUS_EMIGRATING = 10, > When does the VM go to CIM_OPING_STATUS_EMIGRATING state ? >> + CIM_OPING_STATUS_IMMIGRATING = 11, > When does the VM go to CIM_OPING_STATUS_IMMIGRATING state ? >> + CIM_OPING_STATUS_SNAPSHOTTING = 12, >> + CIM_OPING_STATUS_SHUTTING_DOWN = 13, >> + CIM_OPING_STATUS_IN_TEST = 14, >> + CIM_OPING_STATUS_TRANSITIONING = 15, > Also,CIM_OPING_STATUS_IN_TEST , CIM_OPING_STATUS_TRANSITIONING? >> + CIM_OPING_STATUS_IN_SERVICE = 16, > Which SERVICE does the VM will be in to use the > CIM_OPING_STATUS_IN_SERVICE State ? >> + CIM_OPING_STATUS_STARTED = 32768, >> + }; > Not all of these states used as of now in libvirt-cim providers aint ? >> + >> + + if (migrating) >> + return CIM_OPING_STATUS_MIGRATING; >> + >> + switch (lv_state) { >> + case VIR_DOMAIN_NOSTATE: >> + case VIR_DOMAIN_SHUTDOWN: >> + case VIR_DOMAIN_SHUTOFF: >> + return CIM_OPING_STATUS_STOPPED; >> + >> + case VIR_DOMAIN_CRASHED: >> + return CIM_OPING_STATUS_ABORTED; >> + >> + case VIR_DOMAIN_RUNNING: >> + return CIM_OPING_STATUS_STARTED; >> + >> + case VIR_DOMAIN_BLOCKED: >> + case VIR_DOMAIN_PAUSED: >> + return CIM_OPING_STATUS_DORMANT; >> + >> + default: >> + return CIM_OPING_STATUS_UNKNOWN; >> + } >> +} >> + >> static uint16_t state_lv_to_cim_os(const char lv_state) >> { >> enum CIM_op_status { >> @@ -268,9 +316,11 @@ >> uint16_t health_state; >> uint16_t req_state; >> uint16_t op_status; >> + uint16_t oping_status; >> CMPIArray *array; >> CMPIStatus s; >> struct infostore_ctx *infostore = NULL; >> + bool migrating = false; >> >> ret = virDomainGetInfo(dom, &info); >> if (ret != 0) @@ -298,6 +348,14 @@ >> (CMPIValue *)&array, CMPI_uint16A); >> >> infostore = infostore_open(dom); >> + >> + if (infostore != NULL) + migrating = infostore_get_bool(infostore, >> "migrating"); >> + >> + oping_status = state_lv_to_cim_oings((const int)info.state, migrating); >> + CMSetProperty(instance, "OperatingStatus", >> + (CMPIValue *)&oping_status, CMPI_uint16); >> + >> if (infostore != NULL) >> req_state = (uint16_t)infostore_get_u64(infostore, "reqstate"); >> else >> >> _______________________________________________ >> Libvirt-cim mailing list >> Libvirt-cim at redhat.com >> https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Aug 18 18:21:10 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 18 Aug 2009 11:21:10 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fix LXC connection uri Message-ID: <5d129fff36960c419dda.1250619670@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1250619664 25200 # Node ID 5d129fff36960c419dda641692c9f5b8682c5a3c # Parent 5c08aeea7fa147dea06d6b1f0c75c2de70b4b0ae [TEST] Fix LXC connection uri... And be sure not to pass a graphics device when creating a Containers guest. These changes are dependent on libvirt-cim patch "Fix LXC connection uri, remove default graphics device" diff -r 5c08aeea7fa1 -r 5d129fff3696 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Aug 17 04:16:50 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Aug 18 11:21:04 2009 -0700 @@ -151,7 +151,8 @@ elif vir_type == 'kvm': self.vuri = 'qemu:///system' elif vir_type == 'lxc': - self.vuri = 'lxc:///system' + #self.vuri = 'lxc:///system' + self.vuri = 'lxc:///' def run(self, ip, vcmd, param): file_arg_cmds = ['define', 'create', 'net-create', 'pool-create'] @@ -572,17 +573,18 @@ self.pasd = vsms.get_pasd_class(virt)(name=dom_name) self.dasd = vsms.get_dasd_class(virt)(disk_dev, disk_source, dom_name) + self.gasd = None else: self.pasd = vsms.get_pasd_class(virt)(vcpu=vcpus, name=dom_name) self.dasd = vsms.get_dasd_class(virt)(disk_dev, disk_source, dom_name, emu_type) + self.gasd = vsms.get_gasd_class(virt)(name=dom_name, + res_sub_type=grstype, ip=ip, + lport=port_num, keymap=kmap, + vnc_passwd=vnc_passwd) self.masd = vsms.get_masd_class(virt)(megabytes=mem, mallocunits=mem_allocunits, name=dom_name) - self.gasd = vsms.get_gasd_class(virt)(name=dom_name, - res_sub_type=grstype, ip=ip, - lport=port_num, keymap=kmap, - vnc_passwd=vnc_passwd) self.iasd = vsms.get_iasd_class(virt)(name=dom_name, res_sub_type=irstype, bus_type=btype) diff -r 5c08aeea7fa1 -r 5d129fff3696 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Mon Aug 17 04:16:50 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Aug 18 11:21:04 2009 -0700 @@ -313,7 +313,8 @@ if virt == "KVM": return "qemu:///system" if virt == "LXC": - return "lxc:///system" + #return "lxc:///system" + return "lxc:///" return "" def run_remote_guest(ip, domain, command): From kaitlin at linux.vnet.ibm.com Tue Aug 18 18:18:25 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 18 Aug 2009 11:18:25 -0700 Subject: [Libvirt-cim] [PATCH] Fix LXC connection uri, remove default graphics device Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1250619499 25200 # Node ID b15ece6f581dd1372261edd782f41411d1a90652 # Parent 4ceb7a25fdfe0ff4ab994d151e3e98ba70ac5e05 Fix LXC connection uri, remove default graphics device Using "lxc:///system" for the connection uri used to work, but it is no longer valid. Containers guests do not support devices. Older versions of libvirt didn't do strict checking of guest XMLs, but this has been changed in newer versions. Signed-off-by: Kaitlin Rupert diff -r 4ceb7a25fdfe -r b15ece6f581d libxkutil/misc_util.c --- a/libxkutil/misc_util.c Tue Aug 18 11:18:18 2009 -0700 +++ b/libxkutil/misc_util.c Tue Aug 18 11:18:19 2009 -0700 @@ -50,7 +50,7 @@ else if (STARTS_WITH(classname, "KVM")) return "qemu:///system"; else if (STARTS_WITH(classname, "LXC")) - return "lxc:///system"; + return "lxc:///"; else return NULL; } diff -r 4ceb7a25fdfe -r b15ece6f581d src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Tue Aug 18 11:18:18 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Tue Aug 18 11:18:19 2009 -0700 @@ -323,6 +323,9 @@ static bool default_graphics_device(struct domain *domain) { + if (domain->type == DOMAIN_LXC) + return true; + free(domain->dev_graphics); domain->dev_graphics = calloc(1, sizeof(*domain->dev_graphics)); if (domain->dev_graphics == NULL) { @@ -946,8 +949,6 @@ return net_rasd_to_vdev(inst, dev, ns); } else if (type == CIM_RES_TYPE_PROC) { return lxc_proc_rasd_to_vdev(inst, dev); - } else if (type == CIM_RES_TYPE_GRAPHICS) { - return graphics_rasd_to_vdev(inst, dev); } else if (type == CIM_RES_TYPE_INPUT) { return input_rasd_to_vdev(inst, dev); } From rmaciel at linux.vnet.ibm.com Sun Aug 16 07:27:23 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Sun, 16 Aug 2009 04:27:23 -0300 Subject: [Libvirt-cim] [PATCH 0 of 2] [RFC] Creates GuestCrashAlertIndication Message-ID: From rmaciel at linux.vnet.ibm.com Sun Aug 16 07:27:24 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Sun, 16 Aug 2009 04:27:24 -0300 Subject: [Libvirt-cim] [PATCH 1 of 2] Creates and register provider class GuestCrashAlertIndication In-Reply-To: References: Message-ID: <0377e5c28fba407e7bf2.1250407644@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1248549583 10800 # Node ID 0377e5c28fba407e7bf2aae4c5f81d8e521a2adb # Parent 522c25cd3023342fedd387a64e0d6224e33745b9 Creates and register provider class GuestCrashAlertIndication Signed-off-by: Richard Maciel diff -r 522c25cd3023 -r 0377e5c28fba Makefile.am --- a/Makefile.am Thu Aug 13 09:32:18 2009 -0700 +++ b/Makefile.am Sat Jul 25 16:19:43 2009 -0300 @@ -55,7 +55,8 @@ schema/InputPool.mof \ schema/HostedAccessPoint.mof \ schema/ServiceAccessBySAP.mof \ - schema/SAPAvailableForElement.mof + schema/SAPAvailableForElement.mof \ + schema/GuestCrashAlertIndication.mof INTEROP_MOFS = \ schema/ComputerSystem.mof \ @@ -129,7 +130,8 @@ schema/InputPool.registration \ schema/HostedAccessPoint.registration \ schema/ServiceAccessBySAP.registration \ - schema/SAPAvailableForElement.registration + schema/SAPAvailableForElement.registration \ + schema/GuestCrashAlertIndication.registration INTEROP_REGS = \ schema/RegisteredProfile.registration \ diff -r 522c25cd3023 -r 0377e5c28fba schema/GuestCrashAlertIndication.mof --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/GuestCrashAlertIndication.mof Sat Jul 25 16:19:43 2009 -0300 @@ -0,0 +1,17 @@ +// Copyright IBM Corp. 2007 + +[Description ("Xen guest crash alert"), + Provider("cmpi::Virt_GuestCrashAlertIndication") +] +class Xen_GuestCrashAlertIndication : CIM_AlertIndication +{ + //uint32 RaiseIndication([IN] CIM_InstCreation REF TheIndication); +}; + +[Description ("KVM guest crash alert"), + Provider("cmpi::Virt_GuestCrashAlertIndication") +] +class KVM_GuestCrashAlertIndication : CIM_AlertIndication +{ + //uint32 RaiseIndication([IN] CIM_InstCreation REF TheIndication); +}; diff -r 522c25cd3023 -r 0377e5c28fba schema/GuestCrashAlertIndication.registration --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/GuestCrashAlertIndication.registration Sat Jul 25 16:19:43 2009 -0300 @@ -0,0 +1,4 @@ +# Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes +Xen_GuestCrashAlertIndication root/virt Virt_GuestCrashAlertIndicationProvider Virt_GuestCrashAlertIndication indication method +KVM_GuestCrashAlertIndication root/virt Virt_GuestCrashAlertIndicationProvider Virt_GuestCrashAlertIndication indication method From rmaciel at linux.vnet.ibm.com Sun Aug 16 07:27:25 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Sun, 16 Aug 2009 04:27:25 -0300 Subject: [Libvirt-cim] [PATCH 2 of 2] Raises GuestCrashAlertIndication when QEMU crashes In-Reply-To: References: Message-ID: # HG changeset patch # User Richard Maciel # Date 1248549583 10800 # Node ID a9a9447fc6357f9fd47f40b5a9bc4b97a5541d0f # Parent 0377e5c28fba407e7bf2aae4c5f81d8e521a2adb Raises GuestCrashAlertIndication when QEMU crashes Signed-off-by: Richard Maciel diff -r 0377e5c28fba -r a9a9447fc635 src/Makefile.am --- a/src/Makefile.am Sat Jul 25 16:19:43 2009 -0300 +++ b/src/Makefile.am Sat Jul 25 16:19:43 2009 -0300 @@ -75,7 +75,8 @@ libVirt_ServiceAffectsElement.la \ libVirt_HostedAccessPoint.la \ libVirt_ServiceAccessBySAP.la \ - libVirt_SAPAvailableForElement.la + libVirt_SAPAvailableForElement.la \ + libVirt_GuestCrashAlertIndication.la libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c libVirt_ComputerSystem_la_DEPENDENCIES = libVirt_VirtualSystemSnapshotService.la @@ -233,3 +234,7 @@ libVirt_SAPAvailableForElement_la_SOURCES = Virt_SAPAvailableForElement.c libVirt_SAPAvailableForElement_la_LIBADD = -lVirt_ComputerSystem -lVirt_KVMRedirectionSAP +libVirt_GuestCrashAlertIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la +libVirt_GuestCrashAlertIndication_la_SOURCES = Virt_GuestCrashAlertIndication.c +libVirt_GuestCrashAlertIndication_la_LIBADD = + diff -r 0377e5c28fba -r a9a9447fc635 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Sat Jul 25 16:19:43 2009 -0300 +++ b/src/Virt_ComputerSystemIndication.c Sat Jul 25 16:19:43 2009 -0300 @@ -692,6 +692,8 @@ char *prefix = NULL; bool rc; + CU_DEBUG("Raise indication"); + if (!lifecycle_enabled) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, diff -r 0377e5c28fba -r a9a9447fc635 src/Virt_GuestCrashAlertIndication.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_GuestCrashAlertIndication.c Sat Jul 25 16:19:43 2009 -0300 @@ -0,0 +1,409 @@ +/* + * Copyright IBM Corp. 2009 + * + * Authors: + * Richard Maciel + * + * 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 +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "config.h" + +typedef struct cb_info { + const CMPIContext *context; + const CMPIObjectPath *ref; +} *cb_info_ptr; + +static const CMPIBroker *_BROKER; + +static CMPIStatus trigger_indication(const CMPIContext *context) +{ + CU_DEBUG("guest crash indication triggered"); + return(CMPIStatus){CMPI_RC_OK, NULL}; +} + +static void set_alert_ind_props(const CMPIBroker *broker, + const char *prefix, + const CMPIContext *ctx, + CMPIInstance *ind) +{ + CMPIStatus s; + CMPIString *str; + CMPIUint16 uint16; + CMPIArray *array; + + + //CMSetProperty(ind, "Description", &str, CMPI_string); + + str = CMNewString(broker, prefix, &s); + CMSetProperty(ind, "AlertingManagedElement", &str, CMPI_string); + + // val 1 + uint16 = 1; + CMSetProperty(ind, "AlertType", &uint16, CMPI_uint16); + + str = CMNewString(broker, "VM Crash", &s); + CMSetProperty(ind, "OtherAlertType", &str, CMPI_string); + + uint16 = 7; + CMSetProperty(ind, "PerceivedSeverity", &uint16, CMPI_uint16); + + // val 48 + uint16 = 48; + CMSetProperty(ind, "ProbableCause", &uint16, CMPI_uint16); + + //CMSetProperty(ind, "ProbableCauseDescription", &str, CMPI_string); + + // val 1 + uint16 = 1; + CMSetProperty(ind, "Trending", &uint16, CMPI_uint16); + + // This is an array + // CMSetProperty(ind, "RecommendedActions", &str, CMPI_string); + + CMSetProperty(ind, "EventID", &str, CMPI_string); + + // Must find how to fill it + //CMSetProperty(ind, "EventTime", &, CMPI_dateTime); + + // Won't use it + //CMSetProperty(ind, "SystemCreationClassName", &str, CMPI_string); + + // Won't use it + // CMSetProperty(ind, "SystemName", &str, CMPI_string); + + // Won't use it + // CMSetProperty(ind, "ProviderName", &str, CMPI_string); + + str = CMNewString(broker, "DTMF", &s); + CMSetProperty(ind, "OwningEntity", &str, CMPI_string); + + str = CMNewString(broker, "PLAT0002", &s); + CMSetProperty(ind, "MessageID", &str, CMPI_string); + + //CMSetProperty(ind, "Message", &str, CMPI_string); + + // This is an string array + array = CMNewArray(broker, 1, CMPI_stringA, &s); + str = CMNewString(broker, + "Virtual machine execution ended " + "unexpectly", + &s); + s = CMSetArrayElementAt(array, 0, &str, CMPI_string); + CMSetProperty(ind, "MessageArguments", &array, CMPI_string); +} + +static CMPIStatus create_and_deliver_ind(const CMPIBroker *broker, + const CMPIContext *ctx, + char *prefix, + struct ind_args *args) +{ + const char *ind_type_name = "GuestCrashAlertIndication"; + CMPIObjectPath *ind_op; + CMPIInstance *ind; + CMPIStatus s; + + ind = get_typed_instance(broker, + prefix, + ind_type_name, + args->ns); + + if (ind == NULL) { + cu_statusf(broker, + &s, + CMPI_RC_ERR_FAILED, + "Failed to create ind, type '%s:%s_%s'", + args->ns, + prefix, + ind_type_name); + goto out; + } + + ind_op = CMGetObjectPath(ind, &s); + if (s.rc != CMPI_RC_OK) { + //CU_DEBUG("Failed to get ind_op. Error: '%s'", s.msg); + goto out; + } + CMSetNameSpace(ind_op, args->ns); + + set_alert_ind_props(broker, prefix, ctx, ind); + + CU_DEBUG("Delivering Indication: %s", + CMGetCharPtr(CMObjectPathToString(ind_op, NULL))); + + s = stdi_deliver(broker, ctx, args, ind); + if (s.rc == CMPI_RC_OK) { + CU_DEBUG("Indication delivered"); + } else { + CU_DEBUG("Not delivered: %s", CMGetCharPtr(s.msg)); + } + + out: + return s; +} + +DECLARE_FILTER(xen_crashed, "Xen_GuestCrashAlertIndication"); +DECLARE_FILTER(kvm_crashed, "KVM_GuestCrashAlertIndication"); + +static struct std_ind_filter *filters[] = { + &xen_crashed, + &kvm_crashed, + NULL, +}; + +static CMPIStatus raise_indication(const CMPIBroker *broker, + const CMPIContext *ctx, + const CMPIInstance *ind) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *ref = NULL; + struct std_indication_ctx *_ctx = NULL; + struct ind_args *args = NULL; + char *prefix = NULL; + + CU_DEBUG("Guest Crash Raise indication"); + + ref = CMGetObjectPath(ind, &s); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to get a reference to the guest"); + goto out; + } + + /* FIXME: This is a Pegasus work around. Pegsus loses the namespace + when an ObjectPath is pulled from an instance */ + if (STREQ(NAMESPACE(ref), "")) + CMSetNameSpace(ref, "root/virt"); + + /*s = get_domain_by_ref(broker, ref, &src_inst); + if (s.rc != CMPI_RC_OK || CMIsNullObject(src_inst)) + goto out;*/ + + _ctx = malloc(sizeof(struct std_indication_ctx)); + if (_ctx == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to allocate indication context"); + goto out; + } + + _ctx->brkr = broker; + _ctx->handler = NULL; + _ctx->filters = filters; + _ctx->enabled = true; + + args = malloc(sizeof(struct ind_args)); + if (args == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to allocate ind_args"); + goto out; + } + + args->ns = strdup(NAMESPACE(ref)); + args->classname = strdup(CLASSNAME(ref)); + args->_ctx = _ctx; + + prefix = class_prefix_name(args->classname); + + s = create_and_deliver_ind(broker, ctx, prefix, args); + + if (s.rc != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to generate indication"); + } + + out: + if (args != NULL) + stdi_free_ind_args(&args); + + if (_ctx != NULL) + free(_ctx); + + free(prefix); + return s; +} + + +static void free_cb(void *opaque) +{ + cb_info_ptr cbinfo = NULL; + + CU_DEBUG("Releasing memory from guest crash callback"); + + cbinfo = (cb_info_ptr)opaque; + free(cbinfo); +} + +static int guest_crashed_cb(virConnectPtr conn, + virDomainPtr dom, + int event, + int detail, + void *opaque) +{ + char *type = NULL; + CMPIStatus s = {CMPI_RC_OK, NULL}; + const char *ind_name = "GuestCrashedAlertIndication"; + CMPIInstance *ind = NULL; + cb_info_ptr cbinfo = NULL; + const CMPIObjectPath *ref = NULL; + const CMPIContext *context = NULL; + + CU_DEBUG("Preparing GuestCrashedAlertIndication"); + + if (event != VIR_DOMAIN_EVENT_STOPPED_FAILED) { + CU_DEBUG("Event not monitored. Ignoring..."); + return 0; + } + + cbinfo = (cb_info_ptr)opaque; + ref = cbinfo->ref; + context = cbinfo->context; + + ind = get_typed_instance(_BROKER, + CLASSNAME(ref), + ind_name, + NAMESPACE(ref)); + + if (ind == NULL) { + CU_DEBUG("Failed to create ind '%s'", ind_name); + goto out; + } + + type = get_typed_class(CLASSNAME(ref), ind_name); + + s = stdi_raise_indication(_BROKER, + context, + type, + NAMESPACE(ref), + ind); + + out: + free(type); + + return s.rc != CMPI_RC_OK; +} + +static CMPIStatus ActivateFilter(CMPIIndicationMI* mi, + const CMPIContext* ctx, + const CMPISelectExp* se, + const char *ns, + const CMPIObjectPath* op, + CMPIBoolean first) +{ + virConnectPtr conn = NULL; + CMPIStatus s = {CMPI_RC_OK, NULL}; + cb_info_ptr cbinfo = NULL; + int ret = 0; + + cbinfo = (cb_info_ptr)malloc(sizeof(struct cb_info)); + cbinfo->context = ctx; + cbinfo->ref = op; + + CU_DEBUG("ActivateFilter for %s", CLASSNAME(op)); + + conn = connect_by_classname(_BROKER, CLASSNAME(op), &s); + + CU_DEBUG("Registering callback function"); + ret = virConnectDomainEventRegister(conn, + guest_crashed_cb, + (void *)cbinfo, + free_cb); + CU_DEBUG("ret val: %d\n", ret); + + return s; +} + +static CMPIStatus DeActivateFilter(CMPIIndicationMI* mi, + const CMPIContext* ctx, + const CMPISelectExp* se, + const char *ns, + const CMPIObjectPath* op, + CMPIBoolean last) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + + CU_DEBUG("DeActivateFilter for %s", CLASSNAME(op)); + + return s; +} + +static _EI_RTYPE EnableIndications(CMPIIndicationMI* mi, + const CMPIContext *ctx) +{ + CU_DEBUG("EnableIndications"); + + _EI_RET(); + +} + +static _EI_RTYPE DisableIndications(CMPIIndicationMI* mi, + const CMPIContext *ctx) +{ + CU_DEBUG("DisableIndications"); + + _EI_RET(); +} + + + +static struct std_indication_handler csi = { + .raise_fn = raise_indication, + .trigger_fn = trigger_indication, + .activate_fn = ActivateFilter, + .deactivate_fn = DeActivateFilter, + .enable_fn = EnableIndications, + .disable_fn = DisableIndications, +}; + +DEFAULT_IND_CLEANUP(); +DEFAULT_AF(); +DEFAULT_MP(); + +STDI_IndicationMIStub(, + Virt_GuestCrashAlertIndicationProvider, + _BROKER, + libvirt_cim_init(), + &csi, + filters); + +/* + * Local Variables: + * mode: C + * c-set-style: "K&R" + * tab-width: 8 + * c-basic-offset: 8 + * indent-tabs-mode: nil + * End: + */ From kaitlin at linux.vnet.ibm.com Tue Aug 18 23:24:34 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 18 Aug 2009 16:24:34 -0700 Subject: [Libvirt-cim] [PATCH] [RFC] Implement libvirt event callback management In-Reply-To: <36aa26ca62cabda72e02.1250186205@slab.beaverton.ibm.com> References: <36aa26ca62cabda72e02.1250186205@slab.beaverton.ibm.com> Message-ID: <4A8B3832.70701@linux.vnet.ibm.com> Hi Hollis, I applied your patch and the patches Richard submitted to do some testing. I noticed a few issues commented below... > +/* Delete all watches marked for deletion. */ > +static void event_watch_free_deleted(void) > +{ > + struct watch *cur; > + struct watch **link; > + > + CU_DEBUG("%s", __func__); > + > + pthread_mutex_lock(&watch_list_mutex); > + > + cur = watch_list; > + link = &watch_list; > + while (cur != NULL) { > + struct watch *next = cur->next; > + > + if (cur->deleted) { > + *link = next; > + > + cur->ff(cur->opaque); I'm seeing a seg fault here because once we reach this point, cur is NULL. > + free(cur); > + watch_count--; > + } else > + link = &cur->next; > + > + cur = next; > + } > + > + pthread_mutex_unlock(&watch_list_mutex); > +} > + > +/* One thread to watch all fds for all events for all libvirt threads. */ > +static void *event_thread(void *ptr) > +{ > + while (1) { > + struct watch *cur; > + struct pollfd *pollfds; > + struct pollfd *pollfd; > + int timeout; > + int i; > + > + pollfds = malloc(sizeof(struct pollfd) * watch_count); > + > + /* fill in pollfds array from our watch list */ > + for (pollfd = &pollfds[0], cur = watch_list; > + cur != NULL; > + pollfd++, cur = cur->next) { > + pollfd->fd = cur->fd; > + pollfd->events = libvirt_to_poll_events(cur->events); > + } > + > + timeout = event_next_timeout(); > + > + poll(pollfds, watch_count, timeout); > + > + /* invoke callbacks */ > + for (i = 0; i < watch_count; i++) > + for (cur = watch_list; cur != NULL; cur = cur->next) > + if (cur->fd == pollfds[i].fd When I generate a event, poll never seems to catch it. I tried forcing this by changing the timeout value to a minute. And then generating the event. I can see from the libvirt debug that the event has been generated: 15:00:34.232: debug : virEventRunOnce:567 : Poll got 1 event 15:00:34.239: debug : virEventDispatchHandles:450 : Dispatch n=2 f=8 w=3 e=1 0x7f2a57d6e6b0 In the eventAddHandle() call, we have: event.c(75): eventAddHandle event.c(82): ++++++++++++++watch->id is 0 event.c(84): ++++++++++++++watch->fd is 11 event.c(86): ++++++++++++++watch->events is 1 event.c(88): ++++++++++++++watch->cb is 0x6b8f4c0, cb is 0x6b8f4c0 event.c(90): ++++++++++++++watch->opaque is 0x7fffdc014900 I haven't tracked down what is happening here. > + && !cur->deleted) { > + invoke_callback(cur, &pollfds[i]); > + break; > + } > + > + free(pollfds); > + > + event_watch_free_deleted(); > + event_timer_free_deleted(); > + } > + > + return NULL; > +} > + > +void init_events(void) > +{ > + static pthread_mutex_t thread_mutex = PTHREAD_MUTEX_INITIALIZER; > + > + CU_DEBUG("%s", __func__); > + > + pthread_mutex_lock(&thread_mutex); > + > + if (!watch_thread_id) { > + virEventRegisterImpl(eventAddHandle, > + eventUpdateHandle, > + eventRemoveHandle, > + eventAddTimeout, > + eventUpdateTimeout, > + eventRemoveTimeout); > + > + pthread_create(&watch_thread_id, NULL, event_thread, NULL); > + } > + > + pthread_mutex_unlock(&thread_mutex); > +} -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From hollisb at us.ibm.com Tue Aug 18 23:45:49 2009 From: hollisb at us.ibm.com (Hollis Blanchard) Date: Tue, 18 Aug 2009 16:45:49 -0700 Subject: [Libvirt-cim] [PATCH] [RFC] Implement libvirt event callback management In-Reply-To: <4A8B3832.70701@linux.vnet.ibm.com> References: <36aa26ca62cabda72e02.1250186205@slab.beaverton.ibm.com> <4A8B3832.70701@linux.vnet.ibm.com> Message-ID: <1250639149.17997.21.camel@slab.beaverton.ibm.com> On Tue, 2009-08-18 at 16:24 -0700, Kaitlin Rupert wrote: > Hi Hollis, > > I applied your patch and the patches Richard submitted to do some > testing. I noticed a few issues commented below... > > > > +/* Delete all watches marked for deletion. */ > > +static void event_watch_free_deleted(void) > > +{ > > + struct watch *cur; > > + struct watch **link; > > + > > + CU_DEBUG("%s", __func__); > > + > > + pthread_mutex_lock(&watch_list_mutex); > > + > > + cur = watch_list; > > + link = &watch_list; > > + while (cur != NULL) { > > + struct watch *next = cur->next; > > + > > + if (cur->deleted) { > > + *link = next; > > + > > + cur->ff(cur->opaque); > > I'm seeing a seg fault here because once we reach this point, cur is NULL. > > > + free(cur); > > + watch_count--; > > + } else > > + link = &cur->next; > > + > > + cur = next; > > + } > > + > > + pthread_mutex_unlock(&watch_list_mutex); > > +} > > + Am I missing something obvious? The loop only runs while cur is not NULL. Moreover, the list is locked, so concurrent list modifications wouldn't even explain it... unless the other user didn't take the lock (which we do on purpose sometimes). From the CU_DEBUG log, can you tell if there's any concurrency going on? > > +/* One thread to watch all fds for all events for all libvirt threads. */ > > +static void *event_thread(void *ptr) > > +{ > > + while (1) { > > + struct watch *cur; > > + struct pollfd *pollfds; > > + struct pollfd *pollfd; > > + int timeout; > > + int i; > > + > > + pollfds = malloc(sizeof(struct pollfd) * watch_count); > > + > > + /* fill in pollfds array from our watch list */ > > + for (pollfd = &pollfds[0], cur = watch_list; > > + cur != NULL; > > + pollfd++, cur = cur->next) { > > + pollfd->fd = cur->fd; > > + pollfd->events = libvirt_to_poll_events(cur->events); > > + } > > + > > + timeout = event_next_timeout(); > > + > > + poll(pollfds, watch_count, timeout); > > + > > + /* invoke callbacks */ > > + for (i = 0; i < watch_count; i++) > > + for (cur = watch_list; cur != NULL; cur = cur->next) > > + if (cur->fd == pollfds[i].fd > > When I generate a event, poll never seems to catch it. I tried forcing > this by changing the timeout value to a minute. And then generating the > event. I can see from the libvirt debug that the event has been generated: > > 15:00:34.232: debug : virEventRunOnce:567 : Poll got 1 event > 15:00:34.239: debug : virEventDispatchHandles:450 : Dispatch n=2 f=8 w=3 > e=1 0x7f2a57d6e6b0 These messages are from qemud? So the event is generated on the other side of the "remote" pipe? > In the eventAddHandle() call, we have: > > event.c(75): eventAddHandle > event.c(82): ++++++++++++++watch->id is 0 > event.c(84): ++++++++++++++watch->fd is 11 > event.c(86): ++++++++++++++watch->events is 1 > event.c(88): ++++++++++++++watch->cb is 0x6b8f4c0, cb is 0x6b8f4c0 > event.c(90): ++++++++++++++watch->opaque is 0x7fffdc014900 These seem reasonable, so we should have a list with one entry. > > I haven't tracked down what is happening here. > > > > + && !cur->deleted) { > > + invoke_callback(cur, &pollfds[i]); > > + break; > > + } > > + > > + free(pollfds); > > + > > + event_watch_free_deleted(); > > + event_timer_free_deleted(); > > + } > > + > > + return NULL; > > +} Hmm, actually I'd expect the opposite: this code seems to *always* invoke the callback, even when no event is pending (oops!). Since that's not happening, it may be that the pollfds structure isn't being created properly, in particular the fd member. Another possibility is that watch_count is somehow 0, which would also hose pollfds allocation... I guess strace output (for poll()), CU_DEBUG logs, and some gdb work would help. -- Hollis Blanchard IBM Linux Technology Center From kaitlin at linux.vnet.ibm.com Wed Aug 19 00:33:03 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 18 Aug 2009 17:33:03 -0700 Subject: [Libvirt-cim] [PATCH] [RFC] Implement libvirt event callback management In-Reply-To: <1250639149.17997.21.camel@slab.beaverton.ibm.com> References: <36aa26ca62cabda72e02.1250186205@slab.beaverton.ibm.com> <4A8B3832.70701@linux.vnet.ibm.com> <1250639149.17997.21.camel@slab.beaverton.ibm.com> Message-ID: <4A8B483F.9080406@linux.vnet.ibm.com> Hollis Blanchard wrote: > On Tue, 2009-08-18 at 16:24 -0700, Kaitlin Rupert wrote: >> Hi Hollis, >> >> I applied your patch and the patches Richard submitted to do some >> testing. I noticed a few issues commented below... >> >> >>> +/* Delete all watches marked for deletion. */ >>> +static void event_watch_free_deleted(void) >>> +{ >>> + struct watch *cur; >>> + struct watch **link; >>> + >>> + CU_DEBUG("%s", __func__); >>> + >>> + pthread_mutex_lock(&watch_list_mutex); >>> + >>> + cur = watch_list; >>> + link = &watch_list; >>> + while (cur != NULL) { >>> + struct watch *next = cur->next; >>> + >>> + if (cur->deleted) { >>> + *link = next; >>> + >>> + cur->ff(cur->opaque); >> I'm seeing a seg fault here because once we reach this point, cur is NULL. >> >>> + free(cur); >>> + watch_count--; >>> + } else >>> + link = &cur->next; >>> + >>> + cur = next; >>> + } >>> + >>> + pthread_mutex_unlock(&watch_list_mutex); >>> +} >>> + > > Am I missing something obvious? The loop only runs while cur is not > NULL. Agreed. I meant to say in my previous email that I am confused as well. Actually, I put a check for (cur != NULL) right about the call to cur->ff - and cur is definitely NULL at that point. I haven't spent enough time debugging it, here's what little I have so far: event.c(142): event_watch_free_deleted event.c(146): +++++++++watch_list addr is 0x7fffdc014b30 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff61c6710 (LWP 22188)] 0x0000000000000000 in ?? () Missing separate debuginfos, use: debuginfo-install tog-pegasus-2.9.0-3.fc12.x86_64 (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00000000069811f1 in event_watch_free_deleted () at event.c:156 #2 event_thread () at event.c:375 #3 0x0000000003c5e91a in start_thread () from /lib64/libpthread.so.0 #4 0x0000000004936b2d in clone () from /lib64/libc.so.6 #5 0x0000000000000000 in ?? () (gdb) up #1 0x00000000069811f1 in event_watch_free_deleted () at event.c:156 156 cur->ff(cur->opaque); (gdb) print cur $1 = (struct watch *) 0x0 (gdb) > > Moreover, the list is locked, so concurrent list modifications wouldn't > even explain it... unless the other user didn't take the lock (which we > do on purpose sometimes). From the CU_DEBUG log, can you tell if there's > any concurrency going on? I'll investigate this more tomorrow. Richard - or maybe you can? > >>> +/* One thread to watch all fds for all events for all libvirt threads. */ >>> +static void *event_thread(void *ptr) >>> +{ >>> + while (1) { >>> + struct watch *cur; >>> + struct pollfd *pollfds; >>> + struct pollfd *pollfd; >>> + int timeout; >>> + int i; >>> + >>> + pollfds = malloc(sizeof(struct pollfd) * watch_count); >>> + >>> + /* fill in pollfds array from our watch list */ >>> + for (pollfd = &pollfds[0], cur = watch_list; >>> + cur != NULL; >>> + pollfd++, cur = cur->next) { >>> + pollfd->fd = cur->fd; >>> + pollfd->events = libvirt_to_poll_events(cur->events); >>> + } >>> + >>> + timeout = event_next_timeout(); >>> + >>> + poll(pollfds, watch_count, timeout); >>> + >>> + /* invoke callbacks */ >>> + for (i = 0; i < watch_count; i++) >>> + for (cur = watch_list; cur != NULL; cur = cur->next) >>> + if (cur->fd == pollfds[i].fd >> When I generate a event, poll never seems to catch it. I tried forcing >> this by changing the timeout value to a minute. And then generating the >> event. I can see from the libvirt debug that the event has been generated: >> >> 15:00:34.232: debug : virEventRunOnce:567 : Poll got 1 event >> 15:00:34.239: debug : virEventDispatchHandles:450 : Dispatch n=2 f=8 w=3 >> e=1 0x7f2a57d6e6b0 > > These messages are from qemud? So the event is generated on the other > side of the "remote" pipe? > >> In the eventAddHandle() call, we have: >> >> event.c(75): eventAddHandle >> event.c(82): ++++++++++++++watch->id is 0 >> event.c(84): ++++++++++++++watch->fd is 11 >> event.c(86): ++++++++++++++watch->events is 1 >> event.c(88): ++++++++++++++watch->cb is 0x6b8f4c0, cb is 0x6b8f4c0 >> event.c(90): ++++++++++++++watch->opaque is 0x7fffdc014900 > > These seem reasonable, so we should have a list with one entry. > >> I haven't tracked down what is happening here. >> >> >>> + && !cur->deleted) { >>> + invoke_callback(cur, &pollfds[i]); >>> + break; >>> + } >>> + >>> + free(pollfds); >>> + >>> + event_watch_free_deleted(); >>> + event_timer_free_deleted(); >>> + } >>> + >>> + return NULL; >>> +} > > Hmm, actually I'd expect the opposite: this code seems to *always* > invoke the callback, even when no event is pending (oops!). > > Since that's not happening, it may be that the pollfds structure isn't > being created properly, in particular the fd member. I should have said in my previous email - the value of pollfds[i].fd is always 0. In looking at it more, I think the following is happening: 1) The CIMOM loads Richard's provider and init_events() is called. 2) This starts the event_thread. At this point, we don't have a handle, so the following for loop fails: for (pollfd = &pollfds[0], cur = watch_list; cur != NULL; pollfd++, cur = cur->next) {} 3) We call poll() 4) In the meantime, the provider's ActivateFilter() function has been called and the callback is registered 5) eventUpdateHandle() is called, but it doesn't update our pollfds list 5) We generate a domain event and libvirt dispatches it 5) Our fd in pollfds[i] is still 0, so we don't have a match. event.c(388): init_events [New Thread 0x7ffff61c6710 (LWP 22188)] event.c(320): ^^^^^^^^^^in event_thread event.c(330): ^^^^^^^^^^got pollfds event.c(335): ^^^^^^^^^^cur is NULL!! event.c(352): ^^^^^^^^^timeout is 30000 std_indication.c(231): Calling handler->activate_fn Virt_GuestCrashAlertIndication.c(334): ActivateFilter for KVM_GuestCrashAlertIndication misc_util.c(76): Connecting to libvirt with uri `qemu:///system' event.c(75): eventAddHandle event.c(82): ++++++++++++++watch->id is 0 event.c(84): ++++++++++++++watch->fd is 11 event.c(86): ++++++++++++++watch->events is 1 event.c(88): ++++++++++++++watch->cb is 0x6de44c0, cb is 0x6de44c0 event.c(90): ++++++++++++++watch->opaque is 0x7fffdc014900 event.c(174): eventAddTimeout Virt_GuestCrashAlertIndication.c(338): Registering callback function event.c(108): eventUpdateHandle 0 event.c(108): eventUpdateHandle 0 Virt_GuestCrashAlertIndication.c(343): ret val: 0 std_indication.c(270): IndicationVirt_GuestCrashAlertIndicationProvider: indications enabled Virt_GuestCrashAlertIndication.c(365): EnableIndications event.c(358): ^^^^^^^^^^loop through watch_count event.c(360): ^^^^^^^^^^loop through watch_list event.c(361): ==================cur->fd is 11, pollfds[i].fd is 0 event.c(362): ==================cur->deleted is 7 > > Another possibility is that watch_count is somehow 0, which would also > hose pollfds allocation... > > I guess strace output (for poll()), CU_DEBUG logs, and some gdb work > would help. > -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Wed Aug 19 02:27:59 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Tue, 18 Aug 2009 23:27:59 -0300 Subject: [Libvirt-cim] [PATCH] [RFC] Implement libvirt event callback management In-Reply-To: <4A8B483F.9080406@linux.vnet.ibm.com> References: <36aa26ca62cabda72e02.1250186205@slab.beaverton.ibm.com> <4A8B3832.70701@linux.vnet.ibm.com> <1250639149.17997.21.camel@slab.beaverton.ibm.com> <4A8B483F.9080406@linux.vnet.ibm.com> Message-ID: <4A8B632F.9010001@linux.vnet.ibm.com> > >> >> Moreover, the list is locked, so concurrent list modifications wouldn't >> even explain it... unless the other user didn't take the lock (which we >> do on purpose sometimes). From the CU_DEBUG log, can you tell if there's >> any concurrency going on? > > I'll investigate this more tomorrow. Richard - or maybe you can? Yes, I can check it tomorrow -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Wed Aug 19 03:20:56 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 19 Aug 2009 00:20:56 -0300 Subject: [Libvirt-cim] [PATCH] Dup all necessary fields of the net_device struct in virt_device_dup() In-Reply-To: <6f6393788fc52d942a53.1250289077@elm3b151.beaverton.ibm.com> References: <6f6393788fc52d942a53.1250289077@elm3b151.beaverton.ibm.com> Message-ID: <4A8B6F98.7030101@linux.vnet.ibm.com> +1 On 08/14/2009 07:31 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1250281843 25200 > # Node ID 6f6393788fc52d942a53fdf2b93cf2a83a0559e4 > # Parent 77db61a05abb9eb2e5db719677f4e15cd0626168 > Dup all necessary fields of the net_device struct in virt_device_dup() > > Signed-off-by: Kaitlin Rupert > > diff -r 77db61a05abb -r 6f6393788fc5 libxkutil/device_parsing.c > --- a/libxkutil/device_parsing.c Wed Aug 12 22:07:51 2009 -0700 > +++ b/libxkutil/device_parsing.c Fri Aug 14 13:30:43 2009 -0700 > @@ -659,6 +659,8 @@ > DUP_FIELD(dev, _dev, dev.net.mac); > DUP_FIELD(dev, _dev, dev.net.type); > DUP_FIELD(dev, _dev, dev.net.source); > + DUP_FIELD(dev, _dev, dev.net.name); > + DUP_FIELD(dev, _dev, dev.net.model); > } else if (dev->type == CIM_RES_TYPE_DISK) { > DUP_FIELD(dev, _dev, dev.disk.type); > DUP_FIELD(dev, _dev, dev.disk.device); > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Wed Aug 19 03:31:19 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 19 Aug 2009 00:31:19 -0300 Subject: [Libvirt-cim] [PATCH] Be sure to initialize msg in storage_vol_rasd_to_res() In-Reply-To: <9dec453226dadbd358fd.1250289103@elm3b151.beaverton.ibm.com> References: <9dec453226dadbd358fd.1250289103@elm3b151.beaverton.ibm.com> Message-ID: <4A8B7207.7080009@linux.vnet.ibm.com> +1 On 08/14/2009 07:31 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1250287987 25200 > # Node ID 9dec453226dadbd358fdd87cbbaffe0528d25308 > # Parent 6f6393788fc52d942a53fdf2b93cf2a83a0559e4 > Be sure to initialize msg in storage_vol_rasd_to_res() > > Some versions of gcc will complain about this variable being uninitialized. > > Signed-off-by: Kaitlin Rupert > > diff -r 6f6393788fc5 -r 9dec453226da src/Virt_ResourcePoolConfigurationService.c > --- a/src/Virt_ResourcePoolConfigurationService.c Fri Aug 14 13:30:43 2009 -0700 > +++ b/src/Virt_ResourcePoolConfigurationService.c Fri Aug 14 15:13:07 2009 -0700 > @@ -695,7 +695,7 @@ > { > uint16_t int_val; > const char *val; > - const char *msg; > + const char *msg = NULL; > > if (cu_get_u16_prop(inst, "FormatType",&int_val) != CMPI_RC_OK) { > msg = "StorageVolumeRASD FormatType field not valid"; > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From anantyog at linux.vnet.ibm.com Wed Aug 19 11:27:16 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Wed, 19 Aug 2009 04:27:16 -0700 Subject: [Libvirt-cim] [PATCH] [Test](#3)Testcase to check for duplicate UUID Message-ID: <1d4ded063ea6b2fa3437.1250681236@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at in.ibm.com # Date 1250681088 25200 # Node ID 1d4ded063ea6b2fa3437b09e4cee6e71303a5723 # Parent 5c08aeea7fa147dea06d6b1f0c75c2de70b4b0ae [Test](#3)Testcase to check for duplicate UUID Made changes based on comments from Deepti Kalakeri, renamed the test case to 06_duplicate_uuid.py. Thx yogi Signed-off-by: Yogananth Subramanian diff -r 5c08aeea7fa1 -r 1d4ded063ea6 suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py Wed Aug 19 04:24:48 2009 -0700 @@ -0,0 +1,116 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth Subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +#Steps: +#1) Define 2 domains,'default' and 'test', both with random UUID +#2) Reset the uuid of the second domain, 'test', to the uuid of the +# first domain, using ModifySystemSettings +# + +import sys +import time +from XenKvmLib import vsms +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.const import do_main +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.enumclass import GetInstance + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'uuid_domain' +test_dom = 'test_domain' +nmac = '99:aa:bb:cc:ee:ff' + +def get_vssd(ip, virt, default_dom): + cn = get_typed_class(virt, "VirtualSystemSettingData") + inst = None + + try: + if virt == "XenFV": + virt = "Xen" + + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } + inst = GetInstance(ip, cn, key_list, True) + + except Exception, details: + logger.error(details) + return FAIL, inst + + if inst is None: + return FAIL, inst + + return PASS, inst + + at do_main(sup_types) +def main(): + options = main.options + + service = vsms.get_vsms_class(options.virt)(options.ip) + + cxml = vxml.get_class(options.virt)(default_dom) + ret = cxml.cim_define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + + try: + status, inst = get_vssd(options.ip, options.virt, default_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s" % + default_dom) + + uuid_defaultdom = inst['UUID'] + + sxml = vxml.get_class(options.virt)(test_dom, mac=nmac) + ret = sxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s" % test_dom) + + status, inst = get_vssd(options.ip, options.virt, test_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s" % + test_dom) + + inst['UUID'] = uuid_defaultdom + vssd = inst_to_mof(inst) + ret = service.ModifySystemSettings(SystemSettings=vssd) + if ret[0] ==0: + raise Exception("Was able to assign duplicate UUID to domain %s" + % test_dom) + + except Exception, details: + err_no = details[0] + err_desc = details[1] + if err_desc.find("domain 'uuid_domain' is already defined"): + logger.info('Got expected error desc') + status = PASS + else: + logger.error(details) + status = FAIL + + sxml.undefine(options.ip) + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Wed Aug 19 13:22:45 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 19 Aug 2009 18:52:45 +0530 Subject: [Libvirt-cim] [PATCH] [Test](#3)Testcase to check for duplicate UUID In-Reply-To: <1d4ded063ea6b2fa3437.1250681236@elm3b151.beaverton.ibm.com> References: <1d4ded063ea6b2fa3437.1250681236@elm3b151.beaverton.ibm.com> Message-ID: <4A8BFCA5.5010806@linux.vnet.ibm.com> +1 except for one comment otherwise. Yogananth Subramanian wrote: > # HG changeset patch > # User anantyog at in.ibm.com > # Date 1250681088 25200 > # Node ID 1d4ded063ea6b2fa3437b09e4cee6e71303a5723 > # Parent 5c08aeea7fa147dea06d6b1f0c75c2de70b4b0ae > [Test](#3)Testcase to check for duplicate UUID > Made changes based on comments from Deepti Kalakeri, renamed the test case to > 06_duplicate_uuid.py. > Thx > yogi > > Signed-off-by: Yogananth Subramanian > > diff -r 5c08aeea7fa1 -r 1d4ded063ea6 suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py Wed Aug 19 04:24:48 2009 -0700 > @@ -0,0 +1,116 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Yogananth Subramanian > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU 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 > +# General Public License for more details. > +# > +# You should have received a copy of the GNU 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 > +# > +#Steps: > +#1) Define 2 domains,'default' and 'test', both with random UUID > +#2) Reset the uuid of the second domain, 'test', to the uuid of the > +# first domain, using ModifySystemSettings > +# > + > +import sys > +import time > +from XenKvmLib import vsms > +from XenKvmLib import vxml > +from CimTest.Globals import logger > +from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.const import do_main > +from XenKvmLib.classes import get_typed_class, inst_to_mof > +from XenKvmLib.enumclass import GetInstance > + > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > +default_dom = 'uuid_domain' > +test_dom = 'test_domain' > +nmac = '99:aa:bb:cc:ee:ff' > + > +def get_vssd(ip, virt, default_dom): > + cn = get_typed_class(virt, "VirtualSystemSettingData") > + inst = None > + > + try: > + if virt == "XenFV": > + virt = "Xen" > + > + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } > + inst = GetInstance(ip, cn, key_list, True) > + > + except Exception, details: > + logger.error(details) > + return FAIL, inst > + > + if inst is None: > + return FAIL, inst > + > + return PASS, inst > + > + at do_main(sup_types) > +def main(): > + options = main.options > + > + service = vsms.get_vsms_class(options.virt)(options.ip) > + > + cxml = vxml.get_class(options.virt)(default_dom) > + ret = cxml.cim_define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) > + return FAIL > + > + try: > + status, inst = get_vssd(options.ip, options.virt, default_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s" % > + default_dom) > + > + uuid_defaultdom = inst['UUID'] > + > + sxml = vxml.get_class(options.virt)(test_dom, mac=nmac) > + ret = sxml.cim_define(options.ip) > + if not ret: > + raise Exception("Failed to define the dom: %s" % test_dom) > + > + status, inst = get_vssd(options.ip, options.virt, test_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s" % > + test_dom) > + > + inst['UUID'] = uuid_defaultdom > + vssd = inst_to_mof(inst) > + ret = service.ModifySystemSettings(SystemSettings=vssd) > + if ret[0] ==0: > Need a space after == sign. > + raise Exception("Was able to assign duplicate UUID to domain %s" > + % test_dom) > + > + except Exception, details: > + err_no = details[0] > + err_desc = details[1] > + if err_desc.find("domain 'uuid_domain' is already defined"): > + logger.info('Got expected error desc') > + status = PASS > + else: > + logger.error(details) > + status = FAIL > + > + sxml.undefine(options.ip) > + cxml.undefine(options.ip) > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > + > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Wed Aug 19 14:40:35 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 19 Aug 2009 11:40:35 -0300 Subject: [Libvirt-cim] [PATCH] Fix LXC connection uri, remove default graphics device In-Reply-To: References: Message-ID: <4A8C0EE3.1000507@linux.vnet.ibm.com> +1 On 08/18/2009 03:18 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1250619499 25200 > # Node ID b15ece6f581dd1372261edd782f41411d1a90652 > # Parent 4ceb7a25fdfe0ff4ab994d151e3e98ba70ac5e05 > Fix LXC connection uri, remove default graphics device > > Using "lxc:///system" for the connection uri used to work, but it is no longer > valid. > > Containers guests do not support devices. Older versions of libvirt > didn't do strict checking of guest XMLs, but this has been changed in newer > versions. > > Signed-off-by: Kaitlin Rupert > > diff -r 4ceb7a25fdfe -r b15ece6f581d libxkutil/misc_util.c > --- a/libxkutil/misc_util.c Tue Aug 18 11:18:18 2009 -0700 > +++ b/libxkutil/misc_util.c Tue Aug 18 11:18:19 2009 -0700 > @@ -50,7 +50,7 @@ > else if (STARTS_WITH(classname, "KVM")) > return "qemu:///system"; > else if (STARTS_WITH(classname, "LXC")) > - return "lxc:///system"; > + return "lxc:///"; > else > return NULL; > } > diff -r 4ceb7a25fdfe -r b15ece6f581d src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Tue Aug 18 11:18:18 2009 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Tue Aug 18 11:18:19 2009 -0700 > @@ -323,6 +323,9 @@ > > static bool default_graphics_device(struct domain *domain) > { > + if (domain->type == DOMAIN_LXC) > + return true; > + > free(domain->dev_graphics); > domain->dev_graphics = calloc(1, sizeof(*domain->dev_graphics)); > if (domain->dev_graphics == NULL) { > @@ -946,8 +949,6 @@ > return net_rasd_to_vdev(inst, dev, ns); > } else if (type == CIM_RES_TYPE_PROC) { > return lxc_proc_rasd_to_vdev(inst, dev); > - } else if (type == CIM_RES_TYPE_GRAPHICS) { > - return graphics_rasd_to_vdev(inst, dev); > } else if (type == CIM_RES_TYPE_INPUT) { > return input_rasd_to_vdev(inst, dev); > } > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 19 15:58:39 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 19 Aug 2009 08:58:39 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Creates and register provider class GuestCrashAlertIndication In-Reply-To: <0377e5c28fba407e7bf2.1250407644@localhost.localdomain> References: <0377e5c28fba407e7bf2.1250407644@localhost.localdomain> Message-ID: <4A8C212F.9030509@linux.vnet.ibm.com> Richard Maciel wrote: > # HG changeset patch > # User Richard Maciel > # Date 1248549583 10800 > # Node ID 0377e5c28fba407e7bf2aae4c5f81d8e521a2adb > # Parent 522c25cd3023342fedd387a64e0d6224e33745b9 > Creates and register provider class GuestCrashAlertIndication > > Signed-off-by: Richard Maciel > > diff -r 522c25cd3023 -r 0377e5c28fba Makefile.am > --- a/Makefile.am Thu Aug 13 09:32:18 2009 -0700 > +++ b/Makefile.am Sat Jul 25 16:19:43 2009 -0300 > @@ -55,7 +55,8 @@ > schema/InputPool.mof \ > schema/HostedAccessPoint.mof \ > schema/ServiceAccessBySAP.mof \ > - schema/SAPAvailableForElement.mof > + schema/SAPAvailableForElement.mof \ > + schema/GuestCrashAlertIndication.mof You have a tab here - you should use spaces instead. > > INTEROP_MOFS = \ > schema/ComputerSystem.mof \ > @@ -129,7 +130,8 @@ > schema/InputPool.registration \ > schema/HostedAccessPoint.registration \ > schema/ServiceAccessBySAP.registration \ > - schema/SAPAvailableForElement.registration > + schema/SAPAvailableForElement.registration \ > + schema/GuestCrashAlertIndication.registration Same here. > > INTEROP_REGS = \ > schema/RegisteredProfile.registration \ > diff -r 522c25cd3023 -r 0377e5c28fba schema/GuestCrashAlertIndication.mof > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/schema/GuestCrashAlertIndication.mof Sat Jul 25 16:19:43 2009 -0300 > @@ -0,0 +1,17 @@ > +// Copyright IBM Corp. 2007 > + > +[Description ("Xen guest crash alert"), > + Provider("cmpi::Virt_GuestCrashAlertIndication") > +] > +class Xen_GuestCrashAlertIndication : CIM_AlertIndication > +{ > + //uint32 RaiseIndication([IN] CIM_InstCreation REF TheIndication); You'll need this method. Your provider is calling stdi_raise_indication(), which in turn does a callback to the CIMOM to call RaiseIndication(). > +}; > + > +[Description ("KVM guest crash alert"), > + Provider("cmpi::Virt_GuestCrashAlertIndication") > +] > +class KVM_GuestCrashAlertIndication : CIM_AlertIndication > +{ > + //uint32 RaiseIndication([IN] CIM_InstCreation REF TheIndication); Same here. > +}; > diff -r 522c25cd3023 -r 0377e5c28fba schema/GuestCrashAlertIndication.registration > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/schema/GuestCrashAlertIndication.registration Sat Jul 25 16:19:43 2009 -0300 > @@ -0,0 +1,4 @@ > +# Copyright IBM Corp. 2007 > +# Classname Namespace ProviderName ProviderModule ProviderTypes > +Xen_GuestCrashAlertIndication root/virt Virt_GuestCrashAlertIndicationProvider Virt_GuestCrashAlertIndication indication method > +KVM_GuestCrashAlertIndication root/virt Virt_GuestCrashAlertIndicationProvider Virt_GuestCrashAlertIndication indication method > -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 19 16:04:06 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 19 Aug 2009 09:04:06 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] Fixing VSMS/08*py Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1250697820 25200 # Node ID c338efef06278a9a40a90f07a34750ec50c49939 # Parent 5c08aeea7fa147dea06d6b1f0c75c2de70b4b0ae [TEST] Fixing VSMS/08*py . Tested with KVM on F10 and Xen on SLES with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 5c08aeea7fa1 -r c338efef0627 suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Mon Aug 17 04:16:50 2009 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Wed Aug 19 09:03:40 2009 -0700 @@ -43,7 +43,9 @@ ncpu = 1 nmem = 256 new_int = randint(10, 99) -new_mac = "11:%s:22:%s:33:%s" % (new_int, new_int, new_int) +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): cxml.destroy(ip) @@ -54,7 +56,7 @@ options = main.options service = vsms.get_vsms_class(options.virt)(options.ip) - cxml = vxml.get_class(options.virt)(default_dom, vcpus=cpu) + cxml = vxml.get_class(options.virt)(default_dom, vcpus=cpu, mac=new_mac1) ndpath = cxml.secondary_disk_path dasd = vsms.get_dasd_class(options.virt)(dev=cxml.xml_get_disk_dev(), source=ndpath, @@ -77,7 +79,6 @@ for case in test_cases: #Each time through, define guest using a default XML cxml.undefine(options.ip) - cxml = vxml.get_class(options.virt)(default_dom, vcpus=cpu) ret = cxml.cim_define(options.ip) if not ret: logger.error("Failed to define the dom: %s", default_dom) @@ -107,7 +108,7 @@ if status != PASS: break - nasd.Address = new_mac + nasd.Address = new_mac2 status = vsms_util.mod_net_res(options.ip, service, options.virt, cxml, nasd, ntype, default_network_name) if status != PASS: From kaitlin at linux.vnet.ibm.com Wed Aug 19 17:15:54 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 19 Aug 2009 10:15:54 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Raises GuestCrashAlertIndication when QEMU crashes In-Reply-To: References: Message-ID: <4A8C334A.9080205@linux.vnet.ibm.com> > diff -r 0377e5c28fba -r a9a9447fc635 src/Makefile.am > --- a/src/Makefile.am Sat Jul 25 16:19:43 2009 -0300 > +++ b/src/Makefile.am Sat Jul 25 16:19:43 2009 -0300 > @@ -75,7 +75,8 @@ > libVirt_ServiceAffectsElement.la \ > libVirt_HostedAccessPoint.la \ > libVirt_ServiceAccessBySAP.la \ > - libVirt_SAPAvailableForElement.la > + libVirt_SAPAvailableForElement.la \ > + libVirt_GuestCrashAlertIndication.la > > libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c > libVirt_ComputerSystem_la_DEPENDENCIES = libVirt_VirtualSystemSnapshotService.la > @@ -233,3 +234,7 @@ > libVirt_SAPAvailableForElement_la_SOURCES = Virt_SAPAvailableForElement.c > libVirt_SAPAvailableForElement_la_LIBADD = -lVirt_ComputerSystem -lVirt_KVMRedirectionSAP > > +libVirt_GuestCrashAlertIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la > +libVirt_GuestCrashAlertIndication_la_SOURCES = Virt_GuestCrashAlertIndication.c > +libVirt_GuestCrashAlertIndication_la_LIBADD = You'll also need to include your link to Virt_CS here. > + > diff -r 0377e5c28fba -r a9a9447fc635 src/Virt_ComputerSystemIndication.c > --- a/src/Virt_ComputerSystemIndication.c Sat Jul 25 16:19:43 2009 -0300 > +++ b/src/Virt_ComputerSystemIndication.c Sat Jul 25 16:19:43 2009 -0300 > @@ -692,6 +692,8 @@ > char *prefix = NULL; > bool rc; > > + CU_DEBUG("Raise indication"); Be sure to remove this debug.. > + > if (!lifecycle_enabled) { > cu_statusf(_BROKER, &s, > CMPI_RC_ERR_FAILED, > diff -r 0377e5c28fba -r a9a9447fc635 src/Virt_GuestCrashAlertIndication.c > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/src/Virt_GuestCrashAlertIndication.c Sat Jul 25 16:19:43 2009 -0300 > @@ -0,0 +1,409 @@ > +/* > + * Copyright IBM Corp. 2009 > + * > + * Authors: > + * Richard Maciel > + * > + * 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 > +#include > +#include > + > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > +#include > + > +#include "config.h" > + > +typedef struct cb_info { > + const CMPIContext *context; > + const CMPIObjectPath *ref; > +} *cb_info_ptr; > + > +static const CMPIBroker *_BROKER; > + > +static CMPIStatus trigger_indication(const CMPIContext *context) > +{ > + CU_DEBUG("guest crash indication triggered"); > + return(CMPIStatus){CMPI_RC_OK, NULL}; Since trigger isn't supported, I would remove this function and update the struct std_indication_handler csi so that the trigger function handler is NULL. Here, you are returning a successful error code, but the function doesn't do anything. > +} > + > +static void set_alert_ind_props(const CMPIBroker *broker, > + const char *prefix, > + const CMPIContext *ctx, > + CMPIInstance *ind) > +{ > + CMPIStatus s; > + CMPIString *str; > + CMPIUint16 uint16; unit16 is an odd variable name here.. the providers usually use something like "val" - or you can use something more meaningful. > + CMPIArray *array; > + > + > + //CMSetProperty(ind, "Description", &str, CMPI_string); For those properties you don't plan on setting, be sure to remove them. > + > + str = CMNewString(broker, prefix, &s); > + CMSetProperty(ind, "AlertingManagedElement", &str, CMPI_string); Really, we should return information about the guest that has crashed. We should return an instance of the guest that has crashed. If the guest has been defined prior to being started, then we should be able to get the instance of the guest. If you are unable to get the instance of the guest, include it's name or some other identifying info. > + > + // val 1 > + uint16 = 1; > + CMSetProperty(ind, "AlertType", &uint16, CMPI_uint16); > + > + str = CMNewString(broker, "VM Crash", &s); Instead of saying "VM Crash" - you might want to say something like "Virtual guest crash" - it's possible this string will be displayed to the user. > + CMSetProperty(ind, "OtherAlertType", &str, CMPI_string); > + > + uint16 = 7; > + CMSetProperty(ind, "PerceivedSeverity", &uint16, CMPI_uint16); > + > + // val 48 > + uint16 = 48; > + CMSetProperty(ind, "ProbableCause", &uint16, CMPI_uint16); > + > + //CMSetProperty(ind, "ProbableCauseDescription", &str, CMPI_string); > + > + // val 1 > + uint16 = 1; > + CMSetProperty(ind, "Trending", &uint16, CMPI_uint16); > + > + // This is an array > + // CMSetProperty(ind, "RecommendedActions", &str, CMPI_string); > + > + CMSetProperty(ind, "EventID", &str, CMPI_string); You're using the prefix as the EventID here. The EventID should be unique - and a value of "Xen" or "KVM" doesn't make sense here. > + > + // Must find how to fill it > + //CMSetProperty(ind, "EventTime", &, CMPI_dateTime); > + > + // Won't use it > + //CMSetProperty(ind, "SystemCreationClassName", &str, CMPI_string); > + > + // Won't use it > + // CMSetProperty(ind, "SystemName", &str, CMPI_string); > + > + // Won't use it > + // CMSetProperty(ind, "ProviderName", &str, CMPI_string); This value should be set. > + > + str = CMNewString(broker, "DTMF", &s); > + CMSetProperty(ind, "OwningEntity", &str, CMPI_string); > + > + str = CMNewString(broker, "PLAT0002", &s); > + CMSetProperty(ind, "MessageID", &str, CMPI_string); > + > + //CMSetProperty(ind, "Message", &str, CMPI_string); > + > + // This is an string array > + array = CMNewArray(broker, 1, CMPI_stringA, &s); > + str = CMNewString(broker, > + "Virtual machine execution ended " > + "unexpectly", > + &s); > + s = CMSetArrayElementAt(array, 0, &str, CMPI_string); > + CMSetProperty(ind, "MessageArguments", &array, CMPI_string); > +} > + > +static CMPIStatus create_and_deliver_ind(const CMPIBroker *broker, > + const CMPIContext *ctx, > + char *prefix, > + struct ind_args *args) > +{ > + const char *ind_type_name = "GuestCrashAlertIndication"; > + CMPIObjectPath *ind_op; > + CMPIInstance *ind; > + CMPIStatus s; > + > + ind = get_typed_instance(broker, > + prefix, > + ind_type_name, > + args->ns); > + > + if (ind == NULL) { > + cu_statusf(broker, > + &s, > + CMPI_RC_ERR_FAILED, > + "Failed to create ind, type '%s:%s_%s'", > + args->ns, > + prefix, > + ind_type_name); > + goto out; > + } > + > + ind_op = CMGetObjectPath(ind, &s); > + if (s.rc != CMPI_RC_OK) { > + //CU_DEBUG("Failed to get ind_op. Error: '%s'", s.msg); > + goto out; > + } > + CMSetNameSpace(ind_op, args->ns); > + > + set_alert_ind_props(broker, prefix, ctx, ind); > + > + CU_DEBUG("Delivering Indication: %s", > + CMGetCharPtr(CMObjectPathToString(ind_op, NULL))); > + > + s = stdi_deliver(broker, ctx, args, ind); > + if (s.rc == CMPI_RC_OK) { > + CU_DEBUG("Indication delivered"); > + } else { > + CU_DEBUG("Not delivered: %s", CMGetCharPtr(s.msg)); > + } > + > + out: > + return s; > +} > + > +DECLARE_FILTER(xen_crashed, "Xen_GuestCrashAlertIndication"); > +DECLARE_FILTER(kvm_crashed, "KVM_GuestCrashAlertIndication"); > + > +static struct std_ind_filter *filters[] = { > + &xen_crashed, > + &kvm_crashed, > + NULL, > +}; > + > +static CMPIStatus raise_indication(const CMPIBroker *broker, > + const CMPIContext *ctx, > + const CMPIInstance *ind) > +{ > + CMPIStatus s = {CMPI_RC_OK, NULL}; Extra space at the beginning of the line. > + CMPIObjectPath *ref = NULL; > + struct std_indication_ctx *_ctx = NULL; > + struct ind_args *args = NULL; > + char *prefix = NULL; > + > + CU_DEBUG("Guest Crash Raise indication"); > + > + ref = CMGetObjectPath(ind, &s); > + if (s.rc != CMPI_RC_OK) { > + cu_statusf(broker, &s, > + CMPI_RC_ERR_FAILED, > + "Unable to get a reference to the guest"); > + goto out; > + } > + > + /* FIXME: This is a Pegasus work around. Pegsus loses the namespace > + when an ObjectPath is pulled from an instance */ > + if (STREQ(NAMESPACE(ref), "")) > + CMSetNameSpace(ref, "root/virt"); > + > + /*s = get_domain_by_ref(broker, ref, &src_inst); > + if (s.rc != CMPI_RC_OK || CMIsNullObject(src_inst)) > + goto out;*/ > + > + _ctx = malloc(sizeof(struct std_indication_ctx)); > + if (_ctx == NULL) { > + cu_statusf(broker, &s, > + CMPI_RC_ERR_FAILED, > + "Unable to allocate indication context"); > + goto out; > + } > + > + _ctx->brkr = broker; > + _ctx->handler = NULL; > + _ctx->filters = filters; > + _ctx->enabled = true; > + > + args = malloc(sizeof(struct ind_args)); > + if (args == NULL) { > + cu_statusf(broker, &s, > + CMPI_RC_ERR_FAILED, > + "Unable to allocate ind_args"); > + goto out; > + } > + > + args->ns = strdup(NAMESPACE(ref)); > + args->classname = strdup(CLASSNAME(ref)); > + args->_ctx = _ctx; > + > + prefix = class_prefix_name(args->classname); > + > + s = create_and_deliver_ind(broker, ctx, prefix, args); If you are already passing args to the create_and_deliver_ind(), why not pull the prefix from args->classname in create_and_deliver_ind() itself? > + > + if (s.rc != CMPI_RC_OK) { > + cu_statusf(_BROKER, &s, > + CMPI_RC_ERR_FAILED, > + "Unable to generate indication"); > + } > + > + out: > + if (args != NULL) > + stdi_free_ind_args(&args); > + > + if (_ctx != NULL) > + free(_ctx); > + > + free(prefix); > + return s; > +} > + > + -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 19 21:16:41 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 19 Aug 2009 14:16:41 -0700 Subject: [Libvirt-cim] [PATCH] [Test](#3)Testcase to check for duplicate UUID In-Reply-To: <1d4ded063ea6b2fa3437.1250681236@elm3b151.beaverton.ibm.com> References: <1d4ded063ea6b2fa3437.1250681236@elm3b151.beaverton.ibm.com> Message-ID: <4A8C6BB9.6000807@linux.vnet.ibm.com> Yogananth Subramanian wrote: > # HG changeset patch > # User anantyog at in.ibm.com > # Date 1250681088 25200 > # Node ID 1d4ded063ea6b2fa3437b09e4cee6e71303a5723 > # Parent 5c08aeea7fa147dea06d6b1f0c75c2de70b4b0ae > [Test](#3)Testcase to check for duplicate UUID > Made changes based on comments from Deepti Kalakeri, renamed the test case to > 06_duplicate_uuid.py. > Thx > yogi > > Signed-off-by: Yogananth Subramanian > > diff -r 5c08aeea7fa1 -r 1d4ded063ea6 suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py Wed Aug 19 04:24:48 2009 -0700 > @@ -0,0 +1,116 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Yogananth Subramanian > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU 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 > +# General Public License for more details. > +# > +# You should have received a copy of the GNU 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 > +# > +#Steps: > +#1) Define 2 domains,'default' and 'test', both with random UUID > +#2) Reset the uuid of the second domain, 'test', to the uuid of the > +# first domain, using ModifySystemSettings > +# > + > +import sys > +import time > +from XenKvmLib import vsms > +from XenKvmLib import vxml > +from CimTest.Globals import logger > +from CimTest.ReturnCodes import PASS, FAIL > +from XenKvmLib.const import do_main > +from XenKvmLib.classes import get_typed_class, inst_to_mof > +from XenKvmLib.enumclass import GetInstance > + > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > +default_dom = 'uuid_domain' > +test_dom = 'test_domain' > +nmac = '99:aa:bb:cc:ee:ff' > + > +def get_vssd(ip, virt, default_dom): > + cn = get_typed_class(virt, "VirtualSystemSettingData") > + inst = None > + > + try: > + if virt == "XenFV": > + virt = "Xen" > + > + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } > + inst = GetInstance(ip, cn, key_list, True) > + > + except Exception, details: > + logger.error(details) > + return FAIL, inst > + > + if inst is None: > + return FAIL, inst > + > + return PASS, inst > + > + at do_main(sup_types) > +def main(): > + options = main.options > + > + service = vsms.get_vsms_class(options.virt)(options.ip) > + > + cxml = vxml.get_class(options.virt)(default_dom) > + ret = cxml.cim_define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) > + return FAIL > + > + try: > + status, inst = get_vssd(options.ip, options.virt, default_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s" % > + default_dom) > + > + uuid_defaultdom = inst['UUID'] Older versions of the providers don't return the UUID. So instead of getting the UUID from the VSSD, you can get the UUID from Virt_CS in older provider versions. I think it's good to have the check for both to make sure both work. > + > + sxml = vxml.get_class(options.virt)(test_dom, mac=nmac) > + ret = sxml.cim_define(options.ip) > + if not ret: > + raise Exception("Failed to define the dom: %s" % test_dom) > + > + status, inst = get_vssd(options.ip, options.virt, test_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s" % > + test_dom) > + > + inst['UUID'] = uuid_defaultdom > + vssd = inst_to_mof(inst) > + ret = service.ModifySystemSettings(SystemSettings=vssd) > + if ret[0] ==0: > + raise Exception("Was able to assign duplicate UUID to domain %s" > + % test_dom) > + > + except Exception, details: > + err_no = details[0] > + err_desc = details[1] If you hit an expected exception, details may or may not have two elements. So check the len before indexing details. If it doesn't have two elements, then it's an unexpected exception and the test should fail. > + if err_desc.find("domain 'uuid_domain' is already defined"): > + logger.info('Got expected error desc') > + status = PASS > + else: > + logger.error(details) > + status = FAIL > + > + sxml.undefine(options.ip) It's possible to hit an exception before sxml is defined. You should assign sxml to NONE before the try block. Then check here to make sure it's not equal to None before calling undefine(). > + cxml.undefine(options.ip) > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > + > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 20 01:57:07 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 19 Aug 2009 18:57:07 -0700 Subject: [Libvirt-cim] [PATCH] Remove call to virConnectClose() in set_infstore_migration_flag() Message-ID: <6fc5000bc5c33ffed10f.1250733427@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1250733416 25200 # Node ID 6fc5000bc5c33ffed10f71bf87a136da3fe2e036 # Parent 279db79737df790e7d10668e155bb7bcaf80254c Remove call to virConnectClose() in set_infstore_migration_flag() We don't want to close the connection here since it is used later on in migrate_do(). This can lead to a seg fault or a invalid free. Also, it means our connection object is invalid, so any queries we do to libvirt will fail. Signed-off-by: Kaitlin Rupert diff -r 279db79737df -r 6fc5000bc5c3 src/Virt_VSMigrationService.c --- a/src/Virt_VSMigrationService.c Tue Aug 18 11:18:19 2009 -0700 +++ b/src/Virt_VSMigrationService.c Wed Aug 19 18:56:56 2009 -0700 @@ -1298,7 +1298,6 @@ out: virDomainFree(dom); - virConnectClose(conn); return ret; } From kaitlin at linux.vnet.ibm.com Thu Aug 20 05:49:12 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 19 Aug 2009 22:49:12 -0700 Subject: [Libvirt-cim] [PATCH] Pass a CMPIStatus parameter in connect_by_classname() in create_system() Message-ID: <7efea1d379a1b4de6c4d.1250747352@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1250747237 25200 # Node ID 7efea1d379a1b4de6c4d7583b456a0a00f80ad3b # Parent 6fc5000bc5c33ffed10f71bf87a136da3fe2e036 Pass a CMPIStatus parameter in connect_by_classname() in create_system(). connect_by_classname() excepts a valid CMPIStatus argument since it calls CMSetStatus(), otherwise, this can lead to a seg fault. Signed-off-by: Kaitlin Rupert diff -r 6fc5000bc5c3 -r 7efea1d379a1 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 19 18:56:56 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Wed Aug 19 22:47:17 2009 -0700 @@ -1403,7 +1403,7 @@ } if (domain->uuid != NULL) { - conn = connect_by_classname(_BROKER, CLASSNAME(ref), NULL); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); if (conn == NULL) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, From rmaciel at linux.vnet.ibm.com Thu Aug 20 15:59:32 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 20 Aug 2009 12:59:32 -0300 Subject: [Libvirt-cim] [PATCH] Remove call to virConnectClose() in set_infstore_migration_flag() In-Reply-To: <6fc5000bc5c33ffed10f.1250733427@elm3b151.beaverton.ibm.com> References: <6fc5000bc5c33ffed10f.1250733427@elm3b151.beaverton.ibm.com> Message-ID: <4A8D72E4.5010206@linux.vnet.ibm.com> +1 On 08/19/2009 10:57 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1250733416 25200 > # Node ID 6fc5000bc5c33ffed10f71bf87a136da3fe2e036 > # Parent 279db79737df790e7d10668e155bb7bcaf80254c > Remove call to virConnectClose() in set_infstore_migration_flag() > > We don't want to close the connection here since it is used later on in > migrate_do(). This can lead to a seg fault or a invalid free. Also, it means > our connection object is invalid, so any queries we do to libvirt will fail. > > Signed-off-by: Kaitlin Rupert > > diff -r 279db79737df -r 6fc5000bc5c3 src/Virt_VSMigrationService.c > --- a/src/Virt_VSMigrationService.c Tue Aug 18 11:18:19 2009 -0700 > +++ b/src/Virt_VSMigrationService.c Wed Aug 19 18:56:56 2009 -0700 > @@ -1298,7 +1298,6 @@ > > out: > virDomainFree(dom); > - virConnectClose(conn); > > return ret; > } > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Thu Aug 20 16:05:53 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 20 Aug 2009 13:05:53 -0300 Subject: [Libvirt-cim] [PATCH] Pass a CMPIStatus parameter in connect_by_classname() in create_system() In-Reply-To: <7efea1d379a1b4de6c4d.1250747352@elm3b151.beaverton.ibm.com> References: <7efea1d379a1b4de6c4d.1250747352@elm3b151.beaverton.ibm.com> Message-ID: <4A8D7461.3010707@linux.vnet.ibm.com> +1 On 08/20/2009 02:49 AM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1250747237 25200 > # Node ID 7efea1d379a1b4de6c4d7583b456a0a00f80ad3b > # Parent 6fc5000bc5c33ffed10f71bf87a136da3fe2e036 > Pass a CMPIStatus parameter in connect_by_classname() in create_system(). > > connect_by_classname() excepts a valid CMPIStatus argument since it calls > CMSetStatus(), otherwise, this can lead to a seg fault. > > Signed-off-by: Kaitlin Rupert > > diff -r 6fc5000bc5c3 -r 7efea1d379a1 src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 19 18:56:56 2009 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Wed Aug 19 22:47:17 2009 -0700 > @@ -1403,7 +1403,7 @@ > } > > if (domain->uuid != NULL) { > - conn = connect_by_classname(_BROKER, CLASSNAME(ref), NULL); > + conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); > if (conn == NULL) { > cu_statusf(_BROKER, s, > CMPI_RC_ERR_FAILED, > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Fri Aug 21 00:16:43 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 20 Aug 2009 17:16:43 -0700 Subject: [Libvirt-cim] [PATCH] Be sure to check to see if the UUID is in use in both the DefineSystem() Message-ID: <0243aa0574431112f094.1250813803@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1250813784 25200 # Node ID 0243aa0574431112f0946354d4bbad62bb2c2f7b # Parent 7efea1d379a1b4de6c4d7583b456a0a00f80ad3b Be sure to check to see if the UUID is in use in both the DefineSystem()... and ModifySystemSettings() calls. Signed-off-by: Kaitlin Rupert diff -r 7efea1d379a1 -r 0243aa057443 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 19 22:47:17 2009 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Thu Aug 20 17:16:24 2009 -0700 @@ -71,6 +71,37 @@ RESOURCE_MOD, }; +static CMPIStatus check_uuid_in_use(const CMPIObjectPath *ref, + struct domain *domain) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + virConnectPtr conn = NULL; + virDomainPtr dom = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error connecting to libvirt"); + goto out; + } + + dom = virDomainLookupByUUIDString(conn, domain->uuid); + if (dom != NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Guest '%s' is already defined with UUID %s", + virDomainGetName(dom), + domain->uuid); + } + + out: + virDomainFree(dom); + virConnectClose(conn); + + return s; +} + static CMPIStatus define_system_parse_args(const CMPIArgs *argsin, CMPIInstance **sys, const char *ns, @@ -1402,26 +1433,10 @@ goto out; } - if (domain->uuid != NULL) { - conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); - if (conn == NULL) { - cu_statusf(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Error connecting to libvirt"); - goto out; - } - - dom = virDomainLookupByUUIDString(conn, domain->uuid); - if (dom != NULL) { - cu_statusf(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Guest '%s' is already defined with UUID %s", - virDomainGetName(dom), - domain->uuid); - goto out; - } - } - + *s = check_uuid_in_use(ref, domain); + if (s->rc != CMPI_RC_OK) + goto out; + msg = classify_resources(resources, NAMESPACE(ref), domain); if (msg != NULL) { CU_DEBUG("Failed to classify resources: %s", msg); @@ -1644,6 +1659,10 @@ goto out; } + s = check_uuid_in_use(ref, dominfo); + if (s.rc != CMPI_RC_OK) + goto out; + xml = system_to_xml(dominfo); if (xml != NULL) { CU_DEBUG("New XML is:\n%s", xml); From deeptik at linux.vnet.ibm.com Fri Aug 21 09:49:56 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 21 Aug 2009 02:49:56 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Adding vol_list to xm_virt_util.py In-Reply-To: References: Message-ID: <4b9d9b5b54d1781fe35f.1250848196@elm3b151.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1250847104 25200 # Node ID 4b9d9b5b54d1781fe35f24008aeb0fd14a5b10ac # Parent c338efef06278a9a40a90f07a34750ec50c49939 [TEST] Adding vol_list to xm_virt_util.py. Tested with KVM on F11 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r c338efef0627 -r 4b9d9b5b54d1 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Wed Aug 19 09:03:40 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Fri Aug 21 02:31:44 2009 -0700 @@ -237,6 +237,17 @@ return names +def vol_list(server, virt="KVM", pool_name=None): + """ Function to list the volumes part of a pool""" + + cmd = " virsh -c %s vol-list %s | sed -e '1,2 d' -e '$ d'" \ + % (virt2uri(virt), pool_name) + ret, out = utils.run_remote(server, cmd) + if ret != 0: + return None + + return out + def virsh_vcpuinfo(server, dom, virt="Xen"): cmd = "virsh -c %s vcpuinfo %s | grep VCPU | wc -l" % (virt2uri(virt), dom) From deeptik at linux.vnet.ibm.com Fri Aug 21 09:49:55 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 21 Aug 2009 02:49:55 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Adding new tc to verify StorageVolume creation. Message-ID: From deeptik at linux.vnet.ibm.com Fri Aug 21 09:49:57 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Fri, 21 Aug 2009 02:49:57 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Adding new test RPCS/10_create_storagevolume.py In-Reply-To: References: Message-ID: <91a6bc7e18e997c0b3dc.1250848197@elm3b151.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1250848107 25200 # Node ID 91a6bc7e18e997c0b3dc28e7677ec5377d114653 # Parent 4b9d9b5b54d1781fe35f24008aeb0fd14a5b10ac [TEST] Adding new test RPCS/10_create_storagevolume.py This test verifies the creation of StorageVol in the dir pool. Tested with KVM on F11 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 4b9d9b5b54d1 -r 91a6bc7e18e9 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py Fri Aug 21 02:48:27 2009 -0700 @@ -0,0 +1,190 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +# +# This test case verifies the creation of the StorageVol using the +# CreateResourceInPool method of RPCS. +# +# -Date: 21-08-2009 + +import sys +import os +from VirtLib import utils +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS, SKIP +from XenKvmLib.const import do_main, platform_sup +from XenKvmLib.const import get_provider_version +from XenKvmLib.vsms import RASD_TYPE_STOREVOL +from XenKvmLib.rasd import libvirt_rasd_storagepool_changes +from XenKvmLib import rpcs_service +from XenKvmLib.assoc import Associators +from XenKvmLib.enumclass import GetInstance, EnumNames +from XenKvmLib.xm_virt_util import virsh_version, vol_list +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.common_util import destroy_diskpool +from XenKvmLib.pool import create_pool, undefine_diskpool, DIR_POOL + +pool_attr = { 'Path' : "/tmp" } +vol_name = "cimtest-vol.img" + +def get_stovol_settings(server, virt, dp_id, pool_name): + ac_cn = get_typed_class(virt, "AllocationCapabilities") + an_cn = get_typed_class(virt, "SettingsDefineCapabilities") + key_list = {"InstanceID" : dp_id } + + try: + inst = GetInstance(server, ac_cn, key_list) + dp_rasds = Associators(server, an_cn, ac_cn, + InstanceID=inst.InstanceID) + except Exception, detail: + logger.error("Exception: %s", detail) + return None + + for dpool_rasd in dp_rasds: + if dpool_rasd['ResourceType'] == RASD_TYPE_STOREVOL and \ + 'Default' in dpool_rasd['InstanceID']: + + dpool_rasd['PoolID'] = dp_id + dpool_rasd['Path'] = pool_attr['Path'] + dpool_rasd['VolumeName'] = vol_name + break + + if not pool_name in dpool_rasd['PoolID']: + return None + + stovol_settings = inst_to_mof(dpool_rasd) + + return stovol_settings + +def get_diskpool(server, virt, dp_cn, dp_inst_id): + disk_pool_inst = None + dpool_cn = get_typed_class(virt, dp_cn) + pools = EnumNames(server, dpool_cn) + for pool in pools: + if pool['InstanceID'] == dp_inst_id: + disk_pool_inst = pool + + return disk_pool_inst + +def verify_vol(server, virt, pool_name, exp_vol_path, found): + vols = vol_list(server, virt, pool_name) + if vols == None: + raise Exception("Failed to get the volume information") + + for vol in vols.split('\n'): + res_vol_name, res_vol_path = vol.split() + if res_vol_name != vol_name and res_vol_path != exp_vol_path: + continue + else: + found += 1 + + if found != 1: + logger.error("Failed to get the vol information") + + return found + +def cleanup_pool_vol(server, virt, pool_name, exp_vol_path): + try: + status = destroy_diskpool(server, virt, pool_name) + if status != PASS: + raise Exception("Unable to destroy diskpool '%s'" \ + % pool_name) + else: + status = undefine_diskpool(server, virt, pool_name) + if status != PASS: + raise Exception("Unable to undefine diskpool '%s'" \ + % pool_name) + except Exception, details: + logger.error("Exception details: %s", details) + return FAIL + + if os.path.exists(exp_vol_path): + cmd = "rm -rf %s" % exp_vol_path + ret, out = utils.run_remote(server, cmd) + if ret != 0: + logger.info("'%s' was not removed, please remove it manually", + exp_vol_path) + return PASS + + at do_main(platform_sup) +def main(): + options = main.options + server = options.ip + virt = options.virt + + libvirt_version = virsh_version(server, virt) + cim_rev, changeset = get_provider_version(virt, server) + if libvirt_version < "0.4.1" and cim_rev < libvirt_rasd_storagepool_changes: + logger.info("Storage Volume creation support is available with Libvirt" + "version >= 0.4.1 and Libvirt-CIM rev '%s'", + libvirt_rasd_storagepool_changes) + return SKIP + + dp_cn = "DiskPool" + exp_vol_path = "%s/%s" % (pool_attr['Path'], vol_name) + + # For now the test case support only the creation of dir type based + # vol creation, we can extend dp_types to include netfs etc + dp_types = { "DISK_POOL_DIR" : DIR_POOL } + + for pool_name, pool_type in dp_types.iteritems(): + status = FAIL + res = [FAIL] + found = 0 + try: + status = create_pool(server, virt, pool_name, pool_attr, + mode_type=pool_type, pool_type="DiskPool") + + if status != PASS: + logger.error("Failed to create pool '%s'", pool_name) + return status + + dp_inst_id = "%s/%s" % (dp_cn, pool_name) + stovol_settings = get_stovol_settings(server, virt, + dp_inst_id, pool_name) + if stovol_settings == None: + raise Exception("Failed to get the defualt StorageVolRASD info") + + disk_pool_inst = get_diskpool(server, virt, dp_cn, dp_inst_id) + if disk_pool_inst == None: + raise Exception("DiskPool instance for '%s' not found!" \ + % pool_name) + + rpcs = get_typed_class(virt, "ResourcePoolConfigurationService") + rpcs_conn = eval("rpcs_service." + rpcs)(server) + res = rpcs_conn.CreateResourceInPool(Settings=stovol_settings, + Pool=disk_pool_inst) + found = verify_vol(server, virt, pool_name, exp_vol_path, found) + + except Exception, details: + logger.error("Exception details: %s", details) + status = FAIL + + ret = cleanup_pool_vol(server, virt, pool_name, exp_vol_path) + if res[0] == PASS and found == 1 and ret == PASS: + status = PASS + else: + return FAIL + + return status +if __name__ == "__main__": + sys.exit(main()) From rmaciel at linux.vnet.ibm.com Fri Aug 21 17:15:22 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 21 Aug 2009 14:15:22 -0300 Subject: [Libvirt-cim] [PATCH 0 of 2] [RFC] [#2] Creates GuestCrashAlertIndication Message-ID: From rmaciel at linux.vnet.ibm.com Fri Aug 21 17:15:23 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 21 Aug 2009 14:15:23 -0300 Subject: [Libvirt-cim] [PATCH 1 of 2] Creates and register provider class GuestCrashAlertIndication In-Reply-To: References: Message-ID: # HG changeset patch # User Richard Maciel # Date 1248549583 10800 # Node ID cd707d323dcfcf2b7557fc4be9e0aac4fda65502 # Parent 38d375929f534e69af50e653e2f8105c89350223 Creates and register provider class GuestCrashAlertIndication Signed-off-by: Richard Maciel diff -r 38d375929f53 -r cd707d323dcf Makefile.am --- a/Makefile.am Thu Aug 13 09:32:18 2009 -0700 +++ b/Makefile.am Sat Jul 25 16:19:43 2009 -0300 @@ -55,7 +55,8 @@ schema/InputPool.mof \ schema/HostedAccessPoint.mof \ schema/ServiceAccessBySAP.mof \ - schema/SAPAvailableForElement.mof + schema/SAPAvailableForElement.mof \ + schema/GuestCrashAlertIndication.mof INTEROP_MOFS = \ schema/ComputerSystem.mof \ @@ -129,7 +130,8 @@ schema/InputPool.registration \ schema/HostedAccessPoint.registration \ schema/ServiceAccessBySAP.registration \ - schema/SAPAvailableForElement.registration + schema/SAPAvailableForElement.registration \ + schema/GuestCrashAlertIndication.registration INTEROP_REGS = \ schema/RegisteredProfile.registration \ diff -r 38d375929f53 -r cd707d323dcf schema/GuestCrashAlertIndication.mof --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/GuestCrashAlertIndication.mof Sat Jul 25 16:19:43 2009 -0300 @@ -0,0 +1,17 @@ +// Copyright IBM Corp. 2007 + +[Description ("Xen guest crash alert"), + Provider("cmpi::Virt_GuestCrashAlertIndication") +] +class Xen_GuestCrashAlertIndication : CIM_AlertIndication +{ + uint32 RaiseIndication([IN] CIM_InstCreation REF TheIndication); +}; + +[Description ("KVM guest crash alert"), + Provider("cmpi::Virt_GuestCrashAlertIndication") +] +class KVM_GuestCrashAlertIndication : CIM_AlertIndication +{ + uint32 RaiseIndication([IN] CIM_InstCreation REF TheIndication); +}; diff -r 38d375929f53 -r cd707d323dcf schema/GuestCrashAlertIndication.registration --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/GuestCrashAlertIndication.registration Sat Jul 25 16:19:43 2009 -0300 @@ -0,0 +1,4 @@ +# Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes +Xen_GuestCrashAlertIndication root/virt Virt_GuestCrashAlertIndicationProvider Virt_GuestCrashAlertIndication indication method +KVM_GuestCrashAlertIndication root/virt Virt_GuestCrashAlertIndicationProvider Virt_GuestCrashAlertIndication indication method From rmaciel at linux.vnet.ibm.com Fri Aug 21 17:15:24 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 21 Aug 2009 14:15:24 -0300 Subject: [Libvirt-cim] [PATCH 2 of 2] Raises GuestCrashAlertIndication when QEMU crashes In-Reply-To: References: Message-ID: # HG changeset patch # User Richard Maciel # Date 1248549583 10800 # Node ID c91e92f9a0075e82710c429da17f095a7295ef66 # Parent cd707d323dcfcf2b7557fc4be9e0aac4fda65502 Raises GuestCrashAlertIndication when QEMU crashes Signed-off-by: Richard Maciel diff -r cd707d323dcf -r c91e92f9a007 src/Makefile.am --- a/src/Makefile.am Sat Jul 25 16:19:43 2009 -0300 +++ b/src/Makefile.am Sat Jul 25 16:19:43 2009 -0300 @@ -75,7 +75,8 @@ libVirt_ServiceAffectsElement.la \ libVirt_HostedAccessPoint.la \ libVirt_ServiceAccessBySAP.la \ - libVirt_SAPAvailableForElement.la + libVirt_SAPAvailableForElement.la \ + libVirt_GuestCrashAlertIndication.la libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c libVirt_ComputerSystem_la_DEPENDENCIES = libVirt_VirtualSystemSnapshotService.la @@ -233,3 +234,7 @@ libVirt_SAPAvailableForElement_la_SOURCES = Virt_SAPAvailableForElement.c libVirt_SAPAvailableForElement_la_LIBADD = -lVirt_ComputerSystem -lVirt_KVMRedirectionSAP +libVirt_GuestCrashAlertIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la +libVirt_GuestCrashAlertIndication_la_SOURCES = Virt_GuestCrashAlertIndication.c +libVirt_GuestCrashAlertIndication_la_LIBADD = -lVirt_ComputerSystem + diff -r cd707d323dcf -r c91e92f9a007 src/Virt_GuestCrashAlertIndication.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_GuestCrashAlertIndication.c Sat Jul 25 16:19:43 2009 -0300 @@ -0,0 +1,545 @@ +/* + * Copyright IBM Corp. 2009 + * + * Authors: + * Richard Maciel + * + * 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 +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "config.h" +#include "infostore.h" + +typedef struct cb_info { + const CMPIContext *context; + const CMPIObjectPath *obj_path; +} *cb_info_ptr; + +static const CMPIBroker *_BROKER; + +#define CAI_NUM_PLATFORMS 3 +enum CAI_PLATFORMS {CAI_XEN, + CAI_KVM, + CAI_LXC, +}; +static int active_filters[CAI_NUM_PLATFORMS]; + +static pthread_mutex_t cb_reg_mutex = PTHREAD_MUTEX_INITIALIZER; + +static void set_alert_ind_props(const CMPIBroker *broker, + const char *prefix, + const CMPIContext *ctx, + CMPIInstance *ind) +{ + CMPIStatus s; + CMPIString *str = NULL; + CMPIUint16 val; + CMPIArray *array = NULL; + char *charsptr = NULL; + int rc; + + + //CMSetProperty(ind, "Description", &str, CMPI_string); + + + // val 1 + val = 1; + CMSetProperty(ind, "AlertType", &val, CMPI_uint16); + + str = CMNewString(broker, "Virtual guest crash", &s); + CMSetProperty(ind, "OtherAlertType", &str, CMPI_string); + + val = 7; + CMSetProperty(ind, "PerceivedSeverity", &val, CMPI_uint16); + + // val 48 + val = 48; + CMSetProperty(ind, "ProbableCause", &val, CMPI_uint16); + + //CMSetProperty(ind, "ProbableCauseDescription", &str, CMPI_string); + + // val 1 + val = 1; + CMSetProperty(ind, "Trending", &val, CMPI_uint16); + + // This is an array + // CMSetProperty(ind, "RecommendedActions", &str, CMPI_string); + + + // Must find how to fill it + //CMSetProperty(ind, "EventTime", &, CMPI_dateTime); + + // Won't use it + //CMSetProperty(ind, "SystemCreationClassName", &str, CMPI_string); + + // Won't use it + // CMSetProperty(ind, "SystemName", &str, CMPI_string); + + // Combine GuestCrashAlertIndication with prefix + rc = asprintf(&charsptr, "%s%s", prefix, "_GuestCrashAlertIndication"); + str = CMNewString(broker, charsptr, &s); + CMSetProperty(ind, "ProviderName", &str, CMPI_string); + free(charsptr); + + str = CMNewString(broker, "DTMF", &s); + CMSetProperty(ind, "OwningEntity", &str, CMPI_string); + + str = CMNewString(broker, "PLAT0002", &s); + CMSetProperty(ind, "MessageID", &str, CMPI_string); + + //CMSetProperty(ind, "Message", &str, CMPI_string); + + // This is an string array + array = CMNewArray(broker, 1, CMPI_stringA, &s); + str = CMNewString(broker, + "Virtual machine execution ended " + "unexpectly", + &s); + s = CMSetArrayElementAt(array, 0, &str, CMPI_string); + CMSetProperty(ind, "MessageArguments", &array, CMPI_string); +} + +static CMPIStatus create_and_deliver_ind(const CMPIBroker *broker, + const CMPIContext *ctx, + struct ind_args *args) +{ + const char *ind_type_name = "GuestCrashAlertIndication"; + CMPIObjectPath *ind_op; + CMPIInstance *ind; + CMPIStatus s; + char *prefix = NULL; + + prefix = class_prefix_name(args->classname); + + ind = get_typed_instance(broker, + prefix, + ind_type_name, + args->ns); + + if (ind == NULL) { + cu_statusf(broker, + &s, + CMPI_RC_ERR_FAILED, + "Failed to create ind, type '%s:%s_%s'", + args->ns, + prefix, + ind_type_name); + goto out; + } + + ind_op = CMGetObjectPath(ind, &s); + if (s.rc != CMPI_RC_OK) { + //CU_DEBUG("Failed to get ind_op. Error: '%s'", s.msg); + goto out; + } + CMSetNameSpace(ind_op, args->ns); + + set_alert_ind_props(broker, prefix, ctx, ind); + + CU_DEBUG("Delivering Indication: %s", + CMGetCharPtr(CMObjectPathToString(ind_op, NULL))); + + s = stdi_deliver(broker, ctx, args, ind); + if (s.rc == CMPI_RC_OK) { + CU_DEBUG("Indication delivered"); + } else { + CU_DEBUG("Not delivered: %s", CMGetCharPtr(s.msg)); + } + + out: + free(prefix); + + return s; +} + +DECLARE_FILTER(xen_crashed, "Xen_GuestCrashAlertIndication"); +DECLARE_FILTER(kvm_crashed, "KVM_GuestCrashAlertIndication"); + +static struct std_ind_filter *filters[] = { + &xen_crashed, + &kvm_crashed, + NULL, +}; + +static CMPIStatus raise_indication(const CMPIBroker *broker, + const CMPIContext *ctx, + const CMPIInstance *ind) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *ref = NULL; + struct std_indication_ctx *_ctx = NULL; + struct ind_args *args = NULL; + + CU_DEBUG("Guest Crash Raise indication"); + + ref = CMGetObjectPath(ind, &s); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to get a reference to the guest"); + goto out; + } + + /* FIXME: This is a Pegasus work around. Pegsus loses the namespace + when an ObjectPath is pulled from an instance */ + if (STREQ(NAMESPACE(ref), "")) + CMSetNameSpace(ref, "root/virt"); + + /*s = get_domain_by_ref(broker, ref, &src_inst); + if (s.rc != CMPI_RC_OK || CMIsNullObject(src_inst)) + goto out;*/ + + _ctx = malloc(sizeof(struct std_indication_ctx)); + if (_ctx == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to allocate indication context"); + goto out; + } + + _ctx->brkr = broker; + _ctx->handler = NULL; + _ctx->filters = filters; + _ctx->enabled = true; + + args = malloc(sizeof(struct ind_args)); + if (args == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to allocate ind_args"); + goto out; + } + + args->ns = strdup(NAMESPACE(ref)); + args->classname = strdup(CLASSNAME(ref)); + args->_ctx = _ctx; + + + s = create_and_deliver_ind(broker, ctx, args); + + if (s.rc != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to generate indication"); + } + + out: + if (args != NULL) + stdi_free_ind_args(&args); + + if (_ctx != NULL) + free(_ctx); + + return s; +} + + +static void free_cb(void *opaque) +{ + cb_info_ptr cbinfo = NULL; + + CU_DEBUG("Releasing memory from guest crash callback"); + + cbinfo = (cb_info_ptr)opaque; + free(cbinfo); +} + +static char * inc_counter(virDomainPtr dom) +{ + struct infostore_ctx *store = NULL; + char *str = NULL; + uint64_t counter = 0; + bool ret = false; + + store = infostore_open(dom); + + if (store == NULL) { + CU_DEBUG("Could not open infostore"); + goto out; + } + + counter = infostore_get_u64(store, "EventID"); + + if (counter == 0) + CU_DEBUG("No EventID available. Creating..."); + + counter++; + + if (asprintf(&str, "%llu", counter) < 0) { + CU_DEBUG("Could not alloc memory for counter"); + goto out; + } + + ret = infostore_set_u64(store, "EventID", counter); + if (!ret) { + CU_DEBUG("Could not save EventID to infostore"); + free(str); + } + + out: + if (!ret) + str = NULL; + + infostore_close(store); + + return str; +} + +static void preset_alert_ind_props(CMPIInstance *ind, virDomainPtr dom) +{ + CMPIStatus s; + CMPIString *str = NULL; + char *dom_name = (char *)virDomainGetName(dom); + char *counter = NULL; + + if (dom_name == NULL) { + CU_DEBUG("Could not retrieve name of guest responsible for " + "crash"); + dom_name = "Guest name not available"; + } + + str = CMNewString(_BROKER, dom_name, &s); + CMSetProperty(ind, "AlertingManagedElement", &str, CMPI_string); + + // This property must be unique, retrieve a counter from infostore + counter = inc_counter(dom); + if (counter == NULL) { + CU_DEBUG("Could not retrieve counter"); + } else { + str = CMNewString(_BROKER, counter, &s); + CMSetProperty(ind, "EventID", &str, CMPI_string); + free(counter); + } +} + +static int guest_crashed_cb(virConnectPtr conn, + virDomainPtr dom, + int event, + int detail, + void *opaque) +{ + char *type = NULL; + CMPIStatus s = {CMPI_RC_OK, NULL}; + const char *ind_name = "GuestCrashedAlertIndication"; + CMPIInstance *ind = NULL; + cb_info_ptr cbinfo = NULL; + const CMPIObjectPath *op = NULL; + const CMPIContext *context = NULL; + + CU_DEBUG("Preparing GuestCrashedAlertIndication"); + + if (event != VIR_DOMAIN_EVENT_STOPPED_FAILED) { + CU_DEBUG("Event not monitored. Ignoring..."); + return 0; + } + + cbinfo = (cb_info_ptr)opaque; + op = cbinfo->obj_path; + context = cbinfo->context; + + ind = get_typed_instance(_BROKER, + CLASSNAME(op), + ind_name, + NAMESPACE(op)); + + preset_alert_ind_props(ind, dom); + + if (ind == NULL) { + CU_DEBUG("Failed to create ind '%s'", ind_name); + goto out; + } + + type = get_typed_class(CLASSNAME(op), ind_name); + + s = stdi_raise_indication(_BROKER, + context, + type, + NAMESPACE(op), + ind); + + out: + free(type); + + return s.rc != CMPI_RC_OK; +} + +static int platform_from_class(const char *cn) +{ + if (STARTS_WITH(cn, "Xen")) + return CAI_XEN; + else if (STARTS_WITH(cn, "KVM")) + return CAI_KVM; + else if (STARTS_WITH(cn, "LXC")) + return CAI_LXC; + else + return -1; +} + +static CMPIStatus ActivateFilter(CMPIIndicationMI* mi, + const CMPIContext* ctx, + const CMPISelectExp* se, + const char *ns, + const CMPIObjectPath* op, + CMPIBoolean first) +{ + virConnectPtr conn = NULL; + CMPIStatus s = {CMPI_RC_OK, NULL}; + cb_info_ptr cbinfo = NULL; + int platform; + int ret = 0; + + cbinfo = (cb_info_ptr)malloc(sizeof(struct cb_info)); + cbinfo->context = ctx; + cbinfo->obj_path = op; + + CU_DEBUG("ActivateFilter for %s", CLASSNAME(op)); + + if (CMIsNullObject(op)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No ObjectPath given"); + goto out; + } + + platform = platform_from_class(CLASSNAME(op)); + if (platform < 0) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unknown platform"); + goto out; + } + + pthread_mutex_lock(&cb_reg_mutex); + + active_filters[platform]++; + + if (active_filters[platform] == 1) { + conn = connect_by_classname(_BROKER, CLASSNAME(op), &s); + + CU_DEBUG("Registering callback function"); + ret = virConnectDomainEventRegister(conn, + guest_crashed_cb, + (void *)cbinfo, + free_cb); + CU_DEBUG("ret val: %d\n", ret); + } + + pthread_mutex_unlock(&cb_reg_mutex); + + out: + return s; +} + +static CMPIStatus DeActivateFilter(CMPIIndicationMI* mi, + const CMPIContext* ctx, + const CMPISelectExp* se, + const char *ns, + const CMPIObjectPath* op, + CMPIBoolean last) +{ + int platform; + + CMPIStatus s = {CMPI_RC_OK, NULL}; + + pthread_mutex_lock(&cb_reg_mutex); + + platform = platform_from_class(CLASSNAME(op)); + if (platform < 0) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unknown platform"); + goto out; + } + + if (active_filters[platform] == 1) { + // Unregister callback + } + + active_filters[platform]--; + + pthread_mutex_unlock(&cb_reg_mutex); + + CU_DEBUG("DeActivateFilter for %s", CLASSNAME(op)); + + out: + return s; +} + +static _EI_RTYPE EnableIndications(CMPIIndicationMI* mi, + const CMPIContext *ctx) +{ + CU_DEBUG("EnableIndications"); + + _EI_RET(); + +} + +static _EI_RTYPE DisableIndications(CMPIIndicationMI* mi, + const CMPIContext *ctx) +{ + CU_DEBUG("DisableIndications"); + + _EI_RET(); +} + + + +static struct std_indication_handler csi = { + .raise_fn = raise_indication, + .trigger_fn = NULL, + .activate_fn = ActivateFilter, + .deactivate_fn = DeActivateFilter, + .enable_fn = EnableIndications, + .disable_fn = DisableIndications, +}; + +DEFAULT_IND_CLEANUP(); +DEFAULT_AF(); +DEFAULT_MP(); + +STDI_IndicationMIStub(, + Virt_GuestCrashAlertIndicationProvider, + _BROKER, + libvirt_cim_init(), + &csi, + filters); + +/* + * Local Variables: + * mode: C + * c-set-style: "K&R" + * tab-width: 8 + * c-basic-offset: 8 + * indent-tabs-mode: nil + * End: + */ From kaitlin at linux.vnet.ibm.com Fri Aug 21 18:48:22 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 21 Aug 2009 11:48:22 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Raises GuestCrashAlertIndication when QEMU crashes In-Reply-To: References: Message-ID: <4A8EEBF6.6080703@linux.vnet.ibm.com> > +typedef struct cb_info { > + const CMPIContext *context; > + const CMPIObjectPath *obj_path; > +} *cb_info_ptr; > + > +static const CMPIBroker *_BROKER; > + > +#define CAI_NUM_PLATFORMS 3 > +enum CAI_PLATFORMS {CAI_XEN, > + CAI_KVM, > + CAI_LXC, > +}; > +static int active_filters[CAI_NUM_PLATFORMS]; > + > +static pthread_mutex_t cb_reg_mutex = PTHREAD_MUTEX_INITIALIZER; > + > +static void set_alert_ind_props(const CMPIBroker *broker, > + const char *prefix, > + const CMPIContext *ctx, > + CMPIInstance *ind) > +{ > + CMPIStatus s; > + CMPIString *str = NULL; > + CMPIUint16 val; > + CMPIArray *array = NULL; > + char *charsptr = NULL; > + int rc; > + > + > + //CMSetProperty(ind, "Description", &str, CMPI_string); > + > + > + // val 1 > + val = 1; > + CMSetProperty(ind, "AlertType", &val, CMPI_uint16); > + > + str = CMNewString(broker, "Virtual guest crash", &s); > + CMSetProperty(ind, "OtherAlertType", &str, CMPI_string); > + > + val = 7; > + CMSetProperty(ind, "PerceivedSeverity", &val, CMPI_uint16); > + > + // val 48 > + val = 48; > + CMSetProperty(ind, "ProbableCause", &val, CMPI_uint16); > + > + //CMSetProperty(ind, "ProbableCauseDescription", &str, CMPI_string); > + > + // val 1 > + val = 1; > + CMSetProperty(ind, "Trending", &val, CMPI_uint16); > + > + // This is an array > + // CMSetProperty(ind, "RecommendedActions", &str, CMPI_string); > + > + > + // Must find how to fill it > + //CMSetProperty(ind, "EventTime", &, CMPI_dateTime); > + > + // Won't use it > + //CMSetProperty(ind, "SystemCreationClassName", &str, CMPI_string); > + > + // Won't use it > + // CMSetProperty(ind, "SystemName", &str, CMPI_string); > + > + // Combine GuestCrashAlertIndication with prefix > + rc = asprintf(&charsptr, "%s%s", prefix, "_GuestCrashAlertIndication"); Instead of hardcoding the name of the provider in two places, I would have this function take a const char * argument and then pass in the value. > + str = CMNewString(broker, charsptr, &s); > + CMSetProperty(ind, "ProviderName", &str, CMPI_string); > + free(charsptr); > + > + str = CMNewString(broker, "DTMF", &s); > + CMSetProperty(ind, "OwningEntity", &str, CMPI_string); > + > + str = CMNewString(broker, "PLAT0002", &s); > + CMSetProperty(ind, "MessageID", &str, CMPI_string); > + > + //CMSetProperty(ind, "Message", &str, CMPI_string); > + > + // This is an string array > + array = CMNewArray(broker, 1, CMPI_stringA, &s); > + str = CMNewString(broker, > + "Virtual machine execution ended " > + "unexpectly", > + &s); > + s = CMSetArrayElementAt(array, 0, &str, CMPI_string); > + CMSetProperty(ind, "MessageArguments", &array, CMPI_string); > +} > + > +static CMPIStatus create_and_deliver_ind(const CMPIBroker *broker, > + const CMPIContext *ctx, > + struct ind_args *args) > +{ > + const char *ind_type_name = "GuestCrashAlertIndication"; You set the name of the provider here - so you can pass this to set_alert_ind_props(). This keeps you from having to change the name in multiple locations if the name changes. > + CMPIObjectPath *ind_op; > + CMPIInstance *ind; > + CMPIStatus s; > + char *prefix = NULL; > + > + prefix = class_prefix_name(args->classname); > + > + ind = get_typed_instance(broker, > + prefix, > + ind_type_name, > + args->ns); You shouldn't need to create another indication here. You've already created one in guest_crashed_cb(). If you create a new one here, you overwrite the one created in guest_crashed_cb(). You lose the values of the attributes you set in guest_crashed_cb(). > + > + if (ind == NULL) { > + cu_statusf(broker, > + &s, > + CMPI_RC_ERR_FAILED, > + "Failed to create ind, type '%s:%s_%s'", > + args->ns, > + prefix, > + ind_type_name); > + goto out; > + } > + > + ind_op = CMGetObjectPath(ind, &s); > + if (s.rc != CMPI_RC_OK) { > + //CU_DEBUG("Failed to get ind_op. Error: '%s'", s.msg); > + goto out; > + } > + CMSetNameSpace(ind_op, args->ns); > + > + set_alert_ind_props(broker, prefix, ctx, ind); > + > + CU_DEBUG("Delivering Indication: %s", > + CMGetCharPtr(CMObjectPathToString(ind_op, NULL))); > + > + s = stdi_deliver(broker, ctx, args, ind); > + if (s.rc == CMPI_RC_OK) { > + CU_DEBUG("Indication delivered"); > + } else { > + CU_DEBUG("Not delivered: %s", CMGetCharPtr(s.msg)); > + } > + > + out: > + free(prefix); > + > + return s; > +} > + > + > +static void preset_alert_ind_props(CMPIInstance *ind, virDomainPtr dom) > +{ > + CMPIStatus s; > + CMPIString *str = NULL; > + char *dom_name = (char *)virDomainGetName(dom); > + char *counter = NULL; > + > + if (dom_name == NULL) { > + CU_DEBUG("Could not retrieve name of guest responsible for " > + "crash"); > + dom_name = "Guest name not available"; > + } > + > + str = CMNewString(_BROKER, dom_name, &s); > + CMSetProperty(ind, "AlertingManagedElement", &str, CMPI_string); > + > + // This property must be unique, retrieve a counter from infostore > + counter = inc_counter(dom); It seems like you'd want to use a mutex around this call to ensure that you're note reading from the info store as it's being written to. That'll ensure that each indication gets its own value. > + if (counter == NULL) { > + CU_DEBUG("Could not retrieve counter"); > + } else { > + str = CMNewString(_BROKER, counter, &s); > + CMSetProperty(ind, "EventID", &str, CMPI_string); > + free(counter); > + } > +} > + -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Mon Aug 24 09:48:21 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Mon, 24 Aug 2009 15:18:21 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] Fix LXC connection uri In-Reply-To: <5d129fff36960c419dda.1250619670@elm3b151.beaverton.ibm.com> References: <5d129fff36960c419dda.1250619670@elm3b151.beaverton.ibm.com> Message-ID: <4A9261E5.8070606@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1250619664 25200 > # Node ID 5d129fff36960c419dda641692c9f5b8682c5a3c > # Parent 5c08aeea7fa147dea06d6b1f0c75c2de70b4b0ae > [TEST] Fix LXC connection uri... > > And be sure not to pass a graphics device when creating a Containers guest. > These changes are dependent on libvirt-cim patch "Fix LXC connection uri, > remove default graphics device" > > diff -r 5c08aeea7fa1 -r 5d129fff3696 suites/libvirt-cim/lib/XenKvmLib/vxml.py > --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Aug 17 04:16:50 2009 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Aug 18 11:21:04 2009 -0700 > @@ -151,7 +151,8 @@ > elif vir_type == 'kvm': > self.vuri = 'qemu:///system' > elif vir_type == 'lxc': > - self.vuri = 'lxc:///system' > + #self.vuri = 'lxc:///system' > You probably forgot to remove the commented line. > + self.vuri = 'lxc:///' > > def run(self, ip, vcmd, param): > file_arg_cmds = ['define', 'create', 'net-create', 'pool-create'] > @@ -572,17 +573,18 @@ > self.pasd = vsms.get_pasd_class(virt)(name=dom_name) > self.dasd = vsms.get_dasd_class(virt)(disk_dev, disk_source, > dom_name) > + self.gasd = None > else: > self.pasd = vsms.get_pasd_class(virt)(vcpu=vcpus, name=dom_name) > self.dasd = vsms.get_dasd_class(virt)(disk_dev, disk_source, > dom_name, emu_type) > + self.gasd = vsms.get_gasd_class(virt)(name=dom_name, > + res_sub_type=grstype, ip=ip, > + lport=port_num, keymap=kmap, > + vnc_passwd=vnc_passwd) > self.masd = vsms.get_masd_class(virt)(megabytes=mem, > mallocunits=mem_allocunits, > name=dom_name) > - self.gasd = vsms.get_gasd_class(virt)(name=dom_name, > - res_sub_type=grstype, ip=ip, > - lport=port_num, keymap=kmap, > - vnc_passwd=vnc_passwd) > self.iasd = vsms.get_iasd_class(virt)(name=dom_name, > res_sub_type=irstype, > bus_type=btype) > diff -r 5c08aeea7fa1 -r 5d129fff3696 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py > --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Mon Aug 17 04:16:50 2009 -0700 > +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Aug 18 11:21:04 2009 -0700 > @@ -313,7 +313,8 @@ > if virt == "KVM": > return "qemu:///system" > if virt == "LXC": > - return "lxc:///system" > + #return "lxc:///system" > > same here - You probably forgot to remove the commented line. > + return "lxc:///" > return "" > > def run_remote_guest(ip, domain, command): > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Mon Aug 24 15:00:38 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Mon, 24 Aug 2009 12:00:38 -0300 Subject: [Libvirt-cim] [PATCH] Be sure to check to see if the UUID is in use in both the DefineSystem() In-Reply-To: <0243aa0574431112f094.1250813803@elm3b151.beaverton.ibm.com> References: <0243aa0574431112f094.1250813803@elm3b151.beaverton.ibm.com> Message-ID: <4A92AB16.2000309@linux.vnet.ibm.com> +1 On 08/20/2009 09:16 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1250813784 25200 > # Node ID 0243aa0574431112f0946354d4bbad62bb2c2f7b > # Parent 7efea1d379a1b4de6c4d7583b456a0a00f80ad3b > Be sure to check to see if the UUID is in use in both the DefineSystem()... > > and ModifySystemSettings() calls. > > Signed-off-by: Kaitlin Rupert > > diff -r 7efea1d379a1 -r 0243aa057443 src/Virt_VirtualSystemManagementService.c > --- a/src/Virt_VirtualSystemManagementService.c Wed Aug 19 22:47:17 2009 -0700 > +++ b/src/Virt_VirtualSystemManagementService.c Thu Aug 20 17:16:24 2009 -0700 > @@ -71,6 +71,37 @@ > RESOURCE_MOD, > }; > > +static CMPIStatus check_uuid_in_use(const CMPIObjectPath *ref, > + struct domain *domain) > +{ > + CMPIStatus s = {CMPI_RC_OK, NULL}; > + virConnectPtr conn = NULL; > + virDomainPtr dom = NULL; > + > + conn = connect_by_classname(_BROKER, CLASSNAME(ref),&s); > + if (conn == NULL) { > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_FAILED, > + "Error connecting to libvirt"); > + goto out; > + } > + > + dom = virDomainLookupByUUIDString(conn, domain->uuid); > + if (dom != NULL) { > + cu_statusf(_BROKER,&s, > + CMPI_RC_ERR_FAILED, > + "Guest '%s' is already defined with UUID %s", > + virDomainGetName(dom), > + domain->uuid); > + } > + > + out: > + virDomainFree(dom); > + virConnectClose(conn); > + > + return s; > +} > + > static CMPIStatus define_system_parse_args(const CMPIArgs *argsin, > CMPIInstance **sys, > const char *ns, > @@ -1402,26 +1433,10 @@ > goto out; > } > > - if (domain->uuid != NULL) { > - conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); > - if (conn == NULL) { > - cu_statusf(_BROKER, s, > - CMPI_RC_ERR_FAILED, > - "Error connecting to libvirt"); > - goto out; > - } > - > - dom = virDomainLookupByUUIDString(conn, domain->uuid); > - if (dom != NULL) { > - cu_statusf(_BROKER, s, > - CMPI_RC_ERR_FAILED, > - "Guest '%s' is already defined with UUID %s", > - virDomainGetName(dom), > - domain->uuid); > - goto out; > - } > - } > - > + *s = check_uuid_in_use(ref, domain); > + if (s->rc != CMPI_RC_OK) > + goto out; > + > msg = classify_resources(resources, NAMESPACE(ref), domain); > if (msg != NULL) { > CU_DEBUG("Failed to classify resources: %s", msg); > @@ -1644,6 +1659,10 @@ > goto out; > } > > + s = check_uuid_in_use(ref, dominfo); > + if (s.rc != CMPI_RC_OK) > + goto out; > + > xml = system_to_xml(dominfo); > if (xml != NULL) { > CU_DEBUG("New XML is:\n%s", xml); > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Aug 24 20:28:17 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 24 Aug 2009 13:28:17 -0700 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix LXC connection uri Message-ID: <57536e0647e4aa08a824.1251145697@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1251145693 25200 # Node ID 57536e0647e4aa08a824e34aeddfb204c6d84f4b # Parent c338efef06278a9a40a90f07a34750ec50c49939 [TEST] #2 Fix LXC connection uri... And be sure not to pass a graphics device when creating a Containers guest. These changes are dependent on libvirt-cim patch "Fix LXC connection uri, remove default graphics device" Updates: -Remove commented out lines of old code diff -r c338efef0627 -r 57536e0647e4 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Aug 19 09:03:40 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Aug 24 13:28:13 2009 -0700 @@ -151,7 +151,7 @@ elif vir_type == 'kvm': self.vuri = 'qemu:///system' elif vir_type == 'lxc': - self.vuri = 'lxc:///system' + self.vuri = 'lxc:///' def run(self, ip, vcmd, param): file_arg_cmds = ['define', 'create', 'net-create', 'pool-create'] @@ -572,17 +572,18 @@ self.pasd = vsms.get_pasd_class(virt)(name=dom_name) self.dasd = vsms.get_dasd_class(virt)(disk_dev, disk_source, dom_name) + self.gasd = None else: self.pasd = vsms.get_pasd_class(virt)(vcpu=vcpus, name=dom_name) self.dasd = vsms.get_dasd_class(virt)(disk_dev, disk_source, dom_name, emu_type) + self.gasd = vsms.get_gasd_class(virt)(name=dom_name, + res_sub_type=grstype, ip=ip, + lport=port_num, keymap=kmap, + vnc_passwd=vnc_passwd) self.masd = vsms.get_masd_class(virt)(megabytes=mem, mallocunits=mem_allocunits, name=dom_name) - self.gasd = vsms.get_gasd_class(virt)(name=dom_name, - res_sub_type=grstype, ip=ip, - lport=port_num, keymap=kmap, - vnc_passwd=vnc_passwd) self.iasd = vsms.get_iasd_class(virt)(name=dom_name, res_sub_type=irstype, bus_type=btype) diff -r c338efef0627 -r 57536e0647e4 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Wed Aug 19 09:03:40 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Mon Aug 24 13:28:13 2009 -0700 @@ -313,7 +313,7 @@ if virt == "KVM": return "qemu:///system" if virt == "LXC": - return "lxc:///system" + return "lxc:///" return "" def run_remote_guest(ip, domain, command): From kaitlin at linux.vnet.ibm.com Mon Aug 24 21:32:28 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 24 Aug 2009 14:32:28 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST] Adding new test RPCS/10_create_storagevolume.py In-Reply-To: <91a6bc7e18e997c0b3dc.1250848197@elm3b151.beaverton.ibm.com> References: <91a6bc7e18e997c0b3dc.1250848197@elm3b151.beaverton.ibm.com> Message-ID: <4A9306EC.5030006@linux.vnet.ibm.com> > +def verify_vol(server, virt, pool_name, exp_vol_path, found): > + vols = vol_list(server, virt, pool_name) > + if vols == None: > + raise Exception("Failed to get the volume information") > + > + for vol in vols.split('\n'): > + res_vol_name, res_vol_path = vol.split() > + if res_vol_name != vol_name and res_vol_path != exp_vol_path: > + continue > + else: > + found += 1 > + > + if found != 1: > + logger.error("Failed to get the vol information") You'll also want to verify that a template DiskRASD is created. > + > + return found > + > + > + at do_main(platform_sup) > +def main(): > + options = main.options > + server = options.ip > + virt = options.virt > + > + libvirt_version = virsh_version(server, virt) > + cim_rev, changeset = get_provider_version(virt, server) > + if libvirt_version < "0.4.1" and cim_rev < libvirt_rasd_storagepool_changes: > + logger.info("Storage Volume creation support is available with Libvirt" > + "version >= 0.4.1 and Libvirt-CIM rev '%s'", > + libvirt_rasd_storagepool_changes) > + return SKIP > + > + dp_cn = "DiskPool" > + exp_vol_path = "%s/%s" % (pool_attr['Path'], vol_name) > + > + # For now the test case support only the creation of dir type based > + # vol creation, we can extend dp_types to include netfs etc > + dp_types = { "DISK_POOL_DIR" : DIR_POOL } > + > + for pool_name, pool_type in dp_types.iteritems(): > + status = FAIL PoolXML > + res = [FAIL] > + found = 0 > + try: > + status = create_pool(server, virt, pool_name, pool_attr, > + mode_type=pool_type, pool_type="DiskPool") You shouldn't need to create a storage pool, since main.py sets up a default diskpool. That pool is a dir type pool for the /tmp directory. So you should be able to create your storage volume there. > + > + if status != PASS: > + logger.error("Failed to create pool '%s'", pool_name) > + return status > + > + dp_inst_id = "%s/%s" % (dp_cn, pool_name) > + stovol_settings = get_stovol_settings(server, virt, > + dp_inst_id, pool_name) > + if stovol_settings == None: > + raise Exception("Failed to get the defualt StorageVolRASD info") > + > + disk_pool_inst = get_diskpool(server, virt, dp_cn, dp_inst_id) > + if disk_pool_inst == None: > + raise Exception("DiskPool instance for '%s' not found!" \ > + % pool_name) > + > + rpcs = get_typed_class(virt, "ResourcePoolConfigurationService") > + rpcs_conn = eval("rpcs_service." + rpcs)(server) > + res = rpcs_conn.CreateResourceInPool(Settings=stovol_settings, > + Pool=disk_pool_inst) If this fails, no need to verify the vol. Raise an exception and fail the test. > + found = verify_vol(server, virt, pool_name, exp_vol_path, found) > + > + except Exception, details: > + logger.error("Exception details: %s", details) > + status = FAIL > + > + ret = cleanup_pool_vol(server, virt, pool_name, exp_vol_path) > + if res[0] == PASS and found == 1 and ret == PASS: > + status = PASS > + else: > + return FAIL > + > + return status > +if __name__ == "__main__": > + sys.exit(main()) -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Mon Aug 24 21:54:16 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 24 Aug 2009 14:54:16 -0700 Subject: [Libvirt-cim] [PATCH] Expose HealthState of LogicalDisk Message-ID: <5a1871168fd4d9b90664.1251150856@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1251150322 25200 # Node ID 5a1871168fd4d9b906646bc4b036a950bcc339df # Parent 0243aa0574431112f0946354d4bbad62bb2c2f7b Expose HealthState of LogicalDisk Signed-off-by: Kaitlin Rupert diff -r 0243aa057443 -r 5a1871168fd4 src/Virt_Device.c --- a/src/Virt_Device.c Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_Device.c Mon Aug 24 14:45:22 2009 -0700 @@ -127,6 +127,7 @@ { CMPIInstance *inst; virConnectPtr conn; + uint16_t state; conn = virDomainGetConnect(dom); inst = get_typed_instance(broker, @@ -137,6 +138,10 @@ if (!disk_set_name(inst, dev)) return NULL; + //Set HealthState to "OK" + state = 5; + CMSetProperty(inst, "HealthState", (CMPIValue *)&state, CMPI_uint16); + return inst; } From deeptik at linux.vnet.ibm.com Tue Aug 25 10:28:47 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Tue, 25 Aug 2009 15:58:47 +0530 Subject: [Libvirt-cim] [PATCH] [TEST] #2 Fix LXC connection uri In-Reply-To: <57536e0647e4aa08a824.1251145697@elm3b151.beaverton.ibm.com> References: <57536e0647e4aa08a824.1251145697@elm3b151.beaverton.ibm.com> Message-ID: <4A93BCDF.5090807@linux.vnet.ibm.com> +1 -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Tue Aug 25 15:47:57 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 25 Aug 2009 08:47:57 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Expose Path attribute in DiskPool instances Message-ID: The first two patches are some minor tweaks and reshuffling of code in order to prevent name collisions and redundant code across providers. From kaitlin at linux.vnet.ibm.com Tue Aug 25 15:47:59 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 25 Aug 2009 08:47:59 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] Move get_disk_pool() to Virt_DevicePool.h from SDC In-Reply-To: References: Message-ID: <5253dd03a6588d6856aa.1251215279@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1251215156 25200 # Node ID 5253dd03a6588d6856aa30fdbb385c3325d0fed1 # Parent cb562e877b51e5a5811080f47c657ec64b9b7918 Move get_disk_pool() to Virt_DevicePool.h from SDC Also, fix the #ifndef in pool_parsing.h - otherwise, there are redeclaration conflicts during build. Signed-off-by: Kaitlin Rupert diff -r cb562e877b51 -r 5253dd03a658 libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Mon Aug 24 16:14:41 2009 -0700 +++ b/libxkutil/pool_parsing.h Tue Aug 25 08:45:56 2009 -0700 @@ -18,7 +18,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __RES_POOLS_H_ +#ifndef __RES_POOLS_H #define __RES_POOLS_H #include diff -r cb562e877b51 -r 5253dd03a658 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Aug 24 16:14:41 2009 -0700 +++ b/src/Virt_DevicePool.c Tue Aug 25 08:45:56 2009 -0700 @@ -92,6 +92,26 @@ #if VIR_USE_LIBVIRT_STORAGE +int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) +{ + char *xml; + int ret; + + xml = virStoragePoolGetXMLDesc(poolptr, 0); + if (xml == NULL) + return 0; + + *pool = malloc(sizeof(**pool)); + if (*pool == NULL) + return 0; + + ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); + + free(xml); + + return ret; +} + static int get_diskpool_config(virConnectPtr conn, struct tmp_disk_pool **_pools) { diff -r cb562e877b51 -r 5253dd03a658 src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Mon Aug 24 16:14:41 2009 -0700 +++ b/src/Virt_DevicePool.h Tue Aug 25 08:45:56 2009 -0700 @@ -26,6 +26,8 @@ #include #include +#include "pool_parsing.h" + /** * Get the InstanceID of a pool that a given RASD id (for type) is in * @@ -133,6 +135,15 @@ uint16_t type, CMPIStatus *status); +/** + * Get the configuration settings of a given storage pool + * + * @param poolptr A pointer to the given storage pool + * @param pool A struct to hold the configuration settings of the storage pool + * @returns An int that indicates whether the function was successful + */ +int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool); + #endif /* diff -r cb562e877b51 -r 5253dd03a658 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Aug 24 16:14:41 2009 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Aug 25 08:45:56 2009 -0700 @@ -1027,26 +1027,6 @@ } #if VIR_USE_LIBVIRT_STORAGE -static int get_disk_pool(virStoragePoolPtr poolptr, struct virt_pool **pool) -{ - char *xml; - int ret; - - xml = virStoragePoolGetXMLDesc(poolptr, 0); - if (xml == NULL) - return 0; - - *pool = malloc(sizeof(**pool)); - if (*pool == NULL) - return 0; - - ret = get_pool_from_xml(xml, *pool, CIM_RES_TYPE_DISK); - - free(xml); - - return ret; -} - static CMPIStatus new_volume_template(const CMPIObjectPath *ref, int template_type, virStoragePoolPtr poolptr, From kaitlin at linux.vnet.ibm.com Tue Aug 25 15:47:58 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 25 Aug 2009 08:47:58 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Rename disk_pool struct in Virt_DevicePool to tmp_disk_pool In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1251155681 25200 # Node ID cb562e877b51e5a5811080f47c657ec64b9b7918 # Parent 5a1871168fd4d9b906646bc4b036a950bcc339df Rename disk_pool struct in Virt_DevicePool to tmp_disk_pool This is an internal struct - make this name more unique so it doesn't collide with the struct in pool_parsing.h Signed-off-by: Kaitlin Rupert diff -r 5a1871168fd4 -r cb562e877b51 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Aug 24 14:45:22 2009 -0700 +++ b/src/Virt_DevicePool.c Mon Aug 24 16:14:41 2009 -0700 @@ -45,7 +45,7 @@ static const CMPIBroker *_BROKER; -struct disk_pool { +struct tmp_disk_pool { char *tag; char *path; bool primordial; @@ -61,10 +61,10 @@ # define VIR_USE_LIBVIRT_STORAGE 0 #endif -static bool get_disk_parent(struct disk_pool **_pools, +static bool get_disk_parent(struct tmp_disk_pool **_pools, int *_count) { - struct disk_pool *pools = NULL; + struct tmp_disk_pool *pools = NULL; int ret = false; int count; @@ -93,12 +93,12 @@ #if VIR_USE_LIBVIRT_STORAGE static int get_diskpool_config(virConnectPtr conn, - struct disk_pool **_pools) + struct tmp_disk_pool **_pools) { int count = 0; int i; char ** names = NULL; - struct disk_pool *pools = NULL; + struct tmp_disk_pool *pools = NULL; count = virConnectNumOfStoragePools(conn); if (count <= 0) @@ -139,7 +139,7 @@ static bool diskpool_set_capacity(virConnectPtr conn, CMPIInstance *inst, - struct disk_pool *_pool) + struct tmp_disk_pool *_pool) { bool result = false; virStoragePoolPtr pool; @@ -175,7 +175,7 @@ } static bool _diskpool_is_member(virConnectPtr conn, - const struct disk_pool *pool, + const struct tmp_disk_pool *pool, const char *file) { virStorageVolPtr vol = NULL; @@ -206,7 +206,7 @@ return result; } #else -static int parse_diskpool_line(struct disk_pool *pool, +static int parse_diskpool_line(struct tmp_disk_pool *pool, const char *line) { int ret; @@ -222,14 +222,14 @@ } static int get_diskpool_config(virConnectPtr conn, - struct disk_pool **_pools) + struct tmp_disk_pool **_pools) { const char *path = DISK_POOL_CONFIG; FILE *config; char *line = NULL; size_t len = 0; int count = 0; - struct disk_pool *pools = NULL; + struct tmp_disk_pool *pools = NULL; config = fopen(path, "r"); if (config == NULL) { @@ -261,7 +261,7 @@ static bool diskpool_set_capacity(virConnectPtr conn, CMPIInstance *inst, - struct disk_pool *pool) + struct tmp_disk_pool *pool) { bool result = false; struct statvfs vfs; @@ -298,7 +298,7 @@ } #endif -static void free_diskpool(struct disk_pool *pools, int count) +static void free_diskpool(struct tmp_disk_pool *pools, int count) { int i; @@ -316,7 +316,7 @@ static char *_diskpool_member_of(virConnectPtr conn, const char *file) { - struct disk_pool *pools = NULL; + struct tmp_disk_pool *pools = NULL; int count; int i; char *pool = NULL; @@ -910,7 +910,7 @@ return s; } -static CMPIInstance *diskpool_from_path(struct disk_pool *pool, +static CMPIInstance *diskpool_from_path(struct tmp_disk_pool *pool, virConnectPtr conn, const char *ns, const char *refcn, @@ -947,7 +947,7 @@ const CMPIBroker *broker) { CMPIStatus s = {CMPI_RC_OK, NULL}; - struct disk_pool *pools = NULL; + struct tmp_disk_pool *pools = NULL; int count = 0; int i; From kaitlin at linux.vnet.ibm.com Tue Aug 25 15:48:00 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 25 Aug 2009 08:48:00 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Expose Path attribute for DiskPools In-Reply-To: References: Message-ID: <9af5eef7ea76c7e9d165.1251215280@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1251155681 25200 # Node ID 9af5eef7ea76c7e9d1657d2e8cd4df9ed126b596 # Parent 5253dd03a6588d6856aa30fdbb385c3325d0fed1 Expose Path attribute for DiskPools Signed-off-by: Kaitlin Rupert diff -r 5253dd03a658 -r 9af5eef7ea76 schema/DiskPool.mof --- a/schema/DiskPool.mof Tue Aug 25 08:45:56 2009 -0700 +++ b/schema/DiskPool.mof Mon Aug 24 16:14:41 2009 -0700 @@ -3,15 +3,24 @@ [Provider("cmpi::Virt_DevicePool")] class Xen_DiskPool : CIM_ResourcePool { + [Description("Path this storage pool represents")] + string Path; + }; [Provider("cmpi::Virt_DevicePool")] class KVM_DiskPool : CIM_ResourcePool { + [Description("Path this storage pool represents")] + string Path; + }; [Provider("cmpi::Virt_DevicePool")] class LXC_DiskPool : CIM_ResourcePool { + [Description("Path this storage pool represents")] + string Path; + }; diff -r 5253dd03a658 -r 9af5eef7ea76 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Tue Aug 25 08:45:56 2009 -0700 +++ b/src/Virt_DevicePool.c Mon Aug 24 16:14:41 2009 -0700 @@ -166,6 +166,8 @@ virStoragePoolInfo info; uint64_t cap; uint64_t res; + struct virt_pool *pool_vals = NULL; + const char *pool_str = NULL; pool = virStoragePoolLookupByName(conn, _pool->tag); if (pool == NULL) { @@ -187,9 +189,21 @@ CMSetProperty(inst, "Reserved", (CMPIValue *)&res, CMPI_uint64); + if (get_disk_pool(pool, &pool_vals) != 0) { + CU_DEBUG("Error getting pool path for: %s", _pool->tag); + } else { + if (pool_vals->pool_info.disk.path != NULL) { + pool_str = strdup(pool_vals->pool_info.disk.path); + + CMSetProperty(inst, "Path", + (CMPIValue *)pool_str, CMPI_chars); + } + } + result = true; out: virStoragePoolFree(pool); + cleanup_virt_pool(&pool_vals); return result; } @@ -305,6 +319,9 @@ CMSetProperty(inst, "Reserved", (CMPIValue *)&res, CMPI_uint64); + CMSetProperty(inst, "Path", + (CMPIValue *)pool->path, CMPI_chars); + result = true; out: return result; From anantyog at linux.vnet.ibm.com Wed Aug 26 09:57:41 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Wed, 26 Aug 2009 02:57:41 -0700 Subject: [Libvirt-cim] [PATCH] [Test](#4)Testcase to check for duplicate UUID Message-ID: <311bad73905dfdb1299b.1251280661@elm3b151.beaverton.ibm.com> # HG changeset patch # User anantyog at linux.vnet.ibm.com # Date 1251280598 25200 # Node ID 311bad73905dfdb1299bb0eab902a54b332fc094 # Parent 3c09a49a30f4bc1e6544736612508d3f99308083 [Test](#4)Testcase to check for duplicate UUID Hello everyone, I have rewirtten the testcase to handle provider version less then 915. For provider version less then 915, the testcase just exits and rewrote the exception handling to handle exceptions of variable length. Thx Yogi diff -r 3c09a49a30f4 -r 311bad73905d suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py Wed Aug 26 02:56:38 2009 -0700 @@ -0,0 +1,127 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth Subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +#Steps: +#1) Define 2 domains,'default' and 'test', both with random UUID +#2) Reset the uuid of the second domain, 'test', to the uuid of the +# first domain, using ModifySystemSettings +# + +import sys +import time +from XenKvmLib import vsms +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import PASS, FAIL, SKIP +from XenKvmLib.const import do_main +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.enumclass import GetInstance +from XenKvmLib.const import get_provider_version + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'uuid_domain' +test_dom = 'test_domain' +nmac = '99:aa:bb:cc:ee:ff' +duplicate_uuid_support = 915 +err_desc = "'uuid_domain' is already defined" + +def get_vssd(ip, virt, dom): + cn = get_typed_class(virt, "VirtualSystemSettingData") + inst = None + + try: + if virt == "XenFV": + virt = "Xen" + + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } + + inst = GetInstance(ip, cn, key_list, True) + + except Exception, details: + logger.error(details) + return FAIL, inst + + if inst is None: + return FAIL, inst + + return PASS, inst + + at do_main(sup_types) +def main(): + options = main.options + virt = options.virt + server = options.ip + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev < duplicate_uuid_support: + logger.info("Need provider version 915 or greater to run testcase") + return SKIP + + service = vsms.get_vsms_class(options.virt)(options.ip) + + sxml = None + cxml = vxml.get_class(options.virt)(default_dom) + ret = cxml.cim_define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + + try: + status, inst = get_vssd(options.ip, options.virt, default_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s" % + default_dom) + + uuid_defaultdom = inst['UUID'] + + sxml = vxml.get_class(options.virt)(test_dom, mac=nmac) + ret = sxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s" % test_dom) + + status, inst = get_vssd(options.ip, options.virt, test_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s" % + test_dom) + + inst['UUID'] = uuid_defaultdom + vssd = inst_to_mof(inst) + ret = service.ModifySystemSettings(SystemSettings=vssd) + if ret[0] == 0: + raise Exception("Was able to assign duplicate UUID to domain %s" + % test_dom) + + except Exception, details: + if details[-1].find(err_desc) >= 0: + logger.info('Got expected error desc %s', details[-1]) + status = PASS + else: + logger.error(details) + status = FAIL + + if sxml != None: + sxml.undefine(options.ip) + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Wed Aug 26 11:04:46 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Wed, 26 Aug 2009 16:34:46 +0530 Subject: [Libvirt-cim] [PATCH] [Test](#4)Testcase to check for duplicate UUID In-Reply-To: <311bad73905dfdb1299b.1251280661@elm3b151.beaverton.ibm.com> References: <311bad73905dfdb1299b.1251280661@elm3b151.beaverton.ibm.com> Message-ID: <4A9516CE.5000602@linux.vnet.ibm.com> Sorry for making you rework so much..I think I have very minor comments here.. Yogananth Subramanian wrote: > # HG changeset patch > # User anantyog at linux.vnet.ibm.com > # Date 1251280598 25200 > # Node ID 311bad73905dfdb1299bb0eab902a54b332fc094 > # Parent 3c09a49a30f4bc1e6544736612508d3f99308083 > [Test](#4)Testcase to check for duplicate UUID > Hello everyone, > I have rewirtten the testcase to handle provider version less then 915. > For provider version less then 915, the testcase just exits and rewrote the > exception handling to handle exceptions of variable length. > > Thx > Yogi > > diff -r 3c09a49a30f4 -r 311bad73905d suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py Wed Aug 26 02:56:38 2009 -0700 > @@ -0,0 +1,127 @@ > +#!/usr/bin/python > +# > +# Copyright 2009 IBM Corp. > +# > +# Authors: > +# Yogananth Subramanian > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU 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 > +# General Public License for more details. > +# > +# You should have received a copy of the GNU 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 > +# > +#Steps: > +#1) Define 2 domains,'default' and 'test', both with random UUID > +#2) Reset the uuid of the second domain, 'test', to the uuid of the > +# first domain, using ModifySystemSettings > +# > + > +import sys > +import time > +from XenKvmLib import vsms > +from XenKvmLib import vxml > +from CimTest.Globals import logger > +from CimTest.ReturnCodes import PASS, FAIL, SKIP > +from XenKvmLib.const import do_main > +from XenKvmLib.classes import get_typed_class, inst_to_mof > +from XenKvmLib.enumclass import GetInstance > +from XenKvmLib.const import get_provider_version > + > +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] > +default_dom = 'uuid_domain' > +test_dom = 'test_domain' > +nmac = '99:aa:bb:cc:ee:ff' > +duplicate_uuid_support = 915 > +err_desc = "'uuid_domain' is already defined" > + > +def get_vssd(ip, virt, dom): > + cn = get_typed_class(virt, "VirtualSystemSettingData") > + inst = None > + > + try: > + if virt == "XenFV": > + virt = "Xen" > + > + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } > + > + inst = GetInstance(ip, cn, key_list, True) > + > + except Exception, details: > + logger.error(details) > + return FAIL, inst > + > + if inst is None: > + return FAIL, inst > + > + return PASS, inst > + > + at do_main(sup_types) > +def main(): > + options = main.options > + virt = options.virt > + server = options.ip > + > + curr_cim_rev, changeset = get_provider_version(virt, server) > + if curr_cim_rev < duplicate_uuid_support: > + logger.info("Need provider version 915 or greater to run testcase") > Instead of hardcoding 915 in the error message can you pass duplicate_uuid_support instead. > + return SKIP > + > + service = vsms.get_vsms_class(options.virt)(options.ip) > + > + sxml = None > + cxml = vxml.get_class(options.virt)(default_dom) > + ret = cxml.cim_define(options.ip) > + if not ret: > + logger.error("Failed to define the dom: %s", default_dom) > + return FAIL > + > + try: > + status, inst = get_vssd(options.ip, options.virt, default_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s" % > + default_dom) > + > + uuid_defaultdom = inst['UUID'] > + > + sxml = vxml.get_class(options.virt)(test_dom, mac=nmac) > + ret = sxml.cim_define(options.ip) > + if not ret: > + raise Exception("Failed to define the dom: %s" % test_dom) > + > + status, inst = get_vssd(options.ip, options.virt, test_dom) > + if status != PASS: > + raise Exception("Failed to get the VSSD instance for %s" % > + test_dom) > + > + inst['UUID'] = uuid_defaultdom > + vssd = inst_to_mof(inst) > + ret = service.ModifySystemSettings(SystemSettings=vssd) > + if ret[0] == 0: > + raise Exception("Was able to assign duplicate UUID to domain %s" > + % test_dom) > + > + except Exception, details: > + if details[-1].find(err_desc) >= 0: > + logger.info('Got expected error desc %s', details[-1]) > + status = PASS > + else: > + logger.error(details) > + status = FAIL > The else part has 5 spaces instead of 4. Can you change the exception block to something like the one below after importing from pywbem import CIMError: except CIMError, (err_no, err_desc): if err_desc.find("'uuid_domain' is already defined") >= 0: logger.info('Got expected error desc') status = PASS except Exception, details: logger.error("Exception %s", details) status = FAIL > + > + if sxml != None: > + sxml.undefine(options.ip) > + cxml.undefine(options.ip) > + return status > + > +if __name__ == "__main__": > + sys.exit(main()) > + > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Wed Aug 26 11:56:38 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 26 Aug 2009 04:56:38 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Adding vol_list to xm_virt_util.py In-Reply-To: References: Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1251275502 25200 # Node ID bd5411ebb634f6cf0945aa4e2f6896eb4221c03f # Parent 3c09a49a30f4bc1e6544736612508d3f99308083 [TEST] Adding vol_list to xm_virt_util.py. Tested with KVM on F11 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 3c09a49a30f4 -r bd5411ebb634 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Mon Aug 24 13:28:13 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Wed Aug 26 01:31:42 2009 -0700 @@ -237,6 +237,17 @@ return names +def vol_list(server, virt="KVM", pool_name=None): + """ Function to list the volumes part of a pool""" + + cmd = " virsh -c %s vol-list %s | sed -e '1,2 d' -e '$ d'" \ + % (virt2uri(virt), pool_name) + ret, out = utils.run_remote(server, cmd) + if ret != 0: + return None + + return out + def virsh_vcpuinfo(server, dom, virt="Xen"): cmd = "virsh -c %s vcpuinfo %s | grep VCPU | wc -l" % (virt2uri(virt), dom) From deeptik at linux.vnet.ibm.com Wed Aug 26 11:56:39 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 26 Aug 2009 04:56:39 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST]#2 Adding new test RPCS/10_create_storagevolume.py In-Reply-To: References: Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1251287772 25200 # Node ID bf818c99aad9657162daf8f1b295fe674dd41a7a # Parent bd5411ebb634f6cf0945aa4e2f6896eb4221c03f [TEST]#2 Adding new test RPCS/10_create_storagevolume.py Patch 2: -------- 1) Added code to verify the StoVol template RASD. 2) Seperated the SDC query into a function. 3) Used the default_disk_pool for DIR type pools This test verifies the creation of StorageVol in the dir pool. Tested with KVM on F11 with current sources. Signed-off-by: Deepti B. Kalakeri From deeptik at linux.vnet.ibm.com Wed Aug 26 11:56:37 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 26 Aug 2009 04:56:37 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] #2 Adding new test RPCS/10_create_storagevolume.py Message-ID: From rmaciel at linux.vnet.ibm.com Wed Aug 26 19:45:17 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 26 Aug 2009 16:45:17 -0300 Subject: [Libvirt-cim] [PATCH 0 of 2] ComputerSystemDeletedIndication is called with all fields properly filled Message-ID: Another patch will follow to minimize the amount of duplicated code in ComputerSystem.c From rmaciel at linux.vnet.ibm.com Wed Aug 26 19:45:18 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 26 Aug 2009 16:45:18 -0300 Subject: [Libvirt-cim] [PATCH 1 of 2] ComputerSystemDeletedIndication wasn't being called when a guest was removed. This patch fix it In-Reply-To: References: Message-ID: # HG changeset patch # User Richard Maciel # Date 1251315606 10800 # Node ID ed7ae95312fc4ce955aefdac8f606043a5da25a8 # Parent 7a5403380789571fca9496003461c45f23e18c2f ComputerSystemDeletedIndication wasn't being called when a guest was removed. This patch fix it. Added and exported a function from ComputerSystem, so the indication can create an instance of the guest based on the domain structure stored. Signed-off-by: Richard Maciel diff -r 7a5403380789 -r ed7ae95312fc src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystem.c Wed Aug 26 16:40:06 2009 -0300 @@ -439,6 +439,92 @@ return 1; } +static CMPIStatus set_properties_from_dominfo(const CMPIBroker *broker, + const char *prefix, + struct domain *dominfo, + CMPIInstance *instance) +{ + CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL}; + CMPIObjectPath *ref = NULL; + + ref = CMGetObjectPath(instance, &s); + if ((ref == NULL) || (s.rc != CMPI_RC_OK)) + return s; + + CMSetProperty(instance, "Name", + (CMPIValue *)dominfo->name, CMPI_chars); + + CMSetProperty(instance, "ElementName", + (CMPIValue *)dominfo->name, CMPI_chars); + + CMSetProperty(instance, "UUID", + (CMPIValue *)dominfo->uuid, CMPI_chars); + + if (!set_capdesc_from_dominfo(broker, dominfo, ref, instance)) { + CU_DEBUG("Problem in set_capdesc_from_dominfo function"); + goto out; + } + + /* We don't set state, because struct domain doesn't have that + * information */ + + if (!set_creation_class(instance)) { + CU_DEBUG("Problem in set_creation_class function"); + goto out; + } + + if (!set_other_id_info(broker, dominfo->uuid, prefix, instance)) { + CU_DEBUG("Problem in set_other_id_info function"); + goto out; + } + + cu_statusf(broker, &s, + CMPI_RC_OK, + ""); + + out: + return s; +} + +CMPIStatus instance_from_dominfo(const CMPIBroker *broker, + const char *namespace, + const char *prefix, + struct domain *dominfo, + CMPIInstance **_inst) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst = NULL; + + inst = get_typed_instance(broker, + prefix, + "ComputerSystem", + namespace); + + if (inst == NULL) { + CU_DEBUG("Could not init CS instance. " + "typestr: %s, namespace: %s", prefix, namespace); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to init ComputerSystem instance"); + goto out; + } + + s = set_properties_from_dominfo(broker, + prefix, + dominfo, + inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Could not set instance properties"); + goto out; + } + + *_inst = inst; + + out: + return s; + +} + /* Populate an instance with information from a domain */ static CMPIStatus set_properties(const CMPIBroker *broker, virDomainPtr dom, diff -r 7a5403380789 -r ed7ae95312fc src/Virt_ComputerSystem.h --- a/src/Virt_ComputerSystem.h Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystem.h Wed Aug 26 16:40:06 2009 -0300 @@ -22,6 +22,7 @@ #define __VIRT_COMPUTERSYSTEM_H #include "misc_util.h" +#include "device_parsing.h" /** * Get a list of domain instances @@ -62,6 +63,25 @@ const char *name, CMPIInstance **_inst); +/** + * Create a domain instance from the domain structure. Note that the instance + * doesn't necessarily represents an existing domain (can represent a deleted + * one, for instance) + * + * @param broker A pointer to the current broker + * @param namespace The namespace to used by the domain instance + * @param prefix The virtualization prefix (i.e. KVM, Xen, LXC) + * @param dominfo A pointer to the struct domain used to fill the instance + * @param _inst In case of success the pointer to the instance + * @returns CMPIStatus + */ +CMPIStatus instance_from_dominfo(const CMPIBroker *broker, + const char *namespace, + const char *prefix, + struct domain *dominfo, + CMPIInstance **_inst); + + #endif /* diff -r 7a5403380789 -r ed7ae95312fc src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystemIndication.c Wed Aug 26 16:40:06 2009 -0300 @@ -330,6 +330,41 @@ return false; } +static bool create_deleted_guest_inst(char *xml, + char *namespace, + char *prefix, + CMPIInstance **inst) +{ + bool rc = false; + struct domain *dominfo = NULL; + int res; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + res = get_dominfo_from_xml(xml, &dominfo); + if (res == 0) { + CU_DEBUG("failed to extract domain info from xml"); + goto out; + } + + s = instance_from_dominfo(_BROKER, + namespace, + prefix, + dominfo, + inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("instance from domain info error: %s", s.msg); + goto out; + } + /* Must set guest state */ + + rc = true; + + out: + cleanup_dominfo(&dominfo); + + return rc; +} + static bool async_ind(CMPIContext *context, virConnectPtr conn, int ind_type, @@ -360,12 +395,27 @@ cn = get_typed_class(prefix, "ComputerSystem"); op = CMNewObjectPath(_BROKER, args->ns, cn, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) + if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { + CU_DEBUG("op error"); goto out; + } - s = get_domain_by_name(_BROKER, op, name, &affected_inst); - if (s.rc != CMPI_RC_OK) - goto out; + if (ind_type == CS_CREATED || ind_type == CS_MODIFIED) { + s = get_domain_by_name(_BROKER, op, name, &affected_inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("domain by name error"); + goto out; + } + } else if (ind_type == CS_DELETED) { + rc = create_deleted_guest_inst(prev_dom.xml, + args->ns, + prefix, + &affected_inst); + if (!rc) { + CU_DEBUG("Could not recreate guest instance"); + goto out; + } + } /* FIXME: We are unable to get the previous CS instance after it has been modified. Consider keeping track of the previous From rmaciel at linux.vnet.ibm.com Wed Aug 26 19:45:19 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 26 Aug 2009 16:45:19 -0300 Subject: [Libvirt-cim] [PATCH 2 of 2] Adds state information to the instance created in ComputerSystemDeletedIndication In-Reply-To: References: Message-ID: # HG changeset patch # User Richard Maciel # Date 1251315618 10800 # Node ID aceaaadd58fa0e0e03f6f41c9907b1c068ac6bd1 # Parent ed7ae95312fc4ce955aefdac8f606043a5da25a8 Adds state information to the instance created in ComputerSystemDeletedIndication Had to export the state enumerations in ComputerSystem.c to use in the indication code Signed-off-by: Richard Maciel diff -r ed7ae95312fc -r aceaaadd58fa src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Wed Aug 26 16:40:06 2009 -0300 +++ b/src/Virt_ComputerSystem.c Wed Aug 26 16:40:18 2009 -0300 @@ -47,18 +47,6 @@ const static CMPIBroker *_BROKER; -enum CIM_state { - CIM_STATE_UNKNOWN = 0, - CIM_STATE_ENABLED = 2, - CIM_STATE_DISABLED = 3, - CIM_STATE_SHUTDOWN = 4, - CIM_STATE_NOCHANGE = 5, - CIM_STATE_SUSPENDED = 6, - CIM_STATE_PAUSED = 9, - CIM_STATE_REBOOT = 10, - CIM_STATE_RESET = 11, -}; - /* Set the "Name" property of an instance from a domain */ static int set_name_from_dom(virDomainPtr dom, CMPIInstance *instance) { @@ -159,15 +147,6 @@ static uint16_t state_lv_to_cim_health(const char lv_state) { - enum CIM_health_state { - CIM_HEALTH_UNKNOWN = 0, - CIM_HEALTH_OK = 5, - CIM_HEALTH_MINOR_FAILURE = 15, - CIM_HEALTH_MAJOR_FAILURE = 20, - CIM_HEALTH_CRITICAL_FAILURE = 25, - CIM_HEALTH_NON_RECOVERABLE = 30, - }; - switch (lv_state) { case VIR_DOMAIN_NOSTATE: case VIR_DOMAIN_SHUTDOWN: @@ -189,28 +168,6 @@ static uint16_t state_lv_to_cim_oings(const char lv_state, const bool migrating) { - enum CIM_oping_status { - CIM_OPING_STATUS_UNKNOWN = 0, - CIM_OPING_STATUS_NOT_AVAILABLE = 1, - CIM_OPING_STATUS_SERVICING = 2, - CIM_OPING_STATUS_STARTING = 3, - CIM_OPING_STATUS_STOPPING = 4, - CIM_OPING_STATUS_STOPPED = 5, - CIM_OPING_STATUS_ABORTED = 6, - CIM_OPING_STATUS_DORMANT = 7, - CIM_OPING_STATUS_COMPLETED = 8, - CIM_OPING_STATUS_MIGRATING = 9, - CIM_OPING_STATUS_EMIGRATING = 10, - CIM_OPING_STATUS_IMMIGRATING = 11, - CIM_OPING_STATUS_SNAPSHOTTING = 12, - CIM_OPING_STATUS_SHUTTING_DOWN = 13, - CIM_OPING_STATUS_IN_TEST = 14, - CIM_OPING_STATUS_TRANSITIONING = 15, - CIM_OPING_STATUS_IN_SERVICE = 16, - CIM_OPING_STATUS_STARTED = 32768, - }; - - if (migrating) return CIM_OPING_STATUS_MIGRATING; @@ -237,27 +194,6 @@ static uint16_t state_lv_to_cim_os(const char lv_state) { - enum CIM_op_status { - CIM_OP_STATUS_UNKNOWN = 0, - CIM_OP_STATUS_OTHER = 1, - CIM_OP_STATUS_OK = 2, - CIM_OP_STATUS_DEGRADED = 3, - CIM_OP_STATUS_STRESSED = 4, - CIM_OP_STATUS_PREDICTIVE_FAILURE = 5, - CIM_OP_STATUS_ERROR = 6, - CIM_OP_STATUS_NON_RECOVERABLE = 7, - CIM_OP_STATUS_STARTING = 8, - CIM_OP_STATUS_STOPPING = 9, - CIM_OP_STATUS_STOPPED = 10, - CIM_OP_STATUS_IN_SERVICE = 11, - CIM_OP_STATUS_NO_CONTACT = 12, - CIM_OP_STATUS_LOST_COMMS = 13, - CIM_OP_STATUS_ABORTED = 14, - CIM_OP_STATUS_DORMANT = 15, - CIM_OP_STATUS_COMPLETED = 17, - CIM_OP_STATUS_POWER_MODE = 18, - }; - switch (lv_state) { case VIR_DOMAIN_NOSTATE: case VIR_DOMAIN_SHUTDOWN: diff -r ed7ae95312fc -r aceaaadd58fa src/Virt_ComputerSystem.h --- a/src/Virt_ComputerSystem.h Wed Aug 26 16:40:06 2009 -0300 +++ b/src/Virt_ComputerSystem.h Wed Aug 26 16:40:18 2009 -0300 @@ -24,6 +24,70 @@ #include "misc_util.h" #include "device_parsing.h" +enum CIM_state { + CIM_STATE_UNKNOWN = 0, + CIM_STATE_OTHER = 1, + CIM_STATE_ENABLED = 2, + CIM_STATE_DISABLED = 3, + CIM_STATE_SHUTDOWN = 4, + CIM_STATE_NOCHANGE = 5, + CIM_STATE_SUSPENDED = 6, + CIM_STATE_PAUSED = 9, + CIM_STATE_REBOOT = 10, + CIM_STATE_RESET = 11, +}; + +enum CIM_health_state { + CIM_HEALTH_UNKNOWN = 0, + CIM_HEALTH_OK = 5, + CIM_HEALTH_MINOR_FAILURE = 15, + CIM_HEALTH_MAJOR_FAILURE = 20, + CIM_HEALTH_CRITICAL_FAILURE = 25, + CIM_HEALTH_NON_RECOVERABLE = 30, +}; + +enum CIM_oping_status { + CIM_OPING_STATUS_UNKNOWN = 0, + CIM_OPING_STATUS_NOT_AVAILABLE = 1, + CIM_OPING_STATUS_SERVICING = 2, + CIM_OPING_STATUS_STARTING = 3, + CIM_OPING_STATUS_STOPPING = 4, + CIM_OPING_STATUS_STOPPED = 5, + CIM_OPING_STATUS_ABORTED = 6, + CIM_OPING_STATUS_DORMANT = 7, + CIM_OPING_STATUS_COMPLETED = 8, + CIM_OPING_STATUS_MIGRATING = 9, + CIM_OPING_STATUS_EMIGRATING = 10, + CIM_OPING_STATUS_IMMIGRATING = 11, + CIM_OPING_STATUS_SNAPSHOTTING = 12, + CIM_OPING_STATUS_SHUTTING_DOWN = 13, + CIM_OPING_STATUS_IN_TEST = 14, + CIM_OPING_STATUS_TRANSITIONING = 15, + CIM_OPING_STATUS_IN_SERVICE = 16, + CIM_OPING_STATUS_STARTED = 32768, +}; + +enum CIM_op_status { + CIM_OP_STATUS_UNKNOWN = 0, + CIM_OP_STATUS_OTHER = 1, + CIM_OP_STATUS_OK = 2, + CIM_OP_STATUS_DEGRADED = 3, + CIM_OP_STATUS_STRESSED = 4, + CIM_OP_STATUS_PREDICTIVE_FAILURE = 5, + CIM_OP_STATUS_ERROR = 6, + CIM_OP_STATUS_NON_RECOVERABLE = 7, + CIM_OP_STATUS_STARTING = 8, + CIM_OP_STATUS_STOPPING = 9, + CIM_OP_STATUS_STOPPED = 10, + CIM_OP_STATUS_IN_SERVICE = 11, + CIM_OP_STATUS_NO_CONTACT = 12, + CIM_OP_STATUS_LOST_COMMS = 13, + CIM_OP_STATUS_ABORTED = 14, + CIM_OP_STATUS_DORMANT = 15, + CIM_OP_STATUS_COMPLETED = 17, + CIM_OP_STATUS_POWER_MODE = 18, +}; + /** * Get a list of domain instances * diff -r ed7ae95312fc -r aceaaadd58fa src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Wed Aug 26 16:40:06 2009 -0300 +++ b/src/Virt_ComputerSystemIndication.c Wed Aug 26 16:40:18 2009 -0300 @@ -330,6 +330,51 @@ return false; } +static bool set_instance_state(CMPIInstance *instance) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIUint16 cim_state; + CMPIString *cim_state_other = NULL; + CMPIUint16 health_state; + CMPIUint16 req_state; + CMPIUint16 oping_status; + CMPIUint16 op_status; + CMPIArray *array; + + cim_state = CIM_STATE_OTHER; + cim_state_other = CMNewString(_BROKER, "Guest removed", &s); + CMSetProperty(instance, "EnabledState", + (CMPIValue *)&cim_state, CMPI_uint16); + CMSetProperty(instance, "OtherEnabledState", + (CMPIValue *)&cim_state_other, CMPI_string); + + health_state = CIM_HEALTH_UNKNOWN; + CMSetProperty(instance, "HealthState", + (CMPIValue *)&health_state, CMPI_uint16); + + array = CMNewArray(_BROKER, 2, CMPI_uint16, &s); + if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) + return false; + + op_status = CIM_OP_STATUS_COMPLETED; + CMSetArrayElementAt(array, 0, &op_status, CMPI_uint16); + op_status = CIM_OP_STATUS_OK; + CMSetArrayElementAt(array, 1, &op_status, CMPI_uint16); + + CMSetProperty(instance, "OperationalStatus", + (CMPIValue *)&array, CMPI_uint16A); + + oping_status = CIM_OPING_STATUS_COMPLETED; + CMSetProperty(instance, "OperatingStatus", + (CMPIValue *)&oping_status, CMPI_uint16); + + req_state = CIM_STATE_UNKNOWN; + CMSetProperty(instance, "RequestedState", + (CMPIValue *)&req_state, CMPI_uint16); + + return true; +} + static bool create_deleted_guest_inst(char *xml, char *namespace, char *prefix, @@ -355,9 +400,10 @@ CU_DEBUG("instance from domain info error: %s", s.msg); goto out; } - /* Must set guest state */ - rc = true; + rc = set_instance_state(*inst); + if (!rc) + CU_DEBUG("Error setting instance state"); out: cleanup_dominfo(&dominfo); From rmaciel at linux.vnet.ibm.com Wed Aug 26 20:02:07 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Wed, 26 Aug 2009 17:02:07 -0300 Subject: [Libvirt-cim] [PATCH] Expose HealthState of LogicalDisk In-Reply-To: <5a1871168fd4d9b90664.1251150856@elm3b151.beaverton.ibm.com> References: <5a1871168fd4d9b90664.1251150856@elm3b151.beaverton.ibm.com> Message-ID: <4A9594BF.2060300@linux.vnet.ibm.com> +1 On 08/24/2009 06:54 PM, Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1251150322 25200 > # Node ID 5a1871168fd4d9b906646bc4b036a950bcc339df > # Parent 0243aa0574431112f0946354d4bbad62bb2c2f7b > Expose HealthState of LogicalDisk > > Signed-off-by: Kaitlin Rupert > > diff -r 0243aa057443 -r 5a1871168fd4 src/Virt_Device.c > --- a/src/Virt_Device.c Thu Aug 20 17:16:24 2009 -0700 > +++ b/src/Virt_Device.c Mon Aug 24 14:45:22 2009 -0700 > @@ -127,6 +127,7 @@ > { > CMPIInstance *inst; > virConnectPtr conn; > + uint16_t state; > > conn = virDomainGetConnect(dom); > inst = get_typed_instance(broker, > @@ -137,6 +138,10 @@ > if (!disk_set_name(inst, dev)) > return NULL; > > + //Set HealthState to "OK" > + state = 5; > + CMSetProperty(inst, "HealthState", (CMPIValue *)&state, CMPI_uint16); > + > return inst; > } > > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 26 22:36:42 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 26 Aug 2009 15:36:42 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] ComputerSystemDeletedIndication wasn't being called when a guest was removed. This patch fix it In-Reply-To: References: Message-ID: <4A95B8FA.5040501@linux.vnet.ibm.com> > +static CMPIStatus set_properties_from_dominfo(const CMPIBroker *broker, > + const char *prefix, > + struct domain *dominfo, > + CMPIInstance *instance) > +{ > + CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL}; > + CMPIObjectPath *ref = NULL; > + > + ref = CMGetObjectPath(instance, &s); > + if ((ref == NULL) || (s.rc != CMPI_RC_OK)) > + return s; > + > + CMSetProperty(instance, "Name", > + (CMPIValue *)dominfo->name, CMPI_chars); > + > + CMSetProperty(instance, "ElementName", > + (CMPIValue *)dominfo->name, CMPI_chars); > + > + CMSetProperty(instance, "UUID", > + (CMPIValue *)dominfo->uuid, CMPI_chars); > + > + if (!set_capdesc_from_dominfo(broker, dominfo, ref, instance)) { > + CU_DEBUG("Problem in set_capdesc_from_dominfo function"); > + goto out; Since you're returning the CMPIStatus variable from this function, you should set error message whenever a failure occurs. Otherwise, the error message might not get set (check the call flow - the error message is never set). -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Wed Aug 26 22:42:33 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 26 Aug 2009 15:42:33 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Adds state information to the instance created in ComputerSystemDeletedIndication In-Reply-To: References: Message-ID: <4A95BA59.7000803@linux.vnet.ibm.com> > diff -r ed7ae95312fc -r aceaaadd58fa src/Virt_ComputerSystem.h > --- a/src/Virt_ComputerSystem.h Wed Aug 26 16:40:06 2009 -0300 > +++ b/src/Virt_ComputerSystem.h Wed Aug 26 16:40:18 2009 -0300 > @@ -24,6 +24,70 @@ > #include "misc_util.h" > #include "device_parsing.h" > > +enum CIM_state { > + CIM_STATE_UNKNOWN = 0, > + CIM_STATE_OTHER = 1, > + CIM_STATE_ENABLED = 2, > + CIM_STATE_DISABLED = 3, > + CIM_STATE_SHUTDOWN = 4, > + CIM_STATE_NOCHANGE = 5, > + CIM_STATE_SUSPENDED = 6, > + CIM_STATE_PAUSED = 9, > + CIM_STATE_REBOOT = 10, > + CIM_STATE_RESET = 11, > +}; I like having these moved out of Virt_CS. However, can they be moved into src/svpc_types.h? We have our SVPC types defined all over, but I think solidifying them in svpc_types.h makes sense. > diff -r ed7ae95312fc -r aceaaadd58fa src/Virt_ComputerSystemIndication.c > --- a/src/Virt_ComputerSystemIndication.c Wed Aug 26 16:40:06 2009 -0300 > +++ b/src/Virt_ComputerSystemIndication.c Wed Aug 26 16:40:18 2009 -0300 > @@ -330,6 +330,51 @@ > return false; > } > > +static bool set_instance_state(CMPIInstance *instance) > +{ > + CMPIStatus s = {CMPI_RC_OK, NULL}; > + CMPIUint16 cim_state; > + CMPIString *cim_state_other = NULL; > + CMPIUint16 health_state; > + CMPIUint16 req_state; > + CMPIUint16 oping_status; > + CMPIUint16 op_status; > + CMPIArray *array; > + > + cim_state = CIM_STATE_OTHER; > + cim_state_other = CMNewString(_BROKER, "Guest removed", &s); I would say "Guest destroyed" here. The function that the user calls is DestroySystem() - so it's in keeping with the same terminology. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 27 05:11:19 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 26 Aug 2009 22:11:19 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST]#2 Adding new test RPCS/10_create_storagevolume.py In-Reply-To: References: Message-ID: <4A961577.8030804@linux.vnet.ibm.com> Deepti B. Kalakeri wrote: > # HG changeset patch > # User Deepti B. Kalakeri > # Date 1251287772 25200 > # Node ID bf818c99aad9657162daf8f1b295fe674dd41a7a > # Parent bd5411ebb634f6cf0945aa4e2f6896eb4221c03f > [TEST]#2 Adding new test RPCS/10_create_storagevolume.py > > Patch 2: > -------- > 1) Added code to verify the StoVol template RASD. > 2) Seperated the SDC query into a function. > 3) Used the default_disk_pool for DIR type pools > > This test verifies the creation of StorageVol in the dir pool. > Tested with KVM on F11 with current sources. > Signed-off-by: Deepti B. Kalakeri > Hi Deepti, Looks like part of this patch was truncated. Can you resend? Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From deeptik at linux.vnet.ibm.com Thu Aug 27 05:15:30 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 26 Aug 2009 22:15:30 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] [TEST] #2 [Resending] Adding new test RPCS/10_create_storagevolume.py Message-ID: From deeptik at linux.vnet.ibm.com Thu Aug 27 05:15:31 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 26 Aug 2009 22:15:31 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] [TEST] Adding vol_list to xm_virt_util.py In-Reply-To: References: Message-ID: # HG changeset patch # User Deepti B. Kalakeri # Date 1251275502 25200 # Node ID bd5411ebb634f6cf0945aa4e2f6896eb4221c03f # Parent 3c09a49a30f4bc1e6544736612508d3f99308083 [TEST] Adding vol_list to xm_virt_util.py. Tested with KVM on F11 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r 3c09a49a30f4 -r bd5411ebb634 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Mon Aug 24 13:28:13 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Wed Aug 26 01:31:42 2009 -0700 @@ -237,6 +237,17 @@ return names +def vol_list(server, virt="KVM", pool_name=None): + """ Function to list the volumes part of a pool""" + + cmd = " virsh -c %s vol-list %s | sed -e '1,2 d' -e '$ d'" \ + % (virt2uri(virt), pool_name) + ret, out = utils.run_remote(server, cmd) + if ret != 0: + return None + + return out + def virsh_vcpuinfo(server, dom, virt="Xen"): cmd = "virsh -c %s vcpuinfo %s | grep VCPU | wc -l" % (virt2uri(virt), dom) From deeptik at linux.vnet.ibm.com Thu Aug 27 05:15:32 2009 From: deeptik at linux.vnet.ibm.com (Deepti B. Kalakeri) Date: Wed, 26 Aug 2009 22:15:32 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [TEST]#2 Adding new test RPCS/10_create_storagevolume.py In-Reply-To: References: Message-ID: <7fa9b3a3bca5106d4f4a.1251350132@elm3b151.beaverton.ibm.com> # HG changeset patch # User Deepti B. Kalakeri # Date 1251350089 25200 # Node ID 7fa9b3a3bca5106d4f4a16278ca9169816a44526 # Parent bd5411ebb634f6cf0945aa4e2f6896eb4221c03f [TEST]#2 Adding new test RPCS/10_create_storagevolume.py Patch 2: -------- 1) Added code to verify the StoVol template RASD. 2) Seperated the SDC query into a function. 3) Used the default_disk_pool for DIR type pools This test verifies the creation of StorageVol in the dir pool. Tested with KVM on F11 with current sources. Signed-off-by: Deepti B. Kalakeri diff -r bd5411ebb634 -r 7fa9b3a3bca5 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py Wed Aug 26 22:14:49 2009 -0700 @@ -0,0 +1,229 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Deepti B. Kalakeri +# +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +# +# This test case verifies the creation of the StorageVol using the +# CreateResourceInPool method of RPCS. +# +# -Date: 21-08-2009 + +import sys +import os +from VirtLib import utils +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS, SKIP +from XenKvmLib.const import do_main, platform_sup, default_pool_name, \ + get_provider_version +from XenKvmLib.vsms import RASD_TYPE_STOREVOL +from XenKvmLib.rasd import libvirt_rasd_storagepool_changes +from XenKvmLib import rpcs_service +from XenKvmLib.assoc import Associators +from XenKvmLib.enumclass import GetInstance, EnumNames +from XenKvmLib.xm_virt_util import virsh_version, vol_list +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.common_util import destroy_diskpool +from XenKvmLib.pool import create_pool, undefine_diskpool, DIR_POOL + +pool_attr = { 'Path' : "/tmp" } +vol_name = "cimtest-vol.img" + +def get_stovol_rasd_from_sdc(virt, server, dp_inst_id): + rasd = None + ac_cn = get_typed_class(virt, "AllocationCapabilities") + an_cn = get_typed_class(virt, "SettingsDefineCapabilities") + key_list = {"InstanceID" : dp_inst_id} + + try: + inst = GetInstance(server, ac_cn, key_list) + rasd = Associators(server, an_cn, ac_cn, InstanceID=inst.InstanceID) + except Exception, detail: + logger.error("Exception: %s", detail) + return FAIL, None + + return PASS, rasd + +def get_stovol_settings(server, virt, dp_id, pool_name): + status, dp_rasds = get_stovol_rasd_from_sdc(virt, server, dp_id) + if status != PASS: + logger.error("Failed to get the StorageVol RASD's") + return None + + for dpool_rasd in dp_rasds: + if dpool_rasd['ResourceType'] == RASD_TYPE_STOREVOL and \ + 'Default' in dpool_rasd['InstanceID']: + + dpool_rasd['PoolID'] = dp_id + dpool_rasd['Path'] = pool_attr['Path'] + dpool_rasd['VolumeName'] = vol_name + break + + if not pool_name in dpool_rasd['PoolID']: + return None + + stovol_settings = inst_to_mof(dpool_rasd) + + return stovol_settings + +def get_diskpool(server, virt, dp_cn, dp_inst_id): + disk_pool_inst = None + dpool_cn = get_typed_class(virt, dp_cn) + pools = EnumNames(server, dpool_cn) + for pool in pools: + if pool['InstanceID'] == dp_inst_id: + disk_pool_inst = pool + break + + return disk_pool_inst + +def verify_vol(server, virt, pool_name, exp_vol_path, found): + vols = vol_list(server, virt, pool_name) + if vols == None: + raise Exception("Failed to get the volume information") + + for vol in vols.split('\n'): + res_vol_name, res_vol_path = vol.split() + if res_vol_name != vol_name and res_vol_path != exp_vol_path: + continue + else: + found += 1 + + if found != 1: + logger.error("Failed to get the vol information") + + return found + +def verify_sto_vol_rasd(virt, server, dp_inst_id, exp_vol_path): + dv_rasds = [] + status, rasds = get_stovol_rasd_from_sdc(virt, server, dp_inst_id) + if status != PASS: + logger.error("Failed to get the StorageVol for '%s' vol", exp_vol_path) + return FAIL + + for item in rasds: + if item['Address'] == exp_vol_path and item['PoolID'] == dp_inst_id: + dv_rasds.append(item) + + if len(dv_rasds) != 4: + logger.error("Got '%s' StorageVolRASD's expected 4", len(dv_rasds)) + return FAIL + + return PASS + + +def cleanup_pool_vol(server, virt, pool_name, clean_vol, exp_vol_path): + try: + if clean_vol == True: + status = destroy_diskpool(server, virt, pool_name) + if status != PASS: + raise Exception("Unable to destroy diskpool '%s'" % pool_name) + else: + status = undefine_diskpool(server, virt, pool_name) + if status != PASS: + raise Exception("Unable to undefine diskpool '%s'" \ + % pool_name) + except Exception, details: + logger.error("Exception details: %s", details) + return FAIL + + if os.path.exists(exp_vol_path): + cmd = "rm -rf %s" % exp_vol_path + ret, out = utils.run_remote(server, cmd) + if ret != 0: + logger.info("'%s' was not removed, please remove it manually", + exp_vol_path) + return PASS + + at do_main(platform_sup) +def main(): + options = main.options + server = options.ip + virt = options.virt + + libvirt_ver = virsh_version(server, virt) + cim_rev, changeset = get_provider_version(virt, server) + if libvirt_ver < "0.4.1" and cim_rev < libvirt_rasd_storagepool_changes: + logger.info("Storage Volume creation support is available with Libvirt" + "version >= 0.4.1 and Libvirt-CIM rev '%s'", + libvirt_rasd_storagepool_changes) + return SKIP + + dp_cn = "DiskPool" + exp_vol_path = "%s/%s" % (pool_attr['Path'], vol_name) + + # For now the test case support only the creation of dir type based + # vol creation, we can extend dp_types to include netfs etc + dp_types = { "DISK_POOL_DIR" : DIR_POOL } + + for pool_name, pool_type in dp_types.iteritems(): + status = FAIL + res = [FAIL] + found = 0 + clean_pool=True + try: + if pool_type == DIR_POOL: + pool_name = default_pool_name + clean_pool=False + else: + status = create_pool(server, virt, pool_name, pool_attr, + mode_type=pool_type, pool_type="DiskPool") + + if status != PASS: + logger.error("Failed to create pool '%s'", pool_name) + return status + + dp_inst_id = "%s/%s" % (dp_cn, pool_name) + stovol_settings = get_stovol_settings(server, virt, + dp_inst_id, pool_name) + if stovol_settings == None: + raise Exception("Failed to get the defualt StorageVolRASD info") + + disk_pool_inst = get_diskpool(server, virt, dp_cn, dp_inst_id) + if disk_pool_inst == None: + raise Exception("DiskPool instance for '%s' not found!" \ + % pool_name) + + rpcs = get_typed_class(virt, "ResourcePoolConfigurationService") + rpcs_conn = eval("rpcs_service." + rpcs)(server) + res = rpcs_conn.CreateResourceInPool(Settings=stovol_settings, + Pool=disk_pool_inst) + if res[0] != PASS: + raise Exception("Failed to create the Vol %s" % vol_name) + + found = verify_vol(server, virt, pool_name, exp_vol_path, found) + stovol_status = verify_sto_vol_rasd(virt, server, dp_inst_id, + exp_vol_path) + + except Exception, details: + logger.error("Exception details: %s", details) + status = FAIL + + ret = cleanup_pool_vol(server, virt, pool_name, + clean_pool, exp_vol_path) + if res[0] == PASS and found == 1 and \ + ret == PASS and stovol_status == PASS: + status = PASS + else: + return FAIL + + return status +if __name__ == "__main__": + sys.exit(main()) From deeptik at linux.vnet.ibm.com Thu Aug 27 09:29:33 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 27 Aug 2009 14:59:33 +0530 Subject: [Libvirt-cim] Test Run Summary (Aug 27 2009): KVM on Fedora release 11 (Leonidas) with Pegasuslist Message-ID: <4A9651FD.7050601@linux.vnet.ibm.com> ================================================= Test Run Summary (Aug 27 2009): KVM on Fedora release 11 (Leonidas) with Pegasus ================================================= Distro: Fedora release 11 (Leonidas) Kernel: 2.6.27.5-117.fc10.x86_64 libvirt: 0.7.0 Hypervisor: QEMU 0.10.1 CIMOM: Pegasus 2.9.0 Libvirt-cim revision: 963 Libvirt-cim changeset: 5a1871168fd4 Cimtest revision: 766 Cimtest changeset: 3c09a49a30f4 ================================================= FAIL : 6 XFAIL : 4 SKIP : 11 PASS : 146 ----------------- Total : 167 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL ElementAllocatedFromPool - 01_forward.py: FAIL HostSystem - 03_hs_to_settdefcap.py: FAIL ResourceAllocationFromPool - 01_forward.py: FAIL ResourceAllocationFromPool - 02_reverse.py: FAIL VirtualSystemManagementService - 15_mod_system_settings.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP LogicalDisk - 02_nodevs.py: SKIP ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: PASS -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error CIM_ERR_NOT_SUPPORTED: State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): CIM_ERR_NOT_SUPPORTED: State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 34_start_disable.py: PASS -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: FAIL ERROR - InstanceID Mismatch ERROR - Returned DiskPool/tmp instead of DiskPool/cimtest-diskpool -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: PASS -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: PASS -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: PASS -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: PASS -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: FAIL ERROR - Failed to get associatornames according to KVM_AllocationCapabilities ERROR - Exception: list index out of range CIM_ERR_INVALID_CLASS: Linux_ComputerSystem -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: PASS -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: PASS -------------------------------------------------------------------- Processor - 01_processor.py: PASS -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: PASS -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: PASS -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: PASS -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: PASS -------------------------------------------------------------------- RASD - 02_enum.py: PASS -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: FAIL ERROR - No RASD associated with DiskPool/cimtest-diskpool -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: FAIL ERROR - InstanceID Mismatch ERROR - Got DiskPool/tmp instead of DiskPool/cimtest-diskpool -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: SKIP ERROR - Need to give different bridge name since it already exists -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: PASS -------------------------------------------------------------------- SystemDevice - 02_reverse.py: PASS -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: PASS -------------------------------------------------------------------- VSSD - 01_enum.py: PASS -------------------------------------------------------------------- VSSD - 02_bootldr.py: SKIP -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: PASS -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: PASS -------------------------------------------------------------------- VSSD - 05_set_uuid.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: FAIL ERROR - CIMError : (1, u"CIM_ERR_FAILED: Guest 'rstest_domain' is already defined with UUID a927efe5-17bc-4187-8a2b-3fd04884b2e8") Traceback (most recent call last): File "/data/users/deepti/F10_runs/cimtest/suites/libvirt-cim/lib/XenKvmLib/const.py", line 139, in do_try rc = f() File "15_mod_system_settings.py", line 103, in main ret = service.ModifySystemSettings(SystemSettings=vssd) File "/data/users/deepti/F10_runs/cimtest/lib/CimTest/CimExt.py", line 32, in __call__ return self.__invoker(self.__name, args) File "/data/users/deepti/F10_runs/cimtest/lib/CimTest/CimExt.py", line 44, in __invoke return self.conn.InvokeMethod(method, self.inst, **params) File "/usr/lib/python2.6/site-packages/pywbem/cim_operations.py", line 801, in InvokeMethod result = self.methodcall(MethodName, obj, **params) File "/usr/lib/python2.6/site-packages/pywbem/cim_operations.py", line 362, in methodcall raise CIMError(code, tt[0][1]['DESCRIPTION']) CIMError: (1, u"CIM_ERR_FAILED: Guest 'rstest_domain' is already defined with UUID a927efe5-17bc-4187-8a2b-3fd04884b2e8") ERROR - None InvokeMethod(ModifySystemSettings): CIM_ERR_FAILED: Guest 'rstest_domain' is already defined with UUID a927efe5-17bc-4187-8a2b-3fd04884b2e8 -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 CIM_ERR_NOT_FOUND: No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Error invoking AddRS: add_net_res ERROR - (1, u"CIM_ERR_FAILED: Unable to change (0) device: this function is not supported by the hypervisor: bridge/network interface attach not supported: qemu 'getfd' monitor command not available") ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unable to change (0) device: this function is not supported by the hypervisor: bridge/network interface attach not supported: qemu 'getfd' monitor command not available Bug:<00015> -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- From deeptik at linux.vnet.ibm.com Thu Aug 27 09:32:19 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 27 Aug 2009 15:02:19 +0530 Subject: [Libvirt-cim] Test Run Summary (Aug 27 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb Message-ID: <4A9652A3.5090306@linux.vnet.ibm.com> ================================================= Test Run Summary (Aug 27 2009): KVM on SUSE Linux Enterprise Server 11 (i586) with sfcb ================================================= Distro: SUSE Linux Enterprise Server 11 (i586) Kernel: 2.6.27.19-5-pae libvirt: 0.4.6 Hypervisor: QEMU 0.9.1 CIMOM: sfcb sfcbd 1.3.2 Libvirt-cim revision: 963 Libvirt-cim changeset: 5a1871168fd4 Cimtest revision: 766 Cimtest changeset: 3c09a49a30f4 ================================================= FAIL : 2 XFAIL : 5 SKIP : 10 PASS : 150 ----------------- Total : 167 ================================================= FAIL Test Summary: ComputerSystemIndication - 01_created_indication.py: FAIL VirtualSystemManagementService - 15_mod_system_settings.py: FAIL ================================================= XFAIL Test Summary: ComputerSystem - 32_start_reboot.py: XFAIL ComputerSystem - 33_suspend_reboot.py: XFAIL VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL VirtualSystemManagementService - 16_removeresource.py: XFAIL VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ================================================= SKIP Test Summary: ComputerSystem - 02_nosystems.py: SKIP ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP LogicalDisk - 02_nodevs.py: SKIP VSSD - 02_bootldr.py: SKIP VirtualSystemMigrationService - 01_migratable_host.py: SKIP VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP ================================================= Full report: -------------------------------------------------------------------- AllocationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- AllocationCapabilities - 02_alloccap_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 01_enum.py: PASS -------------------------------------------------------------------- ComputerSystem - 02_nosystems.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- ComputerSystem - 03_defineVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 04_defineStartVS.py: PASS -------------------------------------------------------------------- ComputerSystem - 05_activate_defined_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 06_paused_active_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 22_define_suspend.py: PASS -------------------------------------------------------------------- ComputerSystem - 23_pause_pause.py: PASS -------------------------------------------------------------------- ComputerSystem - 27_define_pause_errs.py: PASS -------------------------------------------------------------------- ComputerSystem - 32_start_reboot.py: XFAIL ERROR - Got CIM error Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot with return code 1 ERROR - Exception: Unable reboot dom 'cs_test_domain' InvokeMethod(RequestStateChange): Unable to reboot domain: this function is not supported by the hypervisor: virDomainReboot Bug:<00005> -------------------------------------------------------------------- ComputerSystem - 33_suspend_reboot.py: XFAIL ERROR - Got CIM error State not supported with return code 7 ERROR - Exception: Unable Suspend dom 'test_domain' InvokeMethod(RequestStateChange): State not supported Bug:<00012> -------------------------------------------------------------------- ComputerSystem - 34_start_disable.py: PASS -------------------------------------------------------------------- ComputerSystem - 35_start_reset.py: PASS -------------------------------------------------------------------- ComputerSystem - 40_RSC_start.py: PASS -------------------------------------------------------------------- ComputerSystem - 41_cs_to_settingdefinestate.py: PASS -------------------------------------------------------------------- ComputerSystem - 42_cs_gi_errs.py: PASS -------------------------------------------------------------------- ComputerSystemIndication - 01_created_indication.py: FAIL ERROR - Waited too long for define indication ERROR - Waited too long for start indication ERROR - Waited too long for destroy indication -------------------------------------------------------------------- ComputerSystemMigrationJobIndication - 01_csmig_ind_for_offline_mig.py: SKIP -------------------------------------------------------------------- ElementAllocatedFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 03_reverse_errs.py: PASS -------------------------------------------------------------------- ElementAllocatedFromPool - 04_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- ElementCapabilities - 02_reverse.py: PASS -------------------------------------------------------------------- ElementCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ElementCapabilities - 05_hostsystem_cap.py: PASS -------------------------------------------------------------------- ElementConforms - 01_forward.py: PASS -------------------------------------------------------------------- ElementConforms - 02_reverse.py: PASS -------------------------------------------------------------------- ElementConforms - 03_ectp_fwd_errs.py: PASS -------------------------------------------------------------------- ElementConforms - 04_ectp_rev_errs.py: PASS -------------------------------------------------------------------- ElementSettingData - 01_forward.py: PASS -------------------------------------------------------------------- ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 01_enum.py: PASS -------------------------------------------------------------------- HostSystem - 02_hostsystem_to_rasd.py: PASS -------------------------------------------------------------------- HostSystem - 03_hs_to_settdefcap.py: PASS -------------------------------------------------------------------- HostSystem - 04_hs_to_EAPF.py: PASS -------------------------------------------------------------------- HostSystem - 05_hs_gi_errs.py: PASS -------------------------------------------------------------------- HostSystem - 06_hs_to_vsms.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 01_forward.py: PASS -------------------------------------------------------------------- HostedAccessPoint - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 01_forward.py: PASS -------------------------------------------------------------------- HostedDependency - 02_reverse.py: PASS -------------------------------------------------------------------- HostedDependency - 03_enabledstate.py: PASS -------------------------------------------------------------------- HostedDependency - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 01_forward.py: PASS -------------------------------------------------------------------- HostedResourcePool - 02_reverse.py: PASS -------------------------------------------------------------------- HostedResourcePool - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedResourcePool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- HostedService - 01_forward.py: PASS -------------------------------------------------------------------- HostedService - 02_reverse.py: PASS -------------------------------------------------------------------- HostedService - 03_forward_errs.py: PASS -------------------------------------------------------------------- HostedService - 04_reverse_errs.py: PASS -------------------------------------------------------------------- KVMRedirectionSAP - 01_enum_KVMredSAP.py: PASS -------------------------------------------------------------------- LogicalDisk - 01_disk.py: PASS -------------------------------------------------------------------- LogicalDisk - 02_nodevs.py: SKIP ERROR - System has defined domains; unable to run -------------------------------------------------------------------- LogicalDisk - 03_ld_gi_errs.py: PASS -------------------------------------------------------------------- Memory - 01_memory.py: PASS -------------------------------------------------------------------- Memory - 02_defgetmem.py: PASS -------------------------------------------------------------------- Memory - 03_mem_gi_errs.py: PASS -------------------------------------------------------------------- NetworkPort - 01_netport.py: PASS -------------------------------------------------------------------- NetworkPort - 02_np_gi_errors.py: PASS -------------------------------------------------------------------- NetworkPort - 03_user_netport.py: PASS -------------------------------------------------------------------- Processor - 01_processor.py: PASS -------------------------------------------------------------------- Processor - 02_definesys_get_procs.py: PASS -------------------------------------------------------------------- Processor - 03_proc_gi_errs.py: PASS -------------------------------------------------------------------- Profile - 01_enum.py: PASS -------------------------------------------------------------------- Profile - 02_profile_to_elec.py: PASS -------------------------------------------------------------------- Profile - 03_rprofile_gi_errs.py: PASS -------------------------------------------------------------------- RASD - 01_verify_rasd_fields.py: PASS -------------------------------------------------------------------- RASD - 02_enum.py: PASS -------------------------------------------------------------------- RASD - 03_rasd_errs.py: PASS -------------------------------------------------------------------- RASD - 04_disk_rasd_size.py: PASS -------------------------------------------------------------------- RASD - 05_disk_rasd_emu_type.py: PASS -------------------------------------------------------------------- RASD - 06_parent_net_pool.py: PASS -------------------------------------------------------------------- RASD - 07_parent_disk_pool.py: PASS -------------------------------------------------------------------- RedirectionService - 01_enum_crs.py: PASS -------------------------------------------------------------------- RedirectionService - 02_enum_crscap.py: PASS -------------------------------------------------------------------- RedirectionService - 03_RedirectionSAP_errs.py: PASS -------------------------------------------------------------------- ReferencedProfile - 01_verify_refprof.py: PASS -------------------------------------------------------------------- ReferencedProfile - 02_refprofile_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 01_forward.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 02_reverse.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 03_forward_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 04_reverse_errs.py: PASS -------------------------------------------------------------------- ResourceAllocationFromPool - 05_RAPF_err.py: PASS -------------------------------------------------------------------- ResourcePool - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePool - 02_rp_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 01_enum.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 08_CreateDiskResourcePool.py: PASS -------------------------------------------------------------------- ResourcePoolConfigurationService - 09_DeleteDiskPool.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAccessBySAP - 02_reverse.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 01_forward.py: PASS -------------------------------------------------------------------- ServiceAffectsElement - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefine - 02_reverse.py: PASS -------------------------------------------------------------------- SettingsDefine - 03_sds_fwd_errs.py: PASS -------------------------------------------------------------------- SettingsDefine - 04_sds_rev_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 01_forward.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 03_forward_errs.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS -------------------------------------------------------------------- SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS -------------------------------------------------------------------- SystemDevice - 01_forward.py: PASS -------------------------------------------------------------------- SystemDevice - 02_reverse.py: PASS -------------------------------------------------------------------- SystemDevice - 03_fwderrs.py: PASS -------------------------------------------------------------------- VSSD - 01_enum.py: PASS -------------------------------------------------------------------- VSSD - 02_bootldr.py: SKIP -------------------------------------------------------------------- VSSD - 03_vssd_gi_errs.py: PASS -------------------------------------------------------------------- VSSD - 04_vssd_to_rasd.py: PASS -------------------------------------------------------------------- VSSD - 05_set_uuid.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 01_definesystem_name.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 02_destroysystem.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 03_definesystem_ess.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 04_definesystem_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 05_destroysystem_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 06_addresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 07_addresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 08_modifyresource.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 09_procrasd_persist.py: XFAIL -------------------------------------------------------------------- VirtualSystemManagementService - 10_hv_version.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 11_define_memrasdunits.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 12_referenced_config.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 14_define_sys_disk.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 15_mod_system_settings.py: FAIL ERROR - CIMError : (1, u"Guest 'rstest_domain' is already defined with UUID 31cf5494-1e5d-401f-9b00-1260896acaad") Traceback (most recent call last): File "./lib/XenKvmLib/const.py", line 139, in do_try File "15_mod_system_settings.py", line 103, in main ret = service.ModifySystemSettings(SystemSettings=vssd) File "/data/users/deepti/SLES11/cimtest/lib/CimTest/CimExt.py", line 32, in __call__ return self.__invoker(self.__name, args) File "/data/users/deepti/SLES11/cimtest/lib/CimTest/CimExt.py", line 44, in __invoke return self.conn.InvokeMethod(method, self.inst, **params) File "/usr/lib/python2.6/site-packages/pywbem/cim_operations.py", line 801, in InvokeMethod result = self.methodcall(MethodName, obj, **params) File "/usr/lib/python2.6/site-packages/pywbem/cim_operations.py", line 362, in methodcall raise CIMError(code, tt[0][1]['DESCRIPTION']) CIMError: (1, u"Guest 'rstest_domain' is already defined with UUID 31cf5494-1e5d-401f-9b00-1260896acaad") ERROR - None InvokeMethod(ModifySystemSettings): Guest 'rstest_domain' is already defined with UUID 31cf5494-1e5d-401f-9b00-1260896acaad -------------------------------------------------------------------- VirtualSystemManagementService - 16_removeresource.py: XFAIL ERROR - 0 RASD insts for domain/mouse:ps2 No such instance (no device domain/mouse:ps2) Bug:<00014> -------------------------------------------------------------------- VirtualSystemManagementService - 17_removeresource_neg.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 18_define_sys_bridge.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 19_definenetwork_ers.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 20_verify_vnc_password.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 21_createVS_verifyMAC.py: PASS -------------------------------------------------------------------- VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Error invoking AddRS: add_net_res ERROR - (1, u'Unable to change (0) device: this function is not supported by the hypervisor: this device type cannot be attached') ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): Unable to change (0) device: this function is not supported by the hypervisor: this device type cannot be attached Bug:<00015> -------------------------------------------------------------------- VirtualSystemManagementService - 23_verify_duplicate_mac_err.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationService - 01_migratable_host.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 06_remote_live_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 07_remote_offline_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationService - 08_remote_restart_resume_migration.py: SKIP -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 01_forward.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 02_reverse.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotService - 03_create_snapshot.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS -------------------------------------------------------------------- VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS -------------------------------------------------------------------- -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Thu Aug 27 16:00:16 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 27 Aug 2009 13:00:16 -0300 Subject: [Libvirt-cim] [PATCH 0 of 2] [#2] ComputerSystemDeletedIndication is called with all fields properly filled Message-ID: From rmaciel at linux.vnet.ibm.com Thu Aug 27 16:00:17 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 27 Aug 2009 13:00:17 -0300 Subject: [Libvirt-cim] [PATCH 1 of 2] ComputerSystemDeletedIndication wasn't being called when a guest was removed. This patch fix it In-Reply-To: References: Message-ID: <84de50fc3126ea6de453.1251388817@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1251388779 10800 # Node ID 84de50fc3126ea6de453da4543d43b28539eff67 # Parent 7a5403380789571fca9496003461c45f23e18c2f ComputerSystemDeletedIndication wasn't being called when a guest was removed. This patch fix it. Added and exported a function from ComputerSystem, so the indication can create an instance of the guest based on the domain structure stored. #2: Improved status information return in set_instance_state function Signed-off-by: Richard Maciel diff -r 7a5403380789 -r 84de50fc3126 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystem.c Thu Aug 27 12:59:39 2009 -0300 @@ -439,6 +439,102 @@ return 1; } +static CMPIStatus set_properties_from_dominfo(const CMPIBroker *broker, + const char *prefix, + struct domain *dominfo, + CMPIInstance *instance) +{ + CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL}; + CMPIObjectPath *ref = NULL; + + ref = CMGetObjectPath(instance, &s); + if ((ref == NULL) || (s.rc != CMPI_RC_OK)) + return s; + + CMSetProperty(instance, "Name", + (CMPIValue *)dominfo->name, CMPI_chars); + + CMSetProperty(instance, "ElementName", + (CMPIValue *)dominfo->name, CMPI_chars); + + CMSetProperty(instance, "UUID", + (CMPIValue *)dominfo->uuid, CMPI_chars); + + if (!set_capdesc_from_dominfo(broker, dominfo, ref, instance)) { + CU_DEBUG("Problem in set_capdesc_from_dominfo function"); + cu_statusf(broker, &s, + CMPI_RC_FAILED, + "Could not set caption and description properties"); + goto out; + } + + /* We don't set state, because struct domain doesn't have that + * information */ + + if (!set_creation_class(instance)) { + CU_DEBUG("Problem in set_creation_class function"); + cu_statusf(broker, &s, + CMPI_RC_FAILED, + "Could not set creation class"); + goto out; + } + + if (!set_other_id_info(broker, dominfo->uuid, prefix, instance)) { + CU_DEBUG("Problem in set_other_id_info function"); + cu_statusf(broker, &s, + CMPI_RC_FAILED, + "Could not set other OtherIdentifyingInfo and " + "IdentifyingDescription"); + goto out; + } + + cu_statusf(broker, &s, + CMPI_RC_OK, + ""); + + out: + return s; +} + +CMPIStatus instance_from_dominfo(const CMPIBroker *broker, + const char *namespace, + const char *prefix, + struct domain *dominfo, + CMPIInstance **_inst) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst = NULL; + + inst = get_typed_instance(broker, + prefix, + "ComputerSystem", + namespace); + + if (inst == NULL) { + CU_DEBUG("Could not init CS instance. " + "typestr: %s, namespace: %s", prefix, namespace); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to init ComputerSystem instance"); + goto out; + } + + s = set_properties_from_dominfo(broker, + prefix, + dominfo, + inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Could not set instance properties"); + goto out; + } + + *_inst = inst; + + out: + return s; + +} + /* Populate an instance with information from a domain */ static CMPIStatus set_properties(const CMPIBroker *broker, virDomainPtr dom, diff -r 7a5403380789 -r 84de50fc3126 src/Virt_ComputerSystem.h --- a/src/Virt_ComputerSystem.h Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystem.h Thu Aug 27 12:59:39 2009 -0300 @@ -22,6 +22,7 @@ #define __VIRT_COMPUTERSYSTEM_H #include "misc_util.h" +#include "device_parsing.h" /** * Get a list of domain instances @@ -62,6 +63,25 @@ const char *name, CMPIInstance **_inst); +/** + * Create a domain instance from the domain structure. Note that the instance + * doesn't necessarily represents an existing domain (can represent a deleted + * one, for instance) + * + * @param broker A pointer to the current broker + * @param namespace The namespace to used by the domain instance + * @param prefix The virtualization prefix (i.e. KVM, Xen, LXC) + * @param dominfo A pointer to the struct domain used to fill the instance + * @param _inst In case of success the pointer to the instance + * @returns CMPIStatus + */ +CMPIStatus instance_from_dominfo(const CMPIBroker *broker, + const char *namespace, + const char *prefix, + struct domain *dominfo, + CMPIInstance **_inst); + + #endif /* diff -r 7a5403380789 -r 84de50fc3126 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystemIndication.c Thu Aug 27 12:59:39 2009 -0300 @@ -330,6 +330,41 @@ return false; } +static bool create_deleted_guest_inst(char *xml, + char *namespace, + char *prefix, + CMPIInstance **inst) +{ + bool rc = false; + struct domain *dominfo = NULL; + int res; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + res = get_dominfo_from_xml(xml, &dominfo); + if (res == 0) { + CU_DEBUG("failed to extract domain info from xml"); + goto out; + } + + s = instance_from_dominfo(_BROKER, + namespace, + prefix, + dominfo, + inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("instance from domain info error: %s", s.msg); + goto out; + } + /* Must set guest state */ + + rc = true; + + out: + cleanup_dominfo(&dominfo); + + return rc; +} + static bool async_ind(CMPIContext *context, virConnectPtr conn, int ind_type, @@ -360,12 +395,27 @@ cn = get_typed_class(prefix, "ComputerSystem"); op = CMNewObjectPath(_BROKER, args->ns, cn, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) + if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { + CU_DEBUG("op error"); goto out; + } - s = get_domain_by_name(_BROKER, op, name, &affected_inst); - if (s.rc != CMPI_RC_OK) - goto out; + if (ind_type == CS_CREATED || ind_type == CS_MODIFIED) { + s = get_domain_by_name(_BROKER, op, name, &affected_inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("domain by name error"); + goto out; + } + } else if (ind_type == CS_DELETED) { + rc = create_deleted_guest_inst(prev_dom.xml, + args->ns, + prefix, + &affected_inst); + if (!rc) { + CU_DEBUG("Could not recreate guest instance"); + goto out; + } + } /* FIXME: We are unable to get the previous CS instance after it has been modified. Consider keeping track of the previous From rmaciel at linux.vnet.ibm.com Thu Aug 27 16:00:18 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 27 Aug 2009 13:00:18 -0300 Subject: [Libvirt-cim] [PATCH 2 of 2] Adds state information to the instance created in ComputerSystemDeletedIndication In-Reply-To: References: Message-ID: <570b94a6c4277eae667b.1251388818@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1251388782 10800 # Node ID 570b94a6c4277eae667be11ec48b23668a3c5e17 # Parent 84de50fc3126ea6de453da4543d43b28539eff67 Adds state information to the instance created in ComputerSystemDeletedIndication Had to export the state enumerations in ComputerSystem.c to use in the indication code #2: - Changed OtherEnabledState value to 'Guest destroyed' - Moved state enums to svpc_types.h Signed-off-by: Richard Maciel diff -r 84de50fc3126 -r 570b94a6c427 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Aug 27 12:59:39 2009 -0300 +++ b/src/Virt_ComputerSystem.c Thu Aug 27 12:59:42 2009 -0300 @@ -47,18 +47,6 @@ const static CMPIBroker *_BROKER; -enum CIM_state { - CIM_STATE_UNKNOWN = 0, - CIM_STATE_ENABLED = 2, - CIM_STATE_DISABLED = 3, - CIM_STATE_SHUTDOWN = 4, - CIM_STATE_NOCHANGE = 5, - CIM_STATE_SUSPENDED = 6, - CIM_STATE_PAUSED = 9, - CIM_STATE_REBOOT = 10, - CIM_STATE_RESET = 11, -}; - /* Set the "Name" property of an instance from a domain */ static int set_name_from_dom(virDomainPtr dom, CMPIInstance *instance) { @@ -159,15 +147,6 @@ static uint16_t state_lv_to_cim_health(const char lv_state) { - enum CIM_health_state { - CIM_HEALTH_UNKNOWN = 0, - CIM_HEALTH_OK = 5, - CIM_HEALTH_MINOR_FAILURE = 15, - CIM_HEALTH_MAJOR_FAILURE = 20, - CIM_HEALTH_CRITICAL_FAILURE = 25, - CIM_HEALTH_NON_RECOVERABLE = 30, - }; - switch (lv_state) { case VIR_DOMAIN_NOSTATE: case VIR_DOMAIN_SHUTDOWN: @@ -189,28 +168,6 @@ static uint16_t state_lv_to_cim_oings(const char lv_state, const bool migrating) { - enum CIM_oping_status { - CIM_OPING_STATUS_UNKNOWN = 0, - CIM_OPING_STATUS_NOT_AVAILABLE = 1, - CIM_OPING_STATUS_SERVICING = 2, - CIM_OPING_STATUS_STARTING = 3, - CIM_OPING_STATUS_STOPPING = 4, - CIM_OPING_STATUS_STOPPED = 5, - CIM_OPING_STATUS_ABORTED = 6, - CIM_OPING_STATUS_DORMANT = 7, - CIM_OPING_STATUS_COMPLETED = 8, - CIM_OPING_STATUS_MIGRATING = 9, - CIM_OPING_STATUS_EMIGRATING = 10, - CIM_OPING_STATUS_IMMIGRATING = 11, - CIM_OPING_STATUS_SNAPSHOTTING = 12, - CIM_OPING_STATUS_SHUTTING_DOWN = 13, - CIM_OPING_STATUS_IN_TEST = 14, - CIM_OPING_STATUS_TRANSITIONING = 15, - CIM_OPING_STATUS_IN_SERVICE = 16, - CIM_OPING_STATUS_STARTED = 32768, - }; - - if (migrating) return CIM_OPING_STATUS_MIGRATING; @@ -237,27 +194,6 @@ static uint16_t state_lv_to_cim_os(const char lv_state) { - enum CIM_op_status { - CIM_OP_STATUS_UNKNOWN = 0, - CIM_OP_STATUS_OTHER = 1, - CIM_OP_STATUS_OK = 2, - CIM_OP_STATUS_DEGRADED = 3, - CIM_OP_STATUS_STRESSED = 4, - CIM_OP_STATUS_PREDICTIVE_FAILURE = 5, - CIM_OP_STATUS_ERROR = 6, - CIM_OP_STATUS_NON_RECOVERABLE = 7, - CIM_OP_STATUS_STARTING = 8, - CIM_OP_STATUS_STOPPING = 9, - CIM_OP_STATUS_STOPPED = 10, - CIM_OP_STATUS_IN_SERVICE = 11, - CIM_OP_STATUS_NO_CONTACT = 12, - CIM_OP_STATUS_LOST_COMMS = 13, - CIM_OP_STATUS_ABORTED = 14, - CIM_OP_STATUS_DORMANT = 15, - CIM_OP_STATUS_COMPLETED = 17, - CIM_OP_STATUS_POWER_MODE = 18, - }; - switch (lv_state) { case VIR_DOMAIN_NOSTATE: case VIR_DOMAIN_SHUTDOWN: @@ -463,7 +399,7 @@ if (!set_capdesc_from_dominfo(broker, dominfo, ref, instance)) { CU_DEBUG("Problem in set_capdesc_from_dominfo function"); cu_statusf(broker, &s, - CMPI_RC_FAILED, + CMPI_RC_ERR_FAILED, "Could not set caption and description properties"); goto out; } @@ -474,7 +410,7 @@ if (!set_creation_class(instance)) { CU_DEBUG("Problem in set_creation_class function"); cu_statusf(broker, &s, - CMPI_RC_FAILED, + CMPI_RC_ERR_FAILED, "Could not set creation class"); goto out; } @@ -482,7 +418,7 @@ if (!set_other_id_info(broker, dominfo->uuid, prefix, instance)) { CU_DEBUG("Problem in set_other_id_info function"); cu_statusf(broker, &s, - CMPI_RC_FAILED, + CMPI_RC_ERR_FAILED, "Could not set other OtherIdentifyingInfo and " "IdentifyingDescription"); goto out; diff -r 84de50fc3126 -r 570b94a6c427 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Thu Aug 27 12:59:39 2009 -0300 +++ b/src/Virt_ComputerSystemIndication.c Thu Aug 27 12:59:42 2009 -0300 @@ -330,6 +330,51 @@ return false; } +static bool set_instance_state(CMPIInstance *instance) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIUint16 cim_state; + CMPIString *cim_state_other = NULL; + CMPIUint16 health_state; + CMPIUint16 req_state; + CMPIUint16 oping_status; + CMPIUint16 op_status; + CMPIArray *array; + + cim_state = CIM_STATE_OTHER; + cim_state_other = CMNewString(_BROKER, "Guest destroyed", &s); + CMSetProperty(instance, "EnabledState", + (CMPIValue *)&cim_state, CMPI_uint16); + CMSetProperty(instance, "OtherEnabledState", + (CMPIValue *)&cim_state_other, CMPI_string); + + health_state = CIM_HEALTH_UNKNOWN; + CMSetProperty(instance, "HealthState", + (CMPIValue *)&health_state, CMPI_uint16); + + array = CMNewArray(_BROKER, 2, CMPI_uint16, &s); + if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) + return false; + + op_status = CIM_OP_STATUS_COMPLETED; + CMSetArrayElementAt(array, 0, &op_status, CMPI_uint16); + op_status = CIM_OP_STATUS_OK; + CMSetArrayElementAt(array, 1, &op_status, CMPI_uint16); + + CMSetProperty(instance, "OperationalStatus", + (CMPIValue *)&array, CMPI_uint16A); + + oping_status = CIM_OPING_STATUS_COMPLETED; + CMSetProperty(instance, "OperatingStatus", + (CMPIValue *)&oping_status, CMPI_uint16); + + req_state = CIM_STATE_UNKNOWN; + CMSetProperty(instance, "RequestedState", + (CMPIValue *)&req_state, CMPI_uint16); + + return true; +} + static bool create_deleted_guest_inst(char *xml, char *namespace, char *prefix, @@ -355,9 +400,10 @@ CU_DEBUG("instance from domain info error: %s", s.msg); goto out; } - /* Must set guest state */ - rc = true; + rc = set_instance_state(*inst); + if (!rc) + CU_DEBUG("Error setting instance state"); out: cleanup_dominfo(&dominfo); diff -r 84de50fc3126 -r 570b94a6c427 src/svpc_types.h --- a/src/svpc_types.h Thu Aug 27 12:59:39 2009 -0300 +++ b/src/svpc_types.h Thu Aug 27 12:59:42 2009 -0300 @@ -102,4 +102,70 @@ return CIM_VSSD_RECOVERY_NONE; } +/* State enums used by ComputerSystem */ +enum CIM_state { + CIM_STATE_UNKNOWN = 0, + CIM_STATE_OTHER = 1, + CIM_STATE_ENABLED = 2, + CIM_STATE_DISABLED = 3, + CIM_STATE_SHUTDOWN = 4, + CIM_STATE_NOCHANGE = 5, + CIM_STATE_SUSPENDED = 6, + CIM_STATE_PAUSED = 9, + CIM_STATE_REBOOT = 10, + CIM_STATE_RESET = 11, +}; + +enum CIM_health_state { + CIM_HEALTH_UNKNOWN = 0, + CIM_HEALTH_OK = 5, + CIM_HEALTH_MINOR_FAILURE = 15, + CIM_HEALTH_MAJOR_FAILURE = 20, + CIM_HEALTH_CRITICAL_FAILURE = 25, + CIM_HEALTH_NON_RECOVERABLE = 30, +}; + +enum CIM_oping_status { + CIM_OPING_STATUS_UNKNOWN = 0, + CIM_OPING_STATUS_NOT_AVAILABLE = 1, + CIM_OPING_STATUS_SERVICING = 2, + CIM_OPING_STATUS_STARTING = 3, + CIM_OPING_STATUS_STOPPING = 4, + CIM_OPING_STATUS_STOPPED = 5, + CIM_OPING_STATUS_ABORTED = 6, + CIM_OPING_STATUS_DORMANT = 7, + CIM_OPING_STATUS_COMPLETED = 8, + CIM_OPING_STATUS_MIGRATING = 9, + CIM_OPING_STATUS_EMIGRATING = 10, + CIM_OPING_STATUS_IMMIGRATING = 11, + CIM_OPING_STATUS_SNAPSHOTTING = 12, + CIM_OPING_STATUS_SHUTTING_DOWN = 13, + CIM_OPING_STATUS_IN_TEST = 14, + CIM_OPING_STATUS_TRANSITIONING = 15, + CIM_OPING_STATUS_IN_SERVICE = 16, + CIM_OPING_STATUS_STARTED = 32768, +}; + +enum CIM_op_status { + CIM_OP_STATUS_UNKNOWN = 0, + CIM_OP_STATUS_OTHER = 1, + CIM_OP_STATUS_OK = 2, + CIM_OP_STATUS_DEGRADED = 3, + CIM_OP_STATUS_STRESSED = 4, + CIM_OP_STATUS_PREDICTIVE_FAILURE = 5, + CIM_OP_STATUS_ERROR = 6, + CIM_OP_STATUS_NON_RECOVERABLE = 7, + CIM_OP_STATUS_STARTING = 8, + CIM_OP_STATUS_STOPPING = 9, + CIM_OP_STATUS_STOPPED = 10, + CIM_OP_STATUS_IN_SERVICE = 11, + CIM_OP_STATUS_NO_CONTACT = 12, + CIM_OP_STATUS_LOST_COMMS = 13, + CIM_OP_STATUS_ABORTED = 14, + CIM_OP_STATUS_DORMANT = 15, + CIM_OP_STATUS_COMPLETED = 17, + CIM_OP_STATUS_POWER_MODE = 18, +}; + + #endif From deeptik at linux.vnet.ibm.com Thu Aug 27 17:53:39 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Thu, 27 Aug 2009 23:23:39 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 27 2009): KVM on Fedora release 11 (Leonidas) with Pegasuslist In-Reply-To: <4A9651FD.7050601@linux.vnet.ibm.com> References: <4A9651FD.7050601@linux.vnet.ibm.com> Message-ID: <4A96C823.3030207@linux.vnet.ibm.com> Deepti B Kalakeri wrote: > ================================================= > Test Run Summary (Aug 27 2009): KVM on Fedora release 11 (Leonidas) > with Pegasus > ================================================= > Distro: Fedora release 11 (Leonidas) > Kernel: 2.6.27.5-117.fc10.x86_64 > libvirt: 0.7.0 > Hypervisor: QEMU 0.10.1 > CIMOM: Pegasus 2.9.0 > Libvirt-cim revision: 963 > Libvirt-cim changeset: 5a1871168fd4 > Cimtest revision: 766 > Cimtest changeset: 3c09a49a30f4 > ================================================= > FAIL : 6 > XFAIL : 4 > SKIP : 11 > PASS : 146 > ----------------- > Total : 167 > ================================================= > FAIL Test Summary: > ComputerSystemIndication - 01_created_indication.py: FAIL > ElementAllocatedFromPool - 01_forward.py: FAIL This is not a test case issue. The test failed because there were two conflicting diskpool with the same target dir used while creating it. # virsh pool-list --all Name State Autostart ----------------------------------------- cimtest-diskpool active no tmp active no virsh pool-dumpxml cimtest-diskpool cimtest-diskpool e45c9d25-b143-52bd-ccf5-e2f8cd8e8acd 42275766272 8330838016 33944928256 /tmp 0700 0 0 # virsh pool-dumpxml tmp tmp 40c687d1-dccb-226b-0234-8fdb18c5e1c9 42275766272 7913541632 34362224640 /tmp 0700 0 0 The following query was failing to return cimtest-diskpool and instead returned DiskPool/tmp because of which the test failed: #wbemcli ain -ac KVM_ElementAllocatedFromPool http://root:@localhost:5988/root/virt:KVM_LogicalDisk.CreationClassName="KVM_LogicalDisk",DeviceID="hd_domain/hda",SystemCreationClassName="KVM_ComputerSystem",SystemName="hd_domain" /root/virt:KVM_DiskPool.InstanceID="DiskPool/tmp" Once I deleted the tmp diskpool and reran the test it passed. #wbemcli ain -ac KVM_ElementAllocatedFromPool http://root:@localhost:5988/root/virt:KVM_LogicalDisk.CreationClassName="KVM_LogicalDisk",DeviceID="hd_domain/hda",SystemCreationClassName="KVM_ComputerSystem",SystemName="hd_domain" /root/virt:KVM_DiskPool.InstanceID="DiskPool/cimtest-diskpool" So, I think libvirt should have not allowed to create two pools which used the same target path, or libvirt-cim will have to handle this condition. > HostSystem - 03_hs_to_settdefcap.py: FAIL > ResourceAllocationFromPool - 01_forward.py: FAIL > ResourceAllocationFromPool - 02_reverse.py: FAIL > VirtualSystemManagementService - 15_mod_system_settings.py: FAIL > will look into the above -- Thanks and Regards, Deepti B. Kalakeri IBM Linux Technology Center deeptik at linux.vnet.ibm.com From rmaciel at linux.vnet.ibm.com Thu Aug 27 18:36:35 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Thu, 27 Aug 2009 15:36:35 -0300 Subject: [Libvirt-cim] [PATCH 0 of 3] Expose Path attribute in DiskPool instances In-Reply-To: References: Message-ID: <4A96D233.9010806@linux.vnet.ibm.com> +1 On 08/25/2009 12:47 PM, Kaitlin Rupert wrote: > The first two patches are some minor tweaks and reshuffling of code in order > to prevent name collisions and redundant code across providers. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim -- Richard Maciel, MSc IBM Linux Technology Center rmaciel at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 27 21:19:32 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 27 Aug 2009 14:19:32 -0700 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 27 2009): KVM on Fedora release 11 (Leonidas) with Pegasuslist In-Reply-To: <4A96C823.3030207@linux.vnet.ibm.com> References: <4A9651FD.7050601@linux.vnet.ibm.com> <4A96C823.3030207@linux.vnet.ibm.com> Message-ID: <4A96F864.7020707@linux.vnet.ibm.com> >> ================================================= >> FAIL Test Summary: >> ComputerSystemIndication - 01_created_indication.py: FAIL >> ElementAllocatedFromPool - 01_forward.py: FAIL > This is not a test case issue. The test failed because there were two > conflicting diskpool with the same target dir used while creating it. > > The following query was failing to return cimtest-diskpool and instead > returned DiskPool/tmp because of which the test failed: > > #wbemcli ain -ac KVM_ElementAllocatedFromPool > http://root:@localhost:5988/root/virt:KVM_LogicalDisk.CreationClassName="KVM_LogicalDisk",DeviceID="hd_domain/hda",SystemCreationClassName="KVM_ComputerSystem",SystemName="hd_domain" > > /root/virt:KVM_DiskPool.InstanceID="DiskPool/tmp" > > > Once I deleted the tmp diskpool and reran the test it passed. > #wbemcli ain -ac KVM_ElementAllocatedFromPool > http://root:@localhost:5988/root/virt:KVM_LogicalDisk.CreationClassName="KVM_LogicalDisk",DeviceID="hd_domain/hda",SystemCreationClassName="KVM_ComputerSystem",SystemName="hd_domain" > > /root/virt:KVM_DiskPool.InstanceID="DiskPool/cimtest-diskpool" > > So, I think libvirt should have not allowed to create two pools which > used the same target path, or libvirt-cim will have to handle this > condition. This is a really good point. libvirt should check for this, but we could check as well. I'll make note of it as something that needs to be fixed. -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 27 21:28:34 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 27 Aug 2009 14:28:34 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] ComputerSystemDeletedIndication wasn't being called when a guest was removed. This patch fix it In-Reply-To: <84de50fc3126ea6de453.1251388817@localhost.localdomain> References: <84de50fc3126ea6de453.1251388817@localhost.localdomain> Message-ID: <4A96FA82.8060200@linux.vnet.ibm.com> > +static CMPIStatus set_properties_from_dominfo(const CMPIBroker *broker, > + const char *prefix, > + struct domain *dominfo, > + CMPIInstance *instance) > +{ > + CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL}; Since you set the status when an error occurs, just set this to CMPI_RC_OK. > + CMPIObjectPath *ref = NULL; > + > + ref = CMGetObjectPath(instance, &s); > + if ((ref == NULL) || (s.rc != CMPI_RC_OK)) > + return s; > + > + CMSetProperty(instance, "Name", > + (CMPIValue *)dominfo->name, CMPI_chars); > + > + CMSetProperty(instance, "ElementName", > + (CMPIValue *)dominfo->name, CMPI_chars); > + > + CMSetProperty(instance, "UUID", > + (CMPIValue *)dominfo->uuid, CMPI_chars); > + > + if (!set_capdesc_from_dominfo(broker, dominfo, ref, instance)) { > + CU_DEBUG("Problem in set_capdesc_from_dominfo function"); > + cu_statusf(broker, &s, > + CMPI_RC_FAILED, This should be CMPI_RC_ERR_FAILED. > + "Could not set caption and description properties"); > + goto out; > + } > + > + /* We don't set state, because struct domain doesn't have that > + * information */ > + > + if (!set_creation_class(instance)) { > + CU_DEBUG("Problem in set_creation_class function"); > + cu_statusf(broker, &s, > + CMPI_RC_FAILED, Here's as well. > + "Could not set creation class"); > + goto out; > + } > + > + if (!set_other_id_info(broker, dominfo->uuid, prefix, instance)) { > + CU_DEBUG("Problem in set_other_id_info function"); > + cu_statusf(broker, &s, > + CMPI_RC_FAILED, Here too. > + "Could not set other OtherIdentifyingInfo and " > + "IdentifyingDescription"); > + goto out; > + } > + > + cu_statusf(broker, &s, > + CMPI_RC_OK, > + ""); This is not needed if you initialize s to be CMPI_RC_OK. > + > + out: > + return s; > +} -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 27 21:29:59 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 27 Aug 2009 14:29:59 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Adds state information to the instance created in ComputerSystemDeletedIndication In-Reply-To: <570b94a6c4277eae667b.1251388818@localhost.localdomain> References: <570b94a6c4277eae667b.1251388818@localhost.localdomain> Message-ID: <4A96FAD7.7040007@linux.vnet.ibm.com> > @@ -463,7 +399,7 @@ > if (!set_capdesc_from_dominfo(broker, dominfo, ref, instance)) { > CU_DEBUG("Problem in set_capdesc_from_dominfo function"); > cu_statusf(broker, &s, > - CMPI_RC_FAILED, > + CMPI_RC_ERR_FAILED, Oh, I hadn't looked at this patch yet when I reviewed the first one. Instead of making the changes in this patch.. just make these changes in the first one. No need to have your second patch fix errors in the first patch. > "Could not set caption and description properties"); > goto out; > } > @@ -474,7 +410,7 @@ > if (!set_creation_class(instance)) { > CU_DEBUG("Problem in set_creation_class function"); > cu_statusf(broker, &s, > - CMPI_RC_FAILED, > + CMPI_RC_ERR_FAILED, > "Could not set creation class"); > goto out; > } > @@ -482,7 +418,7 @@ > if (!set_other_id_info(broker, dominfo->uuid, prefix, instance)) { > CU_DEBUG("Problem in set_other_id_info function"); > cu_statusf(broker, &s, > - CMPI_RC_FAILED, > + CMPI_RC_ERR_FAILED, > "Could not set other OtherIdentifyingInfo and " > "IdentifyingDescription"); > goto out; -- Kaitlin Rupert IBM Linux Technology Center kaitlin at linux.vnet.ibm.com From kaitlin at linux.vnet.ibm.com Thu Aug 27 22:27:42 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 27 Aug 2009 15:27:42 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Add DeleteResourceInPool() to RPCS mof In-Reply-To: References: Message-ID: <1cb1a2dbdb0abb503898.1251412062@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1251232703 25200 # Node ID 1cb1a2dbdb0abb503898a851ab3b4d41ee85cab0 # Parent 9af5eef7ea76c7e9d1657d2e8cd4df9ed126b596 Add DeleteResourceInPool() to RPCS mof Also, fix a typo in the description for the out parameter in CreateResourceInPool() Signed-off-by: Kaitlin Rupert diff -r 9af5eef7ea76 -r 1cb1a2dbdb0a schema/ResourcePoolConfigurationService.mof --- a/schema/ResourcePoolConfigurationService.mof Mon Aug 24 16:14:41 2009 -0700 +++ b/schema/ResourcePoolConfigurationService.mof Tue Aug 25 13:38:23 2009 -0700 @@ -17,9 +17,23 @@ [IN, Description ( "Reference to the pool to create the resources in." )] CIM_ResourcePool REF Pool, + [IN ( false ), OUT, Description ( "Reference to the resource created." )] + CIM_ResourceAllocationSettingData REF Resource + ); + + [Description ( "Delete a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 DeleteResourceInPool( + [IN, Description ( "Reference to the resource to delete." )] + CIM_ResourceAllocationSettingData REF Resource, + + [IN, Description ( "The pool to remove the resource from." )] + CIM_ResourcePool REF Pool, + [IN ( false ), OUT, Description ( "Reference to the job (may be null " "if job completed)." )] - CIM_ResourceAllocationSettingData REF Resource + CIM_ConcreteJob REF Job ); }; @@ -41,9 +55,23 @@ [IN, Description ( "Reference to the pool to create the resources in." )] CIM_ResourcePool REF Pool, + [IN ( false ), OUT, Description ( "Reference to the resource created." )] + CIM_ResourceAllocationSettingData REF Resource + ); + + [Description ( "Delete a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 DeleteResourceInPool( + [IN, Description ( "Reference to the resource to delete." )] + CIM_ResourceAllocationSettingData REF Resource, + + [IN, Description ( "The pool to remove the resource from." )] + CIM_ResourcePool REF Pool, + [IN ( false ), OUT, Description ( "Reference to the job (may be null " "if job completed)." )] - CIM_ResourceAllocationSettingData REF Resource + CIM_ConcreteJob REF Job ); }; @@ -65,9 +93,23 @@ [IN, Description ( "Reference to the pool to create the resources in." )] CIM_ResourcePool REF Pool, - [IN ( false ), OUT, Description ( "Reference to the job (may be null " - "if job completed)." )] + [IN ( false ), OUT, Description ( "Reference to the resource created." )] CIM_ResourceAllocationSettingData REF Resource ); + [Description ( "Delete a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 DeleteResourceInPool( + [IN, Description ( "Reference to the resource to delete." )] + CIM_ResourceAllocationSettingData REF Resource, + + [IN, Description ( "The pool to remove the resource from." )] + CIM_ResourcePool REF Pool, + + [IN ( false ), OUT, Description ( "Reference to the job (may be null " + "if job completed)." )] + CIM_ConcreteJob REF Job + ); + }; From kaitlin at linux.vnet.ibm.com Thu Aug 27 22:27:44 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 27 Aug 2009 15:27:44 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Add delete_resource_in_pool to RPCS In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1251232703 25200 # Node ID f31abcfc4e9d141c8e83adfdffee50d45b9f1e1f # Parent eb113fed5210d9d31e3b5eae684f27631c0a2ef2 Add delete_resource_in_pool to RPCS. This can be tested in a similar manner to how create_resource_in_pool() is tested. Create a storage volume within an existing pool prior to calling DeleteResourceInPool(). Signed-off-by: Kaitlin Rupert diff -r eb113fed5210 -r f31abcfc4e9d src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Tue Aug 25 13:38:23 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Tue Aug 25 13:38:23 2009 -0700 @@ -959,6 +959,94 @@ return s; } +static CMPIStatus delete_resource_parse_args(const CMPIArgs *argsin, + CMPIObjectPath **resource, + CMPIObjectPath **pool) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (cu_get_ref_arg(argsin, "Resource", resource) != CMPI_RC_OK) { + CU_DEBUG("Failed to get Resource arg"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing argument `Resource'"); + goto out; + } + + if (cu_get_ref_arg(argsin, "Pool", pool) != CMPI_RC_OK) { + CU_DEBUG("Failed to get Pool reference arg"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing argument `Pool'"); + goto out; + } + + out: + return s; +} + +static CMPIStatus delete_resource_in_pool(CMPIMethodMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference, + const CMPIArgs *argsin, + CMPIArgs *argsout) +{ + uint32_t rc = CIM_SVPC_RETURN_FAILED; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *resource; + CMPIObjectPath *pool; + const char *id = NULL; + virConnectPtr conn = NULL; + uint16_t type; + + CU_DEBUG("DeleteResourceInPool"); + + s = delete_resource_parse_args(argsin, &resource, &pool); + if (s.rc != CMPI_RC_OK) + goto out; + + if (res_type_from_rasd_classname(CLASSNAME(resource), &type) != + CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get resource type"); + goto out; + } + + if (cu_get_str_path(resource, "InstanceID", &id) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing InstanceID in resource RASD"); + goto out; + } + + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); + if (conn == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "libvirt connection failed"); + goto out; + } + + if (delete_resource(conn, id, type) == 0) { + virt_set_status(_BROKER, &s, + CMPI_RC_ERR_FAILED, + conn, + "Unable to delete resource"); + goto out; + } + + out: + virConnectClose(conn); + + if (s.rc == CMPI_RC_OK) + rc = CIM_SVPC_RETURN_COMPLETED; + CMReturnData(results, &rc, CMPI_uint32); + + return s; +} + static CMPIStatus dummy_handler(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, @@ -1014,6 +1102,15 @@ } }; +static struct method_handler DeleteResourceInPool = { + .name = "DeleteResourceInPool", + .handler = delete_resource_in_pool, + .args = {{"Resource", CMPI_ref, true}, + {"Pool", CMPI_ref, true}, + ARG_END + } +}; + static struct method_handler *my_handlers[] = { &CreateResourcePool, &CreateChildResourcePool, @@ -1021,6 +1118,7 @@ &RemoveResourcesFromResourcePool, &DeleteResourcePool, &CreateResourceInPool, + &DeleteResourceInPool, NULL, }; From kaitlin at linux.vnet.ibm.com Thu Aug 27 22:27:41 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 27 Aug 2009 15:27:41 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] First set of patches relating to image deletion Message-ID: This is the first set of changes. There needs to be a follow up patch to enumerate the storage volumes - some way other than via the SDC association. From kaitlin at linux.vnet.ibm.com Thu Aug 27 22:27:43 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 27 Aug 2009 15:27:43 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] Add delete_resource() to pool_parsing.c - this will call libvirt APIs In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1251232703 25200 # Node ID eb113fed5210d9d31e3b5eae684f27631c0a2ef2 # Parent 1cb1a2dbdb0abb503898a851ab3b4d41ee85cab0 Add delete_resource() to pool_parsing.c - this will call libvirt APIs... To delete a storage volume within a storage pool. Signed-off-by: Kaitlin Rupert diff -r 1cb1a2dbdb0a -r eb113fed5210 libxkutil/pool_parsing.c --- a/libxkutil/pool_parsing.c Tue Aug 25 13:38:23 2009 -0700 +++ b/libxkutil/pool_parsing.c Tue Aug 25 13:38:23 2009 -0700 @@ -358,6 +358,34 @@ return ret; } + +int delete_resource(virConnectPtr conn, + const char *rname, + int res_type) +{ + int ret = 0; + + if (res_type == CIM_RES_TYPE_IMAGE) { + virStorageVolPtr ptr = virStorageVolLookupByPath(conn, rname); + if (ptr == NULL) { + CU_DEBUG("Storage volume %s is not defined", rname); + goto out; + } + + ret = virStorageVolDelete(ptr, 0); + if (ret != 0) { + CU_DEBUG("Unable to delete storage volume %s", rname); + } else { + ret = 1; + } + + virStorageVolFree(ptr); + } + + out: + + return ret; +} #else int create_resource(virConnectPtr conn, const char *pname, @@ -367,6 +395,14 @@ CU_DEBUG("Creating resources within libvirt pools not supported"); return 0; } + +int delete_resource(virConnectPtr conn, + const char *rname, + int res_type) +{ + CU_DEBUG("Deleting resources within libvirt pools not supported"); + return 0; +} #endif /* diff -r 1cb1a2dbdb0a -r eb113fed5210 libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Tue Aug 25 13:38:23 2009 -0700 +++ b/libxkutil/pool_parsing.h Tue Aug 25 13:38:23 2009 -0700 @@ -92,6 +92,8 @@ int create_resource(virConnectPtr conn, const char *pname, const char *xml, int res_type); +int delete_resource(virConnectPtr conn, const char *rname, int res_type); + #endif /* From anantyog at linux.vnet.ibm.com Thu Aug 27 23:55:30 2009 From: anantyog at linux.vnet.ibm.com (Yogananth Subramanian) Date: Thu, 27 Aug 2009 16:55:30 -0700 Subject: [Libvirt-cim] [PATCH] [Test](#5)Testcase to check for duplicate UUID Message-ID: <95fa64bf447e5bc2bab5.1251417330@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1251416393 25200 # Node ID 95fa64bf447e5bc2bab501564e3d9336edef997d # Parent 7fa9b3a3bca5106d4f4a16278ca9169816a44526 [Test](#5)Testcase to check for duplicate UUID Hello everyone, Have made changes to exception handling based on comments from Deepti Kalakeri. Rest of the testcase remains the same. Thx yogi diff -r 7fa9b3a3bca5 -r 95fa64bf447e suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VSSD/06_duplicate_uuid.py Thu Aug 27 16:39:53 2009 -0700 @@ -0,0 +1,129 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Yogananth Subramanian +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU 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 +# General Public License for more details. +# +# You should have received a copy of the GNU 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 +# +#Steps: +#1) Define 2 domains,'default' and 'test', both with random UUID +#2) Reset the uuid of the second domain, 'test', to the uuid of the +# first domain, using ModifySystemSettings +# + +import sys +import time +import pywbem +from XenKvmLib import vsms +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import PASS, FAIL, SKIP +from XenKvmLib.const import do_main +from XenKvmLib.classes import get_typed_class, inst_to_mof +from XenKvmLib.enumclass import GetInstance +from XenKvmLib.const import get_provider_version + +sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] +default_dom = 'uuid_domain' +test_dom = 'test_domain' +nmac = '99:aa:bb:cc:ee:ff' +duplicate_uuid_support = 915 + +def get_vssd(ip, virt, dom): + cn = get_typed_class(virt, "VirtualSystemSettingData") + inst = None + + try: + if virt == "XenFV": + virt = "Xen" + + key_list = {"InstanceID" : "%s:%s" % (virt, default_dom) } + + inst = GetInstance(ip, cn, key_list, True) + + except Exception, details: + logger.error(details) + return FAIL, inst + + if inst is None: + return FAIL, inst + + return PASS, inst + + at do_main(sup_types) +def main(): + options = main.options + virt = options.virt + server = options.ip + + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev < duplicate_uuid_support: + logger.info("Need provider version %d or greater to run testcase", + duplicate_uuid_support) + return SKIP + + service = vsms.get_vsms_class(options.virt)(options.ip) + + sxml = None + cxml = vxml.get_class(options.virt)(default_dom) + ret = cxml.cim_define(options.ip) + if not ret: + logger.error("Failed to define the dom: %s", default_dom) + return FAIL + + try: + status, inst = get_vssd(options.ip, options.virt, default_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s" % + default_dom) + + uuid_defaultdom = inst['UUID'] + + sxml = vxml.get_class(options.virt)(test_dom, mac=nmac) + ret = sxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s" % test_dom) + + status, inst = get_vssd(options.ip, options.virt, test_dom) + if status != PASS: + raise Exception("Failed to get the VSSD instance for %s" % + test_dom) + + inst['UUID'] = uuid_defaultdom + vssd = inst_to_mof(inst) + ret = service.ModifySystemSettings(SystemSettings=vssd) + if ret[0] == 0: + raise Exception("Was able to assign duplicate UUID to domain %s" + % test_dom) + + except pywbem.CIMError, (err_no, err_desc): + if err_desc.find("'uuid_domain' is already defined") >= 0: + logger.info('Got expected error desc %s', err_desc) + status = PASS + + except Exception, details: + logger.error("Excepttion %s", details) + status = FAIL + + if sxml != None: + sxml.undefine(options.ip) + cxml.undefine(options.ip) + return status + +if __name__ == "__main__": + sys.exit(main()) + From deeptik at linux.vnet.ibm.com Fri Aug 28 09:00:58 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 28 Aug 2009 14:30:58 +0530 Subject: [Libvirt-cim] [PATCH] [Test](#5)Testcase to check for duplicate UUID In-Reply-To: <95fa64bf447e5bc2bab5.1251417330@elm3b151.beaverton.ibm.com> References: <95fa64bf447e5bc2bab5.1251417330@elm3b151.beaverton.ibm.com> Message-ID: <1251450058.27316.23.camel@linux-7qq4.site> +1, except for a very minor spell error on line 119 which can be ignored for now. Thanks yogi for working on this. Thanks and Regards, Deepti. From deeptik at linux.vnet.ibm.com Fri Aug 28 12:57:31 2009 From: deeptik at linux.vnet.ibm.com (Deepti B Kalakeri) Date: Fri, 28 Aug 2009 18:27:31 +0530 Subject: [Libvirt-cim] Re: Test Run Summary (Aug 27 2009): KVM on Fedora release 11 (Leonidas) with Pegasuslist In-Reply-To: <4A96C823.3030207@linux.vnet.ibm.com> References: <4A9651FD.7050601@linux.vnet.ibm.com> <4A96C823.3030207@linux.vnet.ibm.com> Message-ID: <1251464251.29386.6.camel@linux-7qq4.site> On Thu, 2009-08-27 at 23:23 +0530, Deepti B Kalakeri wrote: > > Deepti B Kalakeri wrote: > > ================================================= > > Test Run Summary (Aug 27 2009): KVM on Fedora release 11 (Leonidas) > > with Pegasus > > ================================================= > > Distro: Fedora release 11 (Leonidas) > > Kernel: 2.6.27.5-117.fc10.x86_64 > > libvirt: 0.7.0 > > Hypervisor: QEMU 0.10.1 > > CIMOM: Pegasus 2.9.0 > > Libvirt-cim revision: 963 > > Libvirt-cim changeset: 5a1871168fd4 > > Cimtest revision: 766 > > Cimtest changeset: 3c09a49a30f4 > > ================================================= > > FAIL : 6 > > XFAIL : 4 > > SKIP : 11 > > PASS : 146 > > ----------------- > > Total : 167 > > ================================================= > > FAIL Test Summary: > > ComputerSystemIndication - 01_created_indication.py: FAIL > > ElementAllocatedFromPool - 01_forward.py: FAIL > This is not a test case issue. The test failed because there were two > conflicting diskpool with the same target dir used while creating it. > > # virsh pool-list --all > Name State Autostart > ----------------------------------------- > cimtest-diskpool active no > tmp active no > > virsh pool-dumpxml cimtest-diskpool > > cimtest-diskpool > e45c9d25-b143-52bd-ccf5-e2f8cd8e8acd > 42275766272 > 8330838016 > 33944928256 > > > > /tmp > > 0700 > 0 > 0 > > > > > # virsh pool-dumpxml tmp > > tmp > 40c687d1-dccb-226b-0234-8fdb18c5e1c9 > 42275766272 > 7913541632 > 34362224640 > > > > /tmp > > 0700 > 0 > 0 > > > > > The following query was failing to return cimtest-diskpool and instead > returned DiskPool/tmp because of which the test failed: > > #wbemcli ain -ac KVM_ElementAllocatedFromPool > http://root:@localhost:5988/root/virt:KVM_LogicalDisk.CreationClassName="KVM_LogicalDisk",DeviceID="hd_domain/hda",SystemCreationClassName="KVM_ComputerSystem",SystemName="hd_domain" > /root/virt:KVM_DiskPool.InstanceID="DiskPool/tmp" > > > Once I deleted the tmp diskpool and reran the test it passed. > #wbemcli ain -ac KVM_ElementAllocatedFromPool > http://root:@localhost:5988/root/virt:KVM_LogicalDisk.CreationClassName="KVM_LogicalDisk",DeviceID="hd_domain/hda",SystemCreationClassName="KVM_ComputerSystem",SystemName="hd_domain" > /root/virt:KVM_DiskPool.InstanceID="DiskPool/cimtest-diskpool" > > So, I think libvirt should have not allowed to create two pools which > used the same target path, or libvirt-cim will have to handle this > condition. > > HostSystem - 03_hs_to_settdefcap.py: FAIL > > ResourceAllocationFromPool - 01_forward.py: FAIL > > ResourceAllocationFromPool - 02_reverse.py: FAIL The above 2 EAFP tests failed for the existence of the same tmp diskpool > > VirtualSystemManagementService - 15_mod_system_settings.py: FAIL > > > will look into the above > From rmaciel at linux.vnet.ibm.com Fri Aug 28 16:28:20 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 28 Aug 2009 13:28:20 -0300 Subject: [Libvirt-cim] [PATCH 0 of 2] [#3] ComputerSystemDeletedIndication is called with all fields properly filled Message-ID: From rmaciel at linux.vnet.ibm.com Fri Aug 28 16:28:21 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 28 Aug 2009 13:28:21 -0300 Subject: [Libvirt-cim] [PATCH 1 of 2] ComputerSystemDeletedIndication wasn't being called when a guest was removed. This patch fix it In-Reply-To: References: Message-ID: <483311e0e542c9882a81.1251476901@localhost.localdomain> # HG changeset patch # User Richard Maciel # Date 1251475864 10800 # Node ID 483311e0e542c9882a81e00d77511a4b23334304 # Parent 7a5403380789571fca9496003461c45f23e18c2f ComputerSystemDeletedIndication wasn't being called when a guest was removed. This patch fix it. Added and exported a function from ComputerSystem, so the indication can create an instance of the guest based on the domain structure stored. #2: Improved status information return in set_instance_state function #3: Changed code style Signed-off-by: Richard Maciel diff -r 7a5403380789 -r 483311e0e542 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystem.c Fri Aug 28 13:11:04 2009 -0300 @@ -439,6 +439,98 @@ return 1; } +static CMPIStatus set_properties_from_dominfo(const CMPIBroker *broker, + const char *prefix, + struct domain *dominfo, + CMPIInstance *instance) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *ref = NULL; + + ref = CMGetObjectPath(instance, &s); + if ((ref == NULL) || (s.rc != CMPI_RC_OK)) + return s; + + CMSetProperty(instance, "Name", + (CMPIValue *)dominfo->name, CMPI_chars); + + CMSetProperty(instance, "ElementName", + (CMPIValue *)dominfo->name, CMPI_chars); + + CMSetProperty(instance, "UUID", + (CMPIValue *)dominfo->uuid, CMPI_chars); + + if (!set_capdesc_from_dominfo(broker, dominfo, ref, instance)) { + CU_DEBUG("Problem in set_capdesc_from_dominfo function"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not set caption and description properties"); + goto out; + } + + /* We don't set state, because struct domain doesn't have that + * information */ + + if (!set_creation_class(instance)) { + CU_DEBUG("Problem in set_creation_class function"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not set creation class"); + goto out; + } + + if (!set_other_id_info(broker, dominfo->uuid, prefix, instance)) { + CU_DEBUG("Problem in set_other_id_info function"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not set other OtherIdentifyingInfo and " + "IdentifyingDescription"); + goto out; + } + + out: + return s; +} + +CMPIStatus instance_from_dominfo(const CMPIBroker *broker, + const char *namespace, + const char *prefix, + struct domain *dominfo, + CMPIInstance **_inst) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst = NULL; + + inst = get_typed_instance(broker, + prefix, + "ComputerSystem", + namespace); + + if (inst == NULL) { + CU_DEBUG("Could not init CS instance. " + "typestr: %s, namespace: %s", prefix, namespace); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to init ComputerSystem instance"); + goto out; + } + + s = set_properties_from_dominfo(broker, + prefix, + dominfo, + inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Could not set instance properties"); + goto out; + } + + *_inst = inst; + + out: + return s; + +} + /* Populate an instance with information from a domain */ static CMPIStatus set_properties(const CMPIBroker *broker, virDomainPtr dom, diff -r 7a5403380789 -r 483311e0e542 src/Virt_ComputerSystem.h --- a/src/Virt_ComputerSystem.h Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystem.h Fri Aug 28 13:11:04 2009 -0300 @@ -22,6 +22,7 @@ #define __VIRT_COMPUTERSYSTEM_H #include "misc_util.h" +#include "device_parsing.h" /** * Get a list of domain instances @@ -62,6 +63,25 @@ const char *name, CMPIInstance **_inst); +/** + * Create a domain instance from the domain structure. Note that the instance + * doesn't necessarily represents an existing domain (can represent a deleted + * one, for instance) + * + * @param broker A pointer to the current broker + * @param namespace The namespace to used by the domain instance + * @param prefix The virtualization prefix (i.e. KVM, Xen, LXC) + * @param dominfo A pointer to the struct domain used to fill the instance + * @param _inst In case of success the pointer to the instance + * @returns CMPIStatus + */ +CMPIStatus instance_from_dominfo(const CMPIBroker *broker, + const char *namespace, + const char *prefix, + struct domain *dominfo, + CMPIInstance **_inst); + + #endif /* diff -r 7a5403380789 -r 483311e0e542 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Thu Aug 20 17:16:24 2009 -0700 +++ b/src/Virt_ComputerSystemIndication.c Fri Aug 28 13:11:04 2009 -0300 @@ -330,6 +330,41 @@ return false; } +static bool create_deleted_guest_inst(char *xml, + char *namespace, + char *prefix, + CMPIInstance **inst) +{ + bool rc = false; + struct domain *dominfo = NULL; + int res; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + res = get_dominfo_from_xml(xml, &dominfo); + if (res == 0) { + CU_DEBUG("failed to extract domain info from xml"); + goto out; + } + + s = instance_from_dominfo(_BROKER, + namespace, + prefix, + dominfo, + inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("instance from domain info error: %s", s.msg); + goto out; + } + /* Must set guest state */ + + rc = true; + + out: + cleanup_dominfo(&dominfo); + + return rc; +} + static bool async_ind(CMPIContext *context, virConnectPtr conn, int ind_type, @@ -360,12 +395,27 @@ cn = get_typed_class(prefix, "ComputerSystem"); op = CMNewObjectPath(_BROKER, args->ns, cn, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) + if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { + CU_DEBUG("op error"); goto out; + } - s = get_domain_by_name(_BROKER, op, name, &affected_inst); - if (s.rc != CMPI_RC_OK) - goto out; + if (ind_type == CS_CREATED || ind_type == CS_MODIFIED) { + s = get_domain_by_name(_BROKER, op, name, &affected_inst); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("domain by name error"); + goto out; + } + } else if (ind_type == CS_DELETED) { + rc = create_deleted_guest_inst(prev_dom.xml, + args->ns, + prefix, + &affected_inst); + if (!rc) { + CU_DEBUG("Could not recreate guest instance"); + goto out; + } + } /* FIXME: We are unable to get the previous CS instance after it has been modified. Consider keeping track of the previous From rmaciel at linux.vnet.ibm.com Fri Aug 28 16:28:22 2009 From: rmaciel at linux.vnet.ibm.com (Richard Maciel) Date: Fri, 28 Aug 2009 13:28:22 -0300 Subject: [Libvirt-cim] [PATCH 2 of 2] Adds state information to the instance created in ComputerSystemDeletedIndication In-Reply-To: References: Message-ID: # HG changeset patch # User Richard Maciel # Date 1251476195 10800 # Node ID d6a1619f9b188b25dbabb7e58d1b83946aaa4fd8 # Parent 483311e0e542c9882a81e00d77511a4b23334304 Adds state information to the instance created in ComputerSystemDeletedIndication Had to export the state enumerations in ComputerSystem.c to use in the indication code #2: - Changed OtherEnabledState value to 'Guest destroyed' - Moved state enums to svpc_types.h #3: Added info on the newly-created function header Signed-off-by: Richard Maciel diff -r 483311e0e542 -r d6a1619f9b18 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Aug 28 13:11:04 2009 -0300 +++ b/src/Virt_ComputerSystem.c Fri Aug 28 13:16:35 2009 -0300 @@ -47,18 +47,6 @@ const static CMPIBroker *_BROKER; -enum CIM_state { - CIM_STATE_UNKNOWN = 0, - CIM_STATE_ENABLED = 2, - CIM_STATE_DISABLED = 3, - CIM_STATE_SHUTDOWN = 4, - CIM_STATE_NOCHANGE = 5, - CIM_STATE_SUSPENDED = 6, - CIM_STATE_PAUSED = 9, - CIM_STATE_REBOOT = 10, - CIM_STATE_RESET = 11, -}; - /* Set the "Name" property of an instance from a domain */ static int set_name_from_dom(virDomainPtr dom, CMPIInstance *instance) { @@ -159,15 +147,6 @@ static uint16_t state_lv_to_cim_health(const char lv_state) { - enum CIM_health_state { - CIM_HEALTH_UNKNOWN = 0, - CIM_HEALTH_OK = 5, - CIM_HEALTH_MINOR_FAILURE = 15, - CIM_HEALTH_MAJOR_FAILURE = 20, - CIM_HEALTH_CRITICAL_FAILURE = 25, - CIM_HEALTH_NON_RECOVERABLE = 30, - }; - switch (lv_state) { case VIR_DOMAIN_NOSTATE: case VIR_DOMAIN_SHUTDOWN: @@ -189,28 +168,6 @@ static uint16_t state_lv_to_cim_oings(const char lv_state, const bool migrating) { - enum CIM_oping_status { - CIM_OPING_STATUS_UNKNOWN = 0, - CIM_OPING_STATUS_NOT_AVAILABLE = 1, - CIM_OPING_STATUS_SERVICING = 2, - CIM_OPING_STATUS_STARTING = 3, - CIM_OPING_STATUS_STOPPING = 4, - CIM_OPING_STATUS_STOPPED = 5, - CIM_OPING_STATUS_ABORTED = 6, - CIM_OPING_STATUS_DORMANT = 7, - CIM_OPING_STATUS_COMPLETED = 8, - CIM_OPING_STATUS_MIGRATING = 9, - CIM_OPING_STATUS_EMIGRATING = 10, - CIM_OPING_STATUS_IMMIGRATING = 11, - CIM_OPING_STATUS_SNAPSHOTTING = 12, - CIM_OPING_STATUS_SHUTTING_DOWN = 13, - CIM_OPING_STATUS_IN_TEST = 14, - CIM_OPING_STATUS_TRANSITIONING = 15, - CIM_OPING_STATUS_IN_SERVICE = 16, - CIM_OPING_STATUS_STARTED = 32768, - }; - - if (migrating) return CIM_OPING_STATUS_MIGRATING; @@ -237,27 +194,6 @@ static uint16_t state_lv_to_cim_os(const char lv_state) { - enum CIM_op_status { - CIM_OP_STATUS_UNKNOWN = 0, - CIM_OP_STATUS_OTHER = 1, - CIM_OP_STATUS_OK = 2, - CIM_OP_STATUS_DEGRADED = 3, - CIM_OP_STATUS_STRESSED = 4, - CIM_OP_STATUS_PREDICTIVE_FAILURE = 5, - CIM_OP_STATUS_ERROR = 6, - CIM_OP_STATUS_NON_RECOVERABLE = 7, - CIM_OP_STATUS_STARTING = 8, - CIM_OP_STATUS_STOPPING = 9, - CIM_OP_STATUS_STOPPED = 10, - CIM_OP_STATUS_IN_SERVICE = 11, - CIM_OP_STATUS_NO_CONTACT = 12, - CIM_OP_STATUS_LOST_COMMS = 13, - CIM_OP_STATUS_ABORTED = 14, - CIM_OP_STATUS_DORMANT = 15, - CIM_OP_STATUS_COMPLETED = 17, - CIM_OP_STATUS_POWER_MODE = 18, - }; - switch (lv_state) { case VIR_DOMAIN_NOSTATE: case VIR_DOMAIN_SHUTDOWN: diff -r 483311e0e542 -r d6a1619f9b18 src/Virt_ComputerSystem.h --- a/src/Virt_ComputerSystem.h Fri Aug 28 13:11:04 2009 -0300 +++ b/src/Virt_ComputerSystem.h Fri Aug 28 13:16:35 2009 -0300 @@ -66,7 +66,9 @@ /** * Create a domain instance from the domain structure. Note that the instance * doesn't necessarily represents an existing domain (can represent a deleted - * one, for instance) + * one, for instance). + * Also, the states of the instance created are not set (i.e. HealthState, + * EnableState and others) * * @param broker A pointer to the current broker * @param namespace The namespace to used by the domain instance diff -r 483311e0e542 -r d6a1619f9b18 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Fri Aug 28 13:11:04 2009 -0300 +++ b/src/Virt_ComputerSystemIndication.c Fri Aug 28 13:16:35 2009 -0300 @@ -330,6 +330,51 @@ return false; } +static bool set_instance_state(CMPIInstance *instance) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIUint16 cim_state; + CMPIString *cim_state_other = NULL; + CMPIUint16 health_state; + CMPIUint16 req_state; + CMPIUint16 oping_status; + CMPIUint16 op_status; + CMPIArray *array; + + cim_state = CIM_STATE_OTHER; + cim_state_other = CMNewString(_BROKER, "Guest destroyed", &s); + CMSetProperty(instance, "EnabledState", + (CMPIValue *)&cim_state, CMPI_uint16); + CMSetProperty(instance, "OtherEnabledState", + (CMPIValue *)&cim_state_other, CMPI_string); + + health_state = CIM_HEALTH_UNKNOWN; + CMSetProperty(instance, "HealthState", + (CMPIValue *)&health_state, CMPI_uint16); + + array = CMNewArray(_BROKER, 2, CMPI_uint16, &s); + if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) + return false; + + op_status = CIM_OP_STATUS_COMPLETED; + CMSetArrayElementAt(array, 0, &op_status, CMPI_uint16); + op_status = CIM_OP_STATUS_OK; + CMSetArrayElementAt(array, 1, &op_status, CMPI_uint16); + + CMSetProperty(instance, "OperationalStatus", + (CMPIValue *)&array, CMPI_uint16A); + + oping_status = CIM_OPING_STATUS_COMPLETED; + CMSetProperty(instance, "OperatingStatus", + (CMPIValue *)&oping_status, CMPI_uint16); + + req_state = CIM_STATE_UNKNOWN; + CMSetProperty(instance, "RequestedState", + (CMPIValue *)&req_state, CMPI_uint16); + + return true; +} + static bool create_deleted_guest_inst(char *xml, char *namespace, char *prefix, @@ -355,9 +400,10 @@ CU_DEBUG("instance from domain info error: %s", s.msg); goto out; } - /* Must set guest state */ - rc = true; + rc = set_instance_state(*inst); + if (!rc) + CU_DEBUG("Error setting instance state"); out: cleanup_dominfo(&dominfo); diff -r 483311e0e542 -r d6a1619f9b18 src/svpc_types.h --- a/src/svpc_types.h Fri Aug 28 13:11:04 2009 -0300 +++ b/src/svpc_types.h Fri Aug 28 13:16:35 2009 -0300 @@ -102,4 +102,70 @@ return CIM_VSSD_RECOVERY_NONE; } +/* State enums used by ComputerSystem */ +enum CIM_state { + CIM_STATE_UNKNOWN = 0, + CIM_STATE_OTHER = 1, + CIM_STATE_ENABLED = 2, + CIM_STATE_DISABLED = 3, + CIM_STATE_SHUTDOWN = 4, + CIM_STATE_NOCHANGE = 5, + CIM_STATE_SUSPENDED = 6, + CIM_STATE_PAUSED = 9, + CIM_STATE_REBOOT = 10, + CIM_STATE_RESET = 11, +}; + +enum CIM_health_state { + CIM_HEALTH_UNKNOWN = 0, + CIM_HEALTH_OK = 5, + CIM_HEALTH_MINOR_FAILURE = 15, + CIM_HEALTH_MAJOR_FAILURE = 20, + CIM_HEALTH_CRITICAL_FAILURE = 25, + CIM_HEALTH_NON_RECOVERABLE = 30, +}; + +enum CIM_oping_status { + CIM_OPING_STATUS_UNKNOWN = 0, + CIM_OPING_STATUS_NOT_AVAILABLE = 1, + CIM_OPING_STATUS_SERVICING = 2, + CIM_OPING_STATUS_STARTING = 3, + CIM_OPING_STATUS_STOPPING = 4, + CIM_OPING_STATUS_STOPPED = 5, + CIM_OPING_STATUS_ABORTED = 6, + CIM_OPING_STATUS_DORMANT = 7, + CIM_OPING_STATUS_COMPLETED = 8, + CIM_OPING_STATUS_MIGRATING = 9, + CIM_OPING_STATUS_EMIGRATING = 10, + CIM_OPING_STATUS_IMMIGRATING = 11, + CIM_OPING_STATUS_SNAPSHOTTING = 12, + CIM_OPING_STATUS_SHUTTING_DOWN = 13, + CIM_OPING_STATUS_IN_TEST = 14, + CIM_OPING_STATUS_TRANSITIONING = 15, + CIM_OPING_STATUS_IN_SERVICE = 16, + CIM_OPING_STATUS_STARTED = 32768, +}; + +enum CIM_op_status { + CIM_OP_STATUS_UNKNOWN = 0, + CIM_OP_STATUS_OTHER = 1, + CIM_OP_STATUS_OK = 2, + CIM_OP_STATUS_DEGRADED = 3, + CIM_OP_STATUS_STRESSED = 4, + CIM_OP_STATUS_PREDICTIVE_FAILURE = 5, + CIM_OP_STATUS_ERROR = 6, + CIM_OP_STATUS_NON_RECOVERABLE = 7, + CIM_OP_STATUS_STARTING = 8, + CIM_OP_STATUS_STOPPING = 9, + CIM_OP_STATUS_STOPPED = 10, + CIM_OP_STATUS_IN_SERVICE = 11, + CIM_OP_STATUS_NO_CONTACT = 12, + CIM_OP_STATUS_LOST_COMMS = 13, + CIM_OP_STATUS_ABORTED = 14, + CIM_OP_STATUS_DORMANT = 15, + CIM_OP_STATUS_COMPLETED = 17, + CIM_OP_STATUS_POWER_MODE = 18, +}; + + #endif From kaitlin at linux.vnet.ibm.com Fri Aug 28 23:13:49 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 28 Aug 2009 16:13:49 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] First set of patches relating to image deletion Message-ID: This is the first set of changes. There needs to be a follow up patch to enumerate the storage volumes - some way other than via the SDC association. Updates: -This fixes the image deletion code so that the user can pass one of the RASDs returned from SDC. From kaitlin at linux.vnet.ibm.com Fri Aug 28 23:13:50 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 28 Aug 2009 16:13:50 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] (#2) Add DeleteResourceInPool() to RPCS mof In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1251232703 25200 # Node ID d047a30a9ea367e729cb265434c4dba89c11f495 # Parent 9af5eef7ea76c7e9d1657d2e8cd4df9ed126b596 (#2) Add DeleteResourceInPool() to RPCS mof Also, fix a typo in the description for the out parameter in CreateResourceInPool() Updates: -Change the Resource paramater to a EmbeddedObject instead of a CMPIReference. This will allow the user to grab the instance of the storage volume from SDC - the instances from SDC don't have the path set in the InstanceID attribute - they have that specified in the Address attribute Signed-off-by: Kaitlin Rupert diff -r 9af5eef7ea76 -r d047a30a9ea3 schema/ResourcePoolConfigurationService.mof --- a/schema/ResourcePoolConfigurationService.mof Mon Aug 24 16:14:41 2009 -0700 +++ b/schema/ResourcePoolConfigurationService.mof Tue Aug 25 13:38:23 2009 -0700 @@ -17,9 +17,24 @@ [IN, Description ( "Reference to the pool to create the resources in." )] CIM_ResourcePool REF Pool, + [IN ( false ), OUT, Description ( "Reference to the resource created." )] + CIM_ResourceAllocationSettingData REF Resource + ); + + [Description ( "Delete a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 DeleteResourceInPool( + [IN, Description ( "Reference to the resource to delete." ), + EmbeddedInstance ( "CIM_ResourceAllocationSettingData" )] + string Resource, + + [IN, Description ( "The pool to remove the resource from." )] + CIM_ResourcePool REF Pool, + [IN ( false ), OUT, Description ( "Reference to the job (may be null " "if job completed)." )] - CIM_ResourceAllocationSettingData REF Resource + CIM_ConcreteJob REF Job ); }; @@ -41,9 +56,24 @@ [IN, Description ( "Reference to the pool to create the resources in." )] CIM_ResourcePool REF Pool, + [IN ( false ), OUT, Description ( "Reference to the resource created." )] + CIM_ResourceAllocationSettingData REF Resource + ); + + [Description ( "Delete a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 DeleteResourceInPool( + [IN, Description ( "Reference to the resource to delete." ), + EmbeddedInstance ( "CIM_ResourceAllocationSettingData" )] + string Resource, + + [IN, Description ( "The pool to remove the resource from." )] + CIM_ResourcePool REF Pool, + [IN ( false ), OUT, Description ( "Reference to the job (may be null " "if job completed)." )] - CIM_ResourceAllocationSettingData REF Resource + CIM_ConcreteJob REF Job ); }; @@ -65,9 +95,24 @@ [IN, Description ( "Reference to the pool to create the resources in." )] CIM_ResourcePool REF Pool, - [IN ( false ), OUT, Description ( "Reference to the job (may be null " - "if job completed)." )] + [IN ( false ), OUT, Description ( "Reference to the resource created." )] CIM_ResourceAllocationSettingData REF Resource ); + [Description ( "Delete a resource within a specified pool using the " + "specified allocation settings. If 0 is returned, the " + "function completed successfully." )] + uint32 DeleteResourceInPool( + [IN, Description ( "Reference to the resource to delete." ), + EmbeddedInstance ( "CIM_ResourceAllocationSettingData" )] + string Resource, + + [IN, Description ( "The pool to remove the resource from." )] + CIM_ResourcePool REF Pool, + + [IN ( false ), OUT, Description ( "Reference to the job (may be null " + "if job completed)." )] + CIM_ConcreteJob REF Job + ); + }; From kaitlin at linux.vnet.ibm.com Fri Aug 28 23:13:51 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 28 Aug 2009 16:13:51 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] Add delete_resource() to pool_parsing.c - this will call libvirt APIs In-Reply-To: References: Message-ID: <2ca94acaa955045c3438.1251501231@elm3b151.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1251232703 25200 # Node ID 2ca94acaa955045c3438053f3fa8f1277945f839 # Parent d047a30a9ea367e729cb265434c4dba89c11f495 Add delete_resource() to pool_parsing.c - this will call libvirt APIs... To delete a storage volume within a storage pool. Signed-off-by: Kaitlin Rupert diff -r d047a30a9ea3 -r 2ca94acaa955 libxkutil/pool_parsing.c --- a/libxkutil/pool_parsing.c Tue Aug 25 13:38:23 2009 -0700 +++ b/libxkutil/pool_parsing.c Tue Aug 25 13:38:23 2009 -0700 @@ -358,6 +358,34 @@ return ret; } + +int delete_resource(virConnectPtr conn, + const char *rname, + int res_type) +{ + int ret = 0; + + if (res_type == CIM_RES_TYPE_IMAGE) { + virStorageVolPtr ptr = virStorageVolLookupByPath(conn, rname); + if (ptr == NULL) { + CU_DEBUG("Storage volume %s is not defined", rname); + goto out; + } + + ret = virStorageVolDelete(ptr, 0); + if (ret != 0) { + CU_DEBUG("Unable to delete storage volume %s", rname); + } else { + ret = 1; + } + + virStorageVolFree(ptr); + } + + out: + + return ret; +} #else int create_resource(virConnectPtr conn, const char *pname, @@ -367,6 +395,14 @@ CU_DEBUG("Creating resources within libvirt pools not supported"); return 0; } + +int delete_resource(virConnectPtr conn, + const char *rname, + int res_type) +{ + CU_DEBUG("Deleting resources within libvirt pools not supported"); + return 0; +} #endif /* diff -r d047a30a9ea3 -r 2ca94acaa955 libxkutil/pool_parsing.h --- a/libxkutil/pool_parsing.h Tue Aug 25 13:38:23 2009 -0700 +++ b/libxkutil/pool_parsing.h Tue Aug 25 13:38:23 2009 -0700 @@ -92,6 +92,8 @@ int create_resource(virConnectPtr conn, const char *pname, const char *xml, int res_type); +int delete_resource(virConnectPtr conn, const char *rname, int res_type); + #endif /* From kaitlin at linux.vnet.ibm.com Fri Aug 28 23:13:52 2009 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 28 Aug 2009 16:13:52 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] In-Reply-To: References: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1251232703 25200 # Node ID a0297a6cdac8864acd43c873058beecaf54fca2b # Parent 2ca94acaa955045c3438053f3fa8f1277945f839 #2 Add delete_resource_in_pool to RPCS. This can be tested in a similar manner to how create_resource_in_pool() is tested. Create a storage volume within an existing pool prior to calling DeleteResourceInPool(). Updates: -Get the path to the image from the instance's Address attribute Signed-off-by: Kaitlin Rupert diff -r 2ca94acaa955 -r a0297a6cdac8 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Tue Aug 25 13:38:23 2009 -0700 +++ b/src/Virt_ResourcePoolConfigurationService.c Tue Aug 25 13:38:23 2009 -0700 @@ -959,6 +959,105 @@ return s; } +static CMPIStatus delete_resource_parse_args(const CMPIArgs *argsin, + CMPIInstance **resource, + CMPIObjectPath **pool) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (cu_get_inst_arg(argsin, "Resource", resource) != CMPI_RC_OK) { + CU_DEBUG("Failed to get Resource arg"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing argument `Resource'"); + goto out; + } + + if (cu_get_ref_arg(argsin, "Pool", pool) != CMPI_RC_OK) { + CU_DEBUG("Failed to get Pool reference arg"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_INVALID_PARAMETER, + "Missing argument `Pool'"); + goto out; + } + + out: + return s; +} + +static CMPIStatus delete_resource_in_pool(CMPIMethodMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference, + const CMPIArgs *argsin, + CMPIArgs *argsout) +{ + uint32_t rc = CIM_SVPC_RETURN_FAILED; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *resource; + CMPIObjectPath *pool; + CMPIObjectPath *res; + const char *id = NULL; + virConnectPtr conn = NULL; + uint16_t type; + + CU_DEBUG("DeleteResourceInPool"); + + s = delete_resource_parse_args(argsin, &resource, &pool); + if (s.rc != CMPI_RC_OK) + goto out; + + res = CMGetObjectPath(resource, &s); + if ((res == NULL) && (s.rc != CMPI_RC_OK)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get ObjectPath of Resource instance"); + goto out; + } + + if (res_type_from_rasd_classname(CLASSNAME(res), &type) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get resource type"); + goto out; + } + + if (type == CIM_RES_TYPE_DISK) + type = CIM_RES_TYPE_IMAGE; + + if (cu_get_str_prop(resource, "Address", &id) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing Address in resource RASD"); + goto out; + } + + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); + if (conn == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "libvirt connection failed"); + goto out; + } + + if (delete_resource(conn, id, type) == 0) { + virt_set_status(_BROKER, &s, + CMPI_RC_ERR_FAILED, + conn, + "Unable to delete resource"); + goto out; + } + + out: + virConnectClose(conn); + + if (s.rc == CMPI_RC_OK) + rc = CIM_SVPC_RETURN_COMPLETED; + CMReturnData(results, &rc, CMPI_uint32); + + return s; +} + static CMPIStatus dummy_handler(CMPIMethodMI *self, const CMPIContext *context, const CMPIResult *results, @@ -1014,6 +1113,15 @@ } }; +static struct method_handler DeleteResourceInPool = { + .name = "DeleteResourceInPool", + .handler = delete_resource_in_pool, + .args = {{"Resource", CMPI_instance, true}, + {"Pool", CMPI_ref, true}, + ARG_END + } +}; + static struct method_handler *my_handlers[] = { &CreateResourcePool, &CreateChildResourcePool, @@ -1021,6 +1129,7 @@ &RemoveResourcesFromResourcePool, &DeleteResourcePool, &CreateResourceInPool, + &DeleteResourceInPool, NULL, };