CIM
Threads by month
- ----- 2025 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- 3141 discussions
========================================================================
CIM Test Report for KVM on F9 with latest libvirt-cim and libcmpiutil
========================================================================
Distro : Fedora 9 Beta
Kernel : 2.6.25-0.121.rc5.git4.fc9
Libvirt : libvirt-0.4.2-1.fc9.x86_64
CIMOM : pegasus
PyWBEM : pywbem-0.6
CIM Schema : cimv216Experimental
LibCMPIutil : 76
LibVirtCIM : 580
CIMTEST : 130
=======================================================
PASS : 94
FAIL : 14
XFAIL : 4
SKIP : 17
-----------------
Total : 129
=======================================================
List of tc that are failing
ComputerSystem - 40_RSC_start.py: FAIL
ComputerSystemIndication - 01_created_indication.py: FAIL
ElementCapabilities - 01_forward.py: FAIL
ElementSettingData - 01_forward.py: FAIL
HostSystem - 03_hs_to_settdefcap.py: FAIL
Memory - 02_defgetmem.py: FAIL
NetworkPort - 03_user_netport.py: FAIL
Processor - 02_definesys_get_procs.py: FAIL
SettingsDefine - 02_reverse.py: FAIL
VSSD - 03_vssd_gi_errs.py: FAIL
VirtualSystemManagementService - 01_definesystem_name.py: FAIL
VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL
VirtualSystemManagementService - 06_addresource.py: FAIL
VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py
Please find the complete report attached with the mail.
Thanks and Regards,
Deepti.
------------------------------------------------------------------------
Starting test suite: libvirt-cim
Cleaned log files.
Testing KVM hypervisor
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: XFAIL Bug: 85769
ERROR - ERROR: VS DomST1 transition from Defined State to Activate state was not Successful
Bug:<85769>
ComputerSystem - 06_paused_active_suspend.py: XFAIL Bug: 85769
ERROR - ERROR: VS DomST1 transition from suspend State to Activate state was not Successful
Bug:<85769>
ComputerSystem - 22_define_suspend.py: PASS
ComputerSystem - 23_suspend_suspend.py: SKIP
ComputerSystem - 27_define_suspend_errs.py: SKIP
ComputerSystem - 32_start_reboot.py: SKIP
ComputerSystem - 33_suspend_reboot.py: SKIP
ComputerSystem - 35_start_reset.py: SKIP
ComputerSystem - 40_RSC_start.py: FAIL
ERROR - Unexpected rc code 1 and description:
CIM_ERR_FAILED: ResourceSettings Error: Resource type not supported on this platform
ERROR - Exception: ('Unable create domain %s using DefineSystem()', 'test_domain')
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Resource type not supported on this platform
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: PASS
ComputerSystemIndication - 01_created_indication.py: FAIL
ERROR - error : (110, 'Connection timed out')
ElementAllocatedFromPool - 01_forward.py: SKIP
ElementAllocatedFromPool - 02_reverse.py: SKIP
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
ElementAllocatedFromPool - 04_forward_errs.py: PASS
ElementCapabilities - 01_forward.py: FAIL
ERROR - ElementCapabilities association classname error
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: FAIL
ERROR - ElementSettingData returned 0 ProcResourceAllocationSettingData instances
ERROR - Unable to get associated ResourceAllocationSettingData from ElementSettingData
CIM_ERR_NOT_FOUND: No such instance (domu/proc)
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 - Error checking RASD attribute values 'propertypolicy'
HostSystem - 04_hs_to_EAPF.py: SKIP
HostSystem - 05_hs_gi_errs.py: PASS
HostSystem - 06_hs_to_vsms.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
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: FAIL
ERROR - Unexpected rc code 1 and description:
CIM_ERR_FAILED: ResourceSettings Error: Resource type not supported on this platform
ERROR - Exception: Unable to create domain domu using DefineSys()
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Resource type not supported on this platform
Memory - 03_mem_gi_errs.py: PASS
NetworkPort - 01_netport.py: PASS
NetworkPort - 02_np_gi_errors.py: PASS
NetworkPort - 03_user_netport.py: FAIL
ERROR - Exception: (6, u'CIM_ERR_NOT_FOUND: No such instance (test_domain/00:11:22:33:44:55)')
Processor - 01_processor.py: PASS
Processor - 02_definesys_get_procs.py: FAIL
ERROR - Unexpected rc code 1 and description:
CIM_ERR_FAILED: ResourceSettings Error: Resource type not supported on this platform
ERROR - Exception: Unable create domain test_domain using DefineSystem()
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Resource type not supported on this platform
Processor - 03_proc_gi_errs.py: PASS
Profile - 01_enum.py: PASS
Profile - 02_profile_to_elec.py: SKIP
Profile - 03_rprofile_gi_errs.py: SKIP
RASD - 01_verify_rasd_fields.py: PASS
RASD - 02_enum.py: PASS
RASD - 03_rasd_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: XFAIL Bug: 92173
ERROR - Unexpected rc code 1 and description CIM_ERR_FAILED: Unknown Method
InvokeMethod(AddResourcesToResourcePool): CIM_ERR_FAILED: Unknown Method
Bug:<92173>
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS
SettingsDefine - 01_forward.py: PASS
SettingsDefine - 02_reverse.py: FAIL
ERROR - Mistmatching value for VSSDComponent association
CIM_ERR_NOT_FOUND: No such instance (virtgst/proc)
SettingsDefine - 03_sds_fwd_errs.py: PASS
SettingsDefine - 04_sds_rev_errs.py: PASS
SettingsDefineCapabilities - 01_forward.py: SKIP
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 - 04_vssd_to_rasd.py: PASS
VirtualSystemManagementCapabilities - 01_enum.py: PASS
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
VirtualSystemManagementService - 01_definesystem_name.py: FAIL
ERROR - Unexpected rc code 1 and description:
CIM_ERR_FAILED: ResourceSettings Error: Resource type not supported on this platform
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Resource type not supported on this platform
VirtualSystemManagementService - 02_destroysystem.py: PASS
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL
ERROR - destroy_fail>>noname: Error executing DestroySystem, exception details below
ERROR - (1, u'CIM_ERR_FAILED: Unable to retrieve domain name.')
ERROR - destroy_fail>>nonexistent: Error executing DestroySystem, exception details below
ERROR - (1, u'CIM_ERR_FAILED: Failed to find domain')
InvokeMethod(DestroySystem): CIM_ERR_FAILED: Unable to retrieve domain name.
InvokeMethod(DestroySystem): CIM_ERR_FAILED: Failed to find domain
VirtualSystemManagementService - 06_addresource.py: FAIL
ERROR - Error invoking AddRS
ERROR - (1, u'CIM_ERR_FAILED: Failed to create domain')
InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Failed to create domain
VirtualSystemManagementService - 07_addresource_neg.py: PASS
VirtualSystemManagementService - 08_modifyresource.py: XFAIL Bug: 90853
ERROR - Error invoking ModifyRS
ERROR - (1, u'CIM_ERR_FAILED: Failed to create domain')
InvokeMethod(ModifyResourceSettings): CIM_ERR_FAILED: Failed to create domain
Bug:<90853>
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
VirtualSystemMigrationSettingData - 01_enum.py: PASS
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS
VirtualSystemSettingDataComponent - 01_forward.py: SKIP
VirtualSystemSettingDataComponent - 02_reverse.py: PASS
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS
VirtualSystemSnapshotService - 01_enum.py: PASS
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS
2
6

[PATCH] [TEST] changed ComputerSystem.03 tc for LXC support as an example
by Guo Lian Yun 20 May '08
by Guo Lian Yun 20 May '08
20 May '08
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1211270175 25200
# Node ID 4fc59e7a047e9b662979c6bcd7267f1201663280
# Parent b2b2bb6cc8d87ba0eeddcf3d361d3085104d3492
[TEST] changed ComputerSystem.03 tc for LXC support as an example
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r b2b2bb6cc8d8 -r 4fc59e7a047e suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Mon May 19 10:43:33 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Tue May 20 00:56:15 2008 -0700
@@ -30,12 +30,14 @@ from XenKvmLib import computersystem
from XenKvmLib import computersystem
from XenKvmLib import vxml
from XenKvmLib.classes import get_typed_class
+from XenKvmLib.const import LXC_init_path
from VirtLib import utils
+from XenKvmLib.common_util import create_lxc_file
from CimTest import Globals
from CimTest.Globals import do_main
from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen', 'KVM', 'XenFV']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "domU1"
@do_main(sup_types)
@@ -43,6 +45,7 @@ def main():
options = main.options
status = FAIL
+ create_lxc_file(LXC_init_path)
cxml = vxml.get_class(options.virt)(test_dom)
rc = cxml.define(options.ip)
if not rc:
diff -r b2b2bb6cc8d8 -r 4fc59e7a047e suites/libvirt-cim/lib/XenKvmLib/computersystem.py
--- a/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Mon May 19 10:43:33 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/computersystem.py Tue May 20 00:56:15 2008 -0700
@@ -69,6 +69,9 @@ class KVM_ComputerSystem(CIM_System):
class KVM_ComputerSystem(CIM_System):
pass
+class LXC_ComputerSystem(CIM_System):
+ pass
+
def get_cs_class(virt):
if virt in virt_types:
return eval(get_typed_class(virt, 'ComputerSystem'))
2
1

[PATCH 0 of 3] [TEST] #2 resubmit LXC support for cimtest, mainly modified LXCXML description based on Kaitlin's suggestion
by Guo Lian Yun 20 May '08
by Guo Lian Yun 20 May '08
20 May '08
2
4
Hi all,
I just posted and tagged libvirt-cim-0.4 as well as libcmpiutil-0.4.
Both are available in the downloads section on the website. They
represent the latest set of features and fixes for both packages.
I will update the Fedora RPMs soon, which should make our test reports
on F9 look a lot better.
Thanks!
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
1
0
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1211297079 14400
# Node ID f00dd77c664c258551c5f884a0bee5d842241e4e
# Parent c949b1845113e11e01329abb5aa81ca6ade8e3ec
(#4) ProcessorRASD, the class that won't go away
Around and round we go on the merry-go-round of indecision, hopefully for our last ride. The definitely probably absolutely tentative final plan is that the default representation of processors as virt_device structs will be one per domain, with a quantity. Virt_Devices will just need to be told how to handle that, and all the RASD stuff will be much happier for it. And then we will never speak of this again.
So today being my last official day on the team, I kind of have to get this out in a not perfect state. From what I can see it does what it is supposed to do, but it is entirely possible (likely?) that there are a few things in here that aren't really great things to do. I wish I could polish it more but I think I've at least got it to the point where any work left to be done is generic "not a great idea in C" problems, as opposed to the much more annoying "what exactly are we supposed to do in this case" problems.
Changes from 1 to 2:
Close brace on if block. That one is really embarrassing; I have no idea what happened there. I mean that crap won't even compile.
Removed unnecessary proc_found boolean. That was me being lazy after changing my mind on something.
Cleaned up a couple leftover CU_DEBUG calls.
Addition of vcpu_inst function, which is similar to vcpu_instances but always only works on one instance and takes a dev_id. This is to prevent all instances from being given a dev_id of zero. It is unfortunately similar to vcpu_instances in other regards, but I'm not sure if it's worth the overhead of trying to combine the similar parts.
Fixed quantity v number problem in xml_parse_test that I appear to have been failing to address for about six years.
Changes from 2 to 3:
Actually include changes needed for associations.
Make vcpu_instances use vcpu_inst.
Changes from 3 to 4:
Rename list_devs to something more meaningful
Fix misplaced free.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c949b1845113 -r f00dd77c664c libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/device_parsing.c Tue May 20 11:24:39 2008 -0400
@@ -337,7 +337,6 @@ static int parse_vcpu_device(xmlNode *no
struct virt_device *list = NULL;
char *count_str;
int count;
- int i;
count_str = get_node_content(node);
if (count_str == NULL)
@@ -347,24 +346,15 @@ static int parse_vcpu_device(xmlNode *no
free(count_str);
- list = calloc(count, sizeof(*list));
+ list = calloc(1, sizeof(*list));
if (list == NULL)
goto err;
-
- for (i = 0; i < count; i++) {
- struct virt_device *vdev = &list[i];
- struct vcpu_device *cdev = &vdev->dev.vcpu;
-
- cdev->number = i;
-
- vdev->type = CIM_RES_TYPE_PROC;
- if (asprintf(&vdev->id, "%i", i) == -1)
- vdev->id = NULL;
- }
+
+ list->dev.vcpu.quantity = count;
*vdevs = list;
- return count;
+ return 1;
err:
free(list);
@@ -620,7 +610,7 @@ struct virt_device *virt_device_dup(stru
dev->dev.mem.size = _dev->dev.mem.size;
dev->dev.mem.maxsize = _dev->dev.mem.maxsize;
} else if (dev->type == CIM_RES_TYPE_PROC) {
- dev->dev.vcpu.number = _dev->dev.vcpu.number;
+ dev->dev.vcpu.quantity = _dev->dev.vcpu.quantity;
} else if (dev->type == CIM_RES_TYPE_EMU) {
DUP_FIELD(dev, _dev, dev.emu.path);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
@@ -672,6 +662,32 @@ static int _get_mem_device(const char *x
return 1;
}
+static int _get_proc_device(const char *xml, struct virt_device **list)
+{
+ struct virt_device *proc_devs = NULL;
+ struct virt_device *proc_dev = NULL;
+ int ret;
+
+ ret = parse_devices(xml, &proc_devs, CIM_RES_TYPE_PROC);
+ if (ret <= 0)
+ return ret;
+
+ proc_dev = malloc(sizeof(*proc_dev));
+ if (proc_dev == NULL)
+ return 0;
+
+ memset(proc_dev, 0, sizeof(*proc_dev));
+
+ proc_dev->type = CIM_RES_TYPE_PROC;
+ proc_dev->id = strdup("proc");
+ proc_dev->dev.vcpu.quantity = proc_devs[0].dev.vcpu.quantity;
+ *list = proc_dev;
+
+ cleanup_virt_devices(&proc_devs, ret);
+
+ return 1;
+};
+
int get_devices(virDomainPtr dom, struct virt_device **list, int type)
{
char *xml;
@@ -683,6 +699,8 @@ int get_devices(virDomainPtr dom, struct
if (type == CIM_RES_TYPE_MEM)
ret = _get_mem_device(xml, list);
+ else if (type == CIM_RES_TYPE_PROC)
+ ret = _get_proc_device(xml, list);
else
ret = parse_devices(xml, list, type);
diff -r c949b1845113 -r f00dd77c664c libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/device_parsing.h Tue May 20 11:24:39 2008 -0400
@@ -50,7 +50,7 @@ struct mem_device {
};
struct vcpu_device {
- uint64_t number;
+ uint64_t quantity;
};
struct emu_device {
diff -r c949b1845113 -r f00dd77c664c libxkutil/xml_parse_test.c
--- a/libxkutil/xml_parse_test.c Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/xml_parse_test.c Tue May 20 11:24:39 2008 -0400
@@ -96,7 +96,7 @@ static void print_dev_vcpu(struct virt_d
static void print_dev_vcpu(struct virt_device *dev,
FILE *d)
{
- print_u64(d, "Virtual CPU", dev->dev.vcpu.number);
+ print_u64(d, "Virtual CPU", dev->dev.vcpu.quantity);
}
static void print_dev_emu(struct virt_device *dev,
diff -r c949b1845113 -r f00dd77c664c src/Virt_Device.c
--- a/src/Virt_Device.c Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_Device.c Tue May 20 11:24:39 2008 -0400
@@ -174,23 +174,6 @@ static CMPIInstance *mem_instance(const
return inst;
}
-static CMPIInstance *vcpu_instance(const CMPIBroker *broker,
- struct vcpu_device *dev,
- const virDomainPtr dom,
- const char *ns)
-{
- CMPIInstance *inst;
- virConnectPtr conn;
-
- conn = virDomainGetConnect(dom);
- inst = get_typed_instance(broker,
- pfx_from_conn(conn),
- "Processor",
- ns);
-
- return inst;
-}
-
static int device_set_devid(CMPIInstance *instance,
struct virt_device *dev,
const virDomainPtr dom)
@@ -229,43 +212,127 @@ static int device_set_systemname(CMPIIns
return 1;
}
-static CMPIInstance *device_instance(const CMPIBroker *broker,
- struct virt_device *dev,
- const virDomainPtr dom,
- const char *ns)
+static char *get_vcpu_inst_id(const virDomainPtr dom,
+ int proc_num)
{
- CMPIInstance *instance;
+ int rc;
+ char *id_num = NULL;
+ char *dev_id = NULL;
- if (dev->type == CIM_RES_TYPE_NET)
- instance = net_instance(broker,
- &dev->dev.net,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_DISK)
- instance = disk_instance(broker,
- &dev->dev.disk,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_MEM)
- instance = mem_instance(broker,
- &dev->dev.mem,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_PROC)
- instance = vcpu_instance(broker,
- &dev->dev.vcpu,
- dom,
- ns);
- else
- return NULL;
+ rc = asprintf(&id_num, "%d", proc_num);
+ if (rc == -1) {
+ free(dev_id);
+ dev_id = NULL;
+ goto out;
+ }
+
+ dev_id = get_fq_devid((char *)virDomainGetName(dom), id_num);
+ free(id_num);
- if (!instance)
- return NULL;
+ out:
+ return dev_id;
+}
- device_set_devid(instance, dev, dom);
- device_set_systemname(instance, dom);
+static bool vcpu_inst(const CMPIBroker *broker,
+ const virDomainPtr dom,
+ const char *ns,
+ int dev_id_num,
+ struct inst_list *list)
+{
+ char *dev_id;
+ CMPIInstance *inst;
+ virConnectPtr conn = NULL;
- return instance;
+ conn = virDomainGetConnect(dom);
+ inst = get_typed_instance(broker,
+ pfx_from_conn(conn),
+ "Processor",
+ ns);
+ if (inst == NULL)
+ return false;
+
+ dev_id = get_vcpu_inst_id(dom, dev_id_num);
+ CMSetProperty(inst, "DeviceID",
+ (CMPIValue *)dev_id, CMPI_chars);
+ free(dev_id);
+
+ device_set_systemname(inst, dom);
+ inst_list_add(list, inst);
+
+ return true;
+}
+
+static bool vcpu_instances(const CMPIBroker *broker,
+ const virDomainPtr dom,
+ const char *ns,
+ uint64_t proc_count,
+ struct inst_list *list)
+{
+ int i;
+ bool rc;
+
+ for (i = 0; i < proc_count; i++) {
+ rc = vcpu_inst(broker, dom, ns, i, list);
+ if (!rc)
+ return false;
+ }
+
+ return true;
+}
+
+static bool device_instances(const CMPIBroker *broker,
+ struct virt_device *devs,
+ int count,
+ const virDomainPtr dom,
+ const char *ns,
+ struct inst_list *list)
+{
+ int i;
+ bool ret;
+ uint64_t proc_count = 0;
+ CMPIInstance *instance = NULL;
+
+ for (i = 0; i < count; i++) {
+ struct virt_device *dev = &devs[i];
+
+ if (dev->type == CIM_RES_TYPE_NET)
+ instance = net_instance(broker,
+ &dev->dev.net,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_DISK)
+ instance = disk_instance(broker,
+ &dev->dev.disk,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_MEM)
+ instance = mem_instance(broker,
+ &dev->dev.mem,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_PROC) {
+ proc_count = dev->dev.vcpu.quantity;
+ continue;
+ } else
+ return false;
+
+ if (!instance)
+ return false;
+
+ device_set_devid(instance, dev, dom);
+ device_set_systemname(instance, dom);
+ inst_list_add(list, instance);
+ }
+
+ if (proc_count) {
+ ret = vcpu_instances(broker,
+ dom,
+ ns,
+ proc_count,
+ list);
+ }
+
+ return true;
}
uint16_t res_type_from_device_classname(const char *classname)
@@ -290,25 +357,27 @@ static CMPIStatus _get_devices(const CMP
{
CMPIStatus s = {CMPI_RC_OK, NULL};
int count;
- int i;
+ bool rc;
struct virt_device *devs = NULL;
count = get_devices(dom, &devs, type);
if (count <= 0)
goto out;
- for (i = 0; i < count; i++) {
- CMPIInstance *dev = NULL;
+ rc = device_instances(broker,
+ devs,
+ count,
+ dom,
+ NAMESPACE(reference),
+ list);
- dev = device_instance(broker,
- &devs[i],
- dom,
- NAMESPACE(reference));
- if (dev)
- inst_list_add(list, dev);
+ if (!rc) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Couldn't get device instances");
+ }
- cleanup_virt_device(&devs[i]);
- }
+ cleanup_virt_devices(&devs, count);
out:
free(devs);
@@ -427,6 +496,29 @@ static int parse_devid(const char *devid
return 1;
}
+static int proc_dev_list(uint64_t quantity,
+ struct virt_device **list)
+{
+ int i;
+ int rc;
+
+
+ *list = (struct virt_device *)calloc(quantity,
+ sizeof(struct virt_device));
+
+ for (i = 0; i < quantity; i++) {
+ char *dev_num;
+
+ rc = asprintf(&dev_num, "%d", i);
+
+ (*list)[i].id = strdup(dev_num);
+
+ free(dev_num);
+ }
+
+ return quantity;
+}
+
static struct virt_device *find_dom_dev(virDomainPtr dom,
char *device,
int type)
@@ -439,6 +531,17 @@ static struct virt_device *find_dom_dev(
count = get_devices(dom, &list, type);
if (!count)
goto out;
+
+ if (type == CIM_RES_TYPE_PROC) {
+ struct virt_device *tmp_list;
+ int tmp_count;
+
+ tmp_count = proc_dev_list(list[0].dev.vcpu.quantity,
+ &tmp_list);
+ cleanup_virt_devices(&list, count);
+ list = tmp_list;
+ count = tmp_count;
+ }
for (i = 0; i < count; i++) {
if (STREQC(device, list[i].id))
@@ -462,10 +565,13 @@ CMPIStatus get_device_by_name(const CMPI
CMPIStatus s = {CMPI_RC_OK, NULL};
char *domain = NULL;
char *device = NULL;
- CMPIInstance *instance = NULL;
virConnectPtr conn = NULL;
virDomainPtr dom = NULL;
struct virt_device *dev = NULL;
+ struct inst_list tmp_list;
+ bool rc;
+
+ inst_list_init(&tmp_list);
conn = connect_by_classname(broker, CLASSNAME(reference), &s);
if (conn == NULL) {
@@ -501,13 +607,30 @@ CMPIStatus get_device_by_name(const CMPI
goto err;
}
- instance = device_instance(broker,
- dev,
- dom,
- NAMESPACE(reference));
+ if (type == CIM_RES_TYPE_PROC) {
+ int ret;
+ int dev_id_num;
+
+ ret = sscanf(dev->id, "%d", &dev_id_num);
+
+ rc = vcpu_inst(broker,
+ dom,
+ NAMESPACE(reference),
+ dev_id_num,
+ &tmp_list);
+ } else {
+
+ rc = device_instances(broker,
+ dev,
+ 1,
+ dom,
+ NAMESPACE(reference),
+ &tmp_list);
+ }
+
cleanup_virt_device(dev);
- *_inst = instance;
+ *_inst = tmp_list.list[0];
err:
virDomainFree(dom);
@@ -515,6 +638,7 @@ CMPIStatus get_device_by_name(const CMPI
free(device);
out:
+ inst_list_free(&tmp_list);
virConnectClose(conn);
return s;
diff -r c949b1845113 -r f00dd77c664c src/Virt_RASD.c
--- a/src/Virt_RASD.c Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_RASD.c Tue May 20 11:24:39 2008 -0400
@@ -31,7 +31,6 @@
#include <libcmpiutil/libcmpiutil.h>
#include <libcmpiutil/std_instance.h>
-#include "device_parsing.h"
#include "misc_util.h"
#include "cs_util.h"
@@ -56,10 +55,10 @@ static struct virt_device *_find_dev(str
return NULL;
}
-static int list_devs(virConnectPtr conn,
- const uint16_t type,
- const char *host,
- struct virt_device **list)
+int list_rasds(virConnectPtr conn,
+ const uint16_t type,
+ const char *host,
+ struct virt_device **list)
{
virDomainPtr dom;
@@ -79,7 +78,7 @@ static struct virt_device *find_dev(virC
struct virt_device *list = NULL;
struct virt_device *dev = NULL;
- count = list_devs(conn, type, host, &list);
+ count = list_rasds(conn, type, host, &list);
if (count > 0) {
dev = _find_dev(list, count, devid);
cleanup_virt_devices(&list, count);
@@ -173,10 +172,8 @@ static CMPIInstance *rasd_from_vdev(cons
CMSetProperty(inst, "Limit",
(CMPIValue *)&dev->dev.mem.maxsize, CMPI_uint64);
} else if (dev->type == CIM_RES_TYPE_PROC) {
- /* This would be the place to set the virtualquantity. */
- uint64_t quantity = dev->dev.vcpu.number + 1;
CMSetProperty(inst, "VirtualQuantity",
- (CMPIValue *)&quantity, CMPI_uint64);
+ (CMPIValue *)&dev->dev.vcpu.quantity, CMPI_uint64);
}
/* FIXME: Put the HostResource in place */
diff -r c949b1845113 -r f00dd77c664c src/Virt_RASD.h
--- a/src/Virt_RASD.h Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_RASD.h Tue May 20 11:24:39 2008 -0400
@@ -20,6 +20,8 @@
*/
#ifndef __VIRT_RASD_H
#define __VIRT_RASD_H
+
+#include "device_parsing.h"
char *rasd_to_xml(CMPIInstance *rasd);
@@ -55,6 +57,10 @@ CMPIStatus get_rasd_by_ref(const CMPIBro
const char **properties,
CMPIInstance **_inst);
+int list_rasds(virConnectPtr conn,
+ const uint16_t type,
+ const char *host,
+ struct virt_device **list);
#endif
/*
diff -r c949b1845113 -r f00dd77c664c src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_SettingsDefineState.c Tue May 20 11:24:39 2008 -0400
@@ -39,13 +39,95 @@
const static CMPIBroker *_BROKER;
+static int get_proc_dev_count(const char *name,
+ const char *cn,
+ uint16_t type,
+ char *host,
+ CMPIStatus *s)
+{
+ virConnectPtr conn = NULL;
+ struct virt_device *list = NULL;
+ struct virt_device *dev = NULL;
+ int dev_count = -1;
+ int count = -1;
+
+ conn = connect_by_classname(_BROKER, cn, s);
+ if (conn == NULL) {
+ cu_statusf(_BROKER, s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "No such instance (%s)",
+ name);
+ goto out;
+ }
+
+ dev_count = list_rasds(conn, type, host, &list);
+ if (dev_count <= 0) {
+ cu_statusf(_BROKER, s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get list of processors");
+ goto out;
+ }
+
+ dev = &list[0];
+ count = dev->dev.vcpu.quantity;
+
+ cleanup_virt_devices(&list, dev_count);
+
+ out:
+ virConnectClose(conn);
+ return count;
+}
+
+static char *get_rasd_id(const CMPIInstance *inst, uint16_t type)
+{
+ char *id = NULL;
+ int ret;
+ const char *tmp;
+
+ if (type == CIM_RES_TYPE_PROC) {
+ ret = cu_get_str_prop(inst, "SystemName", &tmp);
+ if (ret != CMPI_RC_OK) {
+ CU_DEBUG("No SystemName in device instance");
+ goto out;
+ }
+
+ ret = asprintf(&id, "%s/proc", tmp);
+ if (ret == -1) {
+ id = NULL;
+ goto out;
+ }
+ } else {
+ ret = cu_get_str_prop(inst, "DeviceID", &tmp);
+ if (ret != CMPI_RC_OK) {
+ CU_DEBUG("No DeviceID in device instance");
+ id = NULL;
+ goto out;
+ }
+
+ id = strdup(tmp);
+ }
+
+ out:
+ return id;
+}
+
+static char *get_dev_id(const char *host, int devid)
+{
+ char *id = NULL;
+
+ if (asprintf(&id, "%s/%d", host, devid) == -1)
+ id = NULL;
+
+ return id;
+}
+
static CMPIStatus dev_to_rasd(const CMPIObjectPath *ref,
struct std_assoc_info *info,
struct inst_list *list)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
- const char *name = NULL;
+ char *id = NULL;
if (!match_hypervisor_prefix(ref, info))
return s;
@@ -54,16 +136,18 @@ static CMPIStatus dev_to_rasd(const CMPI
if (s.rc != CMPI_RC_OK)
goto out;
- if (cu_get_str_path(ref, "DeviceID", &name) != CMPI_RC_OK) {
+ id = get_rasd_id(inst,
+ res_type_from_device_classname(CLASSNAME(ref)));
+ if (id == NULL) {
cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Missing DeviceID");
+ CMPI_RC_ERR_NOT_FOUND,
+ "Unable to get RASD id from DeviceID");
goto out;
- }
+ }
s = get_rasd_by_name(_BROKER,
ref,
- name,
+ id,
res_type_from_device_classname(CLASSNAME(ref)),
NULL,
&inst);
@@ -73,6 +157,7 @@ static CMPIStatus dev_to_rasd(const CMPI
inst_list_add(list, inst);
out:
+ free(id);
return s;
}
@@ -83,7 +168,12 @@ static CMPIStatus rasd_to_dev(const CMPI
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
const char *name = NULL;
+ char *host = NULL;
+ char *devid = NULL;
+ char *id = NULL;
uint16_t type;
+ int count = 1;
+ int i;
if (!match_hypervisor_prefix(ref, info))
return s;
@@ -92,6 +182,13 @@ static CMPIStatus rasd_to_dev(const CMPI
if (s.rc != CMPI_RC_OK)
goto out;
+ if (res_type_from_rasd_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing ResourceType");
+ goto out;
+ }
+
if (cu_get_str_path(ref, "InstanceID", &name) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
@@ -99,20 +196,48 @@ static CMPIStatus rasd_to_dev(const CMPI
goto out;
}
- if (res_type_from_rasd_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Missing ResourceType");
- goto out;
+ if (type == CIM_RES_TYPE_PROC) {
+ if (parse_fq_devid((char *)name, &host, &devid) != 1) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "No such instance (%s)",
+ name);
+ goto out;
+ }
+
+ count = get_proc_dev_count(name,
+ CLASSNAME(ref),
+ type,
+ host,
+ &s);
+ if (count <= 0)
+ goto out;
}
- s = get_device_by_name(_BROKER, ref, name, type, &inst);
- if (s.rc != CMPI_RC_OK)
- goto out;
+ for (i = 0; i < count; i++) {
+ if (type == CIM_RES_TYPE_PROC)
+ id = get_dev_id(host, i);
+ else
+ id = strdup(name);
- inst_list_add(list, inst);
+ if (id == NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "Unable to get RASD id from DeviceID");
+ goto out;
+ }
+
+ s = get_device_by_name(_BROKER, ref, id, type, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ inst_list_add(list, inst);
+ free(id);
+ }
out:
+ free(host);
+ free(devid);
return s;
}
2
1
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1211291977 14400
# Node ID d18a3d2d57a9402f9db8993212ed24316e05d657
# Parent c949b1845113e11e01329abb5aa81ca6ade8e3ec
(#3) ProcessorRASD, the class that won't go away
Around and round we go on the merry-go-round of indecision, hopefully for our last ride. The definitely probably absolutely tentative final plan is that the default representation of processors as virt_device structs will be one per domain, with a quantity. Virt_Devices will just need to be told how to handle that, and all the RASD stuff will be much happier for it. And then we will never speak of this again.
So today being my last official day on the team, I kind of have to get this out in a not perfect state. From what I can see it does what it is supposed to do, but it is entirely possible (likely?) that there are a few things in here that aren't really great things to do. I wish I could polish it more but I think I've at least got it to the point where any work left to be done is generic "not a great idea in C" problems, as opposed to the much more annoying "what exactly are we supposed to do in this case" problems.
Changes from 1 to 2:
Close brace on if block. That one is really embarrassing; I have no idea what happened there. I mean that crap won't even compile.
Removed unnecessary proc_found boolean. That was me being lazy after changing my mind on something.
Cleaned up a couple leftover CU_DEBUG calls.
Addition of vcpu_inst function, which is similar to vcpu_instances but always only works on one instance and takes a dev_id. This is to prevent all instances from being given a dev_id of zero. It is unfortunately similar to vcpu_instances in other regards, but I'm not sure if it's worth the overhead of trying to combine the similar parts.
Fixed quantity v number problem in xml_parse_test that I appear to have been failing to address for about six years.
Changes from 2 to 3:
Actually include changes needed for associations.
Make vcpu_instances use vcpu_inst.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c949b1845113 -r d18a3d2d57a9 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/device_parsing.c Tue May 20 09:59:37 2008 -0400
@@ -337,7 +337,6 @@ static int parse_vcpu_device(xmlNode *no
struct virt_device *list = NULL;
char *count_str;
int count;
- int i;
count_str = get_node_content(node);
if (count_str == NULL)
@@ -347,24 +346,15 @@ static int parse_vcpu_device(xmlNode *no
free(count_str);
- list = calloc(count, sizeof(*list));
+ list = calloc(1, sizeof(*list));
if (list == NULL)
goto err;
-
- for (i = 0; i < count; i++) {
- struct virt_device *vdev = &list[i];
- struct vcpu_device *cdev = &vdev->dev.vcpu;
-
- cdev->number = i;
-
- vdev->type = CIM_RES_TYPE_PROC;
- if (asprintf(&vdev->id, "%i", i) == -1)
- vdev->id = NULL;
- }
+
+ list->dev.vcpu.quantity = count;
*vdevs = list;
- return count;
+ return 1;
err:
free(list);
@@ -620,7 +610,7 @@ struct virt_device *virt_device_dup(stru
dev->dev.mem.size = _dev->dev.mem.size;
dev->dev.mem.maxsize = _dev->dev.mem.maxsize;
} else if (dev->type == CIM_RES_TYPE_PROC) {
- dev->dev.vcpu.number = _dev->dev.vcpu.number;
+ dev->dev.vcpu.quantity = _dev->dev.vcpu.quantity;
} else if (dev->type == CIM_RES_TYPE_EMU) {
DUP_FIELD(dev, _dev, dev.emu.path);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
@@ -672,6 +662,32 @@ static int _get_mem_device(const char *x
return 1;
}
+static int _get_proc_device(const char *xml, struct virt_device **list)
+{
+ struct virt_device *proc_devs = NULL;
+ struct virt_device *proc_dev = NULL;
+ int ret;
+
+ ret = parse_devices(xml, &proc_devs, CIM_RES_TYPE_PROC);
+ if (ret <= 0)
+ return ret;
+
+ proc_dev = malloc(sizeof(*proc_dev));
+ if (proc_dev == NULL)
+ return 0;
+
+ memset(proc_dev, 0, sizeof(*proc_dev));
+
+ proc_dev->type = CIM_RES_TYPE_PROC;
+ proc_dev->id = strdup("proc");
+ proc_dev->dev.vcpu.quantity = proc_devs[0].dev.vcpu.quantity;
+ *list = proc_dev;
+
+ cleanup_virt_devices(&proc_devs, ret);
+
+ return 1;
+};
+
int get_devices(virDomainPtr dom, struct virt_device **list, int type)
{
char *xml;
@@ -683,6 +699,8 @@ int get_devices(virDomainPtr dom, struct
if (type == CIM_RES_TYPE_MEM)
ret = _get_mem_device(xml, list);
+ else if (type == CIM_RES_TYPE_PROC)
+ ret = _get_proc_device(xml, list);
else
ret = parse_devices(xml, list, type);
diff -r c949b1845113 -r d18a3d2d57a9 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/device_parsing.h Tue May 20 09:59:37 2008 -0400
@@ -50,7 +50,7 @@ struct mem_device {
};
struct vcpu_device {
- uint64_t number;
+ uint64_t quantity;
};
struct emu_device {
diff -r c949b1845113 -r d18a3d2d57a9 libxkutil/xml_parse_test.c
--- a/libxkutil/xml_parse_test.c Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/xml_parse_test.c Tue May 20 09:59:37 2008 -0400
@@ -96,7 +96,7 @@ static void print_dev_vcpu(struct virt_d
static void print_dev_vcpu(struct virt_device *dev,
FILE *d)
{
- print_u64(d, "Virtual CPU", dev->dev.vcpu.number);
+ print_u64(d, "Virtual CPU", dev->dev.vcpu.quantity);
}
static void print_dev_emu(struct virt_device *dev,
diff -r c949b1845113 -r d18a3d2d57a9 src/Virt_Device.c
--- a/src/Virt_Device.c Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_Device.c Tue May 20 09:59:37 2008 -0400
@@ -174,23 +174,6 @@ static CMPIInstance *mem_instance(const
return inst;
}
-static CMPIInstance *vcpu_instance(const CMPIBroker *broker,
- struct vcpu_device *dev,
- const virDomainPtr dom,
- const char *ns)
-{
- CMPIInstance *inst;
- virConnectPtr conn;
-
- conn = virDomainGetConnect(dom);
- inst = get_typed_instance(broker,
- pfx_from_conn(conn),
- "Processor",
- ns);
-
- return inst;
-}
-
static int device_set_devid(CMPIInstance *instance,
struct virt_device *dev,
const virDomainPtr dom)
@@ -229,43 +212,127 @@ static int device_set_systemname(CMPIIns
return 1;
}
-static CMPIInstance *device_instance(const CMPIBroker *broker,
- struct virt_device *dev,
- const virDomainPtr dom,
- const char *ns)
+static char *get_vcpu_inst_id(const virDomainPtr dom,
+ int proc_num)
{
- CMPIInstance *instance;
+ int rc;
+ char *id_num = NULL;
+ char *dev_id = NULL;
- if (dev->type == CIM_RES_TYPE_NET)
- instance = net_instance(broker,
- &dev->dev.net,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_DISK)
- instance = disk_instance(broker,
- &dev->dev.disk,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_MEM)
- instance = mem_instance(broker,
- &dev->dev.mem,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_PROC)
- instance = vcpu_instance(broker,
- &dev->dev.vcpu,
- dom,
- ns);
- else
- return NULL;
+ rc = asprintf(&id_num, "%d", proc_num);
+ if (rc == -1) {
+ free(dev_id);
+ dev_id = NULL;
+ goto out;
+ }
+
+ dev_id = get_fq_devid((char *)virDomainGetName(dom), id_num);
+ free(id_num);
- if (!instance)
- return NULL;
+ out:
+ return dev_id;
+}
- device_set_devid(instance, dev, dom);
- device_set_systemname(instance, dom);
+static bool vcpu_inst(const CMPIBroker *broker,
+ const virDomainPtr dom,
+ const char *ns,
+ int dev_id_num,
+ struct inst_list *list)
+{
+ char *dev_id;
+ CMPIInstance *inst;
+ virConnectPtr conn = NULL;
- return instance;
+ conn = virDomainGetConnect(dom);
+ inst = get_typed_instance(broker,
+ pfx_from_conn(conn),
+ "Processor",
+ ns);
+ if (inst == NULL)
+ return false;
+
+ dev_id = get_vcpu_inst_id(dom, dev_id_num);
+ CMSetProperty(inst, "DeviceID",
+ (CMPIValue *)dev_id, CMPI_chars);
+ free(dev_id);
+
+ device_set_systemname(inst, dom);
+ inst_list_add(list, inst);
+
+ return true;
+}
+
+static bool vcpu_instances(const CMPIBroker *broker,
+ const virDomainPtr dom,
+ const char *ns,
+ uint64_t proc_count,
+ struct inst_list *list)
+{
+ int i;
+ bool rc;
+
+ for (i = 0; i < proc_count; i++) {
+ rc = vcpu_inst(broker, dom, ns, i, list);
+ if (!rc)
+ return false;
+ }
+
+ return true;
+}
+
+static bool device_instances(const CMPIBroker *broker,
+ struct virt_device *devs,
+ int count,
+ const virDomainPtr dom,
+ const char *ns,
+ struct inst_list *list)
+{
+ int i;
+ bool ret;
+ uint64_t proc_count = 0;
+ CMPIInstance *instance = NULL;
+
+ for (i = 0; i < count; i++) {
+ struct virt_device *dev = &devs[i];
+
+ if (dev->type == CIM_RES_TYPE_NET)
+ instance = net_instance(broker,
+ &dev->dev.net,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_DISK)
+ instance = disk_instance(broker,
+ &dev->dev.disk,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_MEM)
+ instance = mem_instance(broker,
+ &dev->dev.mem,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_PROC) {
+ proc_count = dev->dev.vcpu.quantity;
+ continue;
+ } else
+ return false;
+
+ if (!instance)
+ return false;
+
+ device_set_devid(instance, dev, dom);
+ device_set_systemname(instance, dom);
+ inst_list_add(list, instance);
+ }
+
+ if (proc_count) {
+ ret = vcpu_instances(broker,
+ dom,
+ ns,
+ proc_count,
+ list);
+ }
+
+ return true;
}
uint16_t res_type_from_device_classname(const char *classname)
@@ -290,25 +357,27 @@ static CMPIStatus _get_devices(const CMP
{
CMPIStatus s = {CMPI_RC_OK, NULL};
int count;
- int i;
+ bool rc;
struct virt_device *devs = NULL;
count = get_devices(dom, &devs, type);
if (count <= 0)
goto out;
- for (i = 0; i < count; i++) {
- CMPIInstance *dev = NULL;
+ rc = device_instances(broker,
+ devs,
+ count,
+ dom,
+ NAMESPACE(reference),
+ list);
- dev = device_instance(broker,
- &devs[i],
- dom,
- NAMESPACE(reference));
- if (dev)
- inst_list_add(list, dev);
+ if (!rc) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Couldn't get device instances");
+ }
- cleanup_virt_device(&devs[i]);
- }
+ cleanup_virt_devices(&devs, count);
out:
free(devs);
@@ -427,6 +496,29 @@ static int parse_devid(const char *devid
return 1;
}
+static int proc_dev_list(uint64_t quantity,
+ struct virt_device **list)
+{
+ int i;
+ int rc;
+
+
+ *list = (struct virt_device *)calloc(quantity,
+ sizeof(struct virt_device));
+
+ for (i = 0; i < quantity; i++) {
+ char *dev_num;
+
+ rc = asprintf(&dev_num, "%d", i);
+
+ (*list)[i].id = strdup(dev_num);
+
+ free(dev_num);
+ }
+
+ return quantity;
+}
+
static struct virt_device *find_dom_dev(virDomainPtr dom,
char *device,
int type)
@@ -439,6 +531,17 @@ static struct virt_device *find_dom_dev(
count = get_devices(dom, &list, type);
if (!count)
goto out;
+
+ if (type == CIM_RES_TYPE_PROC) {
+ struct virt_device *tmp_list;
+ int tmp_count;
+
+ tmp_count = proc_dev_list(list[0].dev.vcpu.quantity,
+ &tmp_list);
+ cleanup_virt_devices(&list, count);
+ list = tmp_list;
+ count = tmp_count;
+ }
for (i = 0; i < count; i++) {
if (STREQC(device, list[i].id))
@@ -462,10 +565,13 @@ CMPIStatus get_device_by_name(const CMPI
CMPIStatus s = {CMPI_RC_OK, NULL};
char *domain = NULL;
char *device = NULL;
- CMPIInstance *instance = NULL;
virConnectPtr conn = NULL;
virDomainPtr dom = NULL;
struct virt_device *dev = NULL;
+ struct inst_list tmp_list;
+ bool rc;
+
+ inst_list_init(&tmp_list);
conn = connect_by_classname(broker, CLASSNAME(reference), &s);
if (conn == NULL) {
@@ -501,13 +607,30 @@ CMPIStatus get_device_by_name(const CMPI
goto err;
}
- instance = device_instance(broker,
- dev,
- dom,
- NAMESPACE(reference));
+ if (type == CIM_RES_TYPE_PROC) {
+ int ret;
+ int dev_id_num;
+
+ ret = sscanf(dev->id, "%d", &dev_id_num);
+
+ rc = vcpu_inst(broker,
+ dom,
+ NAMESPACE(reference),
+ dev_id_num,
+ &tmp_list);
+ } else {
+
+ rc = device_instances(broker,
+ dev,
+ 1,
+ dom,
+ NAMESPACE(reference),
+ &tmp_list);
+ }
+
cleanup_virt_device(dev);
- *_inst = instance;
+ *_inst = tmp_list.list[0];
err:
virDomainFree(dom);
@@ -515,6 +638,7 @@ CMPIStatus get_device_by_name(const CMPI
free(device);
out:
+ inst_list_free(&tmp_list);
virConnectClose(conn);
return s;
diff -r c949b1845113 -r d18a3d2d57a9 src/Virt_RASD.c
--- a/src/Virt_RASD.c Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_RASD.c Tue May 20 09:59:37 2008 -0400
@@ -31,7 +31,6 @@
#include <libcmpiutil/libcmpiutil.h>
#include <libcmpiutil/std_instance.h>
-#include "device_parsing.h"
#include "misc_util.h"
#include "cs_util.h"
@@ -56,10 +55,10 @@ static struct virt_device *_find_dev(str
return NULL;
}
-static int list_devs(virConnectPtr conn,
- const uint16_t type,
- const char *host,
- struct virt_device **list)
+int list_devs(virConnectPtr conn,
+ const uint16_t type,
+ const char *host,
+ struct virt_device **list)
{
virDomainPtr dom;
@@ -173,10 +172,8 @@ static CMPIInstance *rasd_from_vdev(cons
CMSetProperty(inst, "Limit",
(CMPIValue *)&dev->dev.mem.maxsize, CMPI_uint64);
} else if (dev->type == CIM_RES_TYPE_PROC) {
- /* This would be the place to set the virtualquantity. */
- uint64_t quantity = dev->dev.vcpu.number + 1;
CMSetProperty(inst, "VirtualQuantity",
- (CMPIValue *)&quantity, CMPI_uint64);
+ (CMPIValue *)&dev->dev.vcpu.quantity, CMPI_uint64);
}
/* FIXME: Put the HostResource in place */
diff -r c949b1845113 -r d18a3d2d57a9 src/Virt_RASD.h
--- a/src/Virt_RASD.h Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_RASD.h Tue May 20 09:59:37 2008 -0400
@@ -20,6 +20,8 @@
*/
#ifndef __VIRT_RASD_H
#define __VIRT_RASD_H
+
+#include "device_parsing.h"
char *rasd_to_xml(CMPIInstance *rasd);
@@ -55,6 +57,10 @@ CMPIStatus get_rasd_by_ref(const CMPIBro
const char **properties,
CMPIInstance **_inst);
+int list_devs(virConnectPtr conn,
+ const uint16_t type,
+ const char *host,
+ struct virt_device **list);
#endif
/*
diff -r c949b1845113 -r d18a3d2d57a9 src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_SettingsDefineState.c Tue May 20 09:59:37 2008 -0400
@@ -39,13 +39,95 @@
const static CMPIBroker *_BROKER;
+static int get_proc_dev_count(const char *name,
+ const char *cn,
+ uint16_t type,
+ char *host,
+ CMPIStatus *s)
+{
+ virConnectPtr conn = NULL;
+ struct virt_device *list = NULL;
+ struct virt_device *dev = NULL;
+ int dev_count = -1;
+ int count = -1;
+
+ conn = connect_by_classname(_BROKER, cn, s);
+ if (conn == NULL) {
+ cu_statusf(_BROKER, s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "No such instance (%s)",
+ name);
+ goto out;
+ }
+
+ dev_count = list_devs(conn, type, host, &list);
+ if (dev_count <= 0) {
+ cu_statusf(_BROKER, s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get list of processors");
+ goto out;
+ }
+
+ dev = &list[0];
+ count = dev->dev.vcpu.quantity;
+
+ cleanup_virt_devices(&list, dev_count);
+
+ out:
+ virConnectClose(conn);
+ return count;
+}
+
+static char *get_rasd_id(const CMPIInstance *inst, uint16_t type)
+{
+ char *id = NULL;
+ int ret;
+ const char *tmp;
+
+ if (type == CIM_RES_TYPE_PROC) {
+ ret = cu_get_str_prop(inst, "SystemName", &tmp);
+ if (ret != CMPI_RC_OK) {
+ CU_DEBUG("No SystemName in device instance");
+ goto out;
+ }
+
+ ret = asprintf(&id, "%s/proc", tmp);
+ if (ret == -1) {
+ id = NULL;
+ goto out;
+ }
+ } else {
+ ret = cu_get_str_prop(inst, "DeviceID", &tmp);
+ if (ret != CMPI_RC_OK) {
+ CU_DEBUG("No DeviceID in device instance");
+ id = NULL;
+ goto out;
+ }
+
+ id = strdup(tmp);
+ }
+
+ out:
+ return id;
+}
+
+static char *get_dev_id(const char *host, int devid)
+{
+ char *id = NULL;
+
+ if (asprintf(&id, "%s/%d", host, devid) == -1)
+ id = NULL;
+
+ return id;
+}
+
static CMPIStatus dev_to_rasd(const CMPIObjectPath *ref,
struct std_assoc_info *info,
struct inst_list *list)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
- const char *name = NULL;
+ char *id = NULL;
if (!match_hypervisor_prefix(ref, info))
return s;
@@ -54,16 +136,18 @@ static CMPIStatus dev_to_rasd(const CMPI
if (s.rc != CMPI_RC_OK)
goto out;
- if (cu_get_str_path(ref, "DeviceID", &name) != CMPI_RC_OK) {
+ id = get_rasd_id(inst,
+ res_type_from_device_classname(CLASSNAME(ref)));
+ if (id == NULL) {
cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Missing DeviceID");
+ CMPI_RC_ERR_NOT_FOUND,
+ "Unable to get RASD id from DeviceID");
goto out;
- }
+ }
s = get_rasd_by_name(_BROKER,
ref,
- name,
+ id,
res_type_from_device_classname(CLASSNAME(ref)),
NULL,
&inst);
@@ -73,6 +157,7 @@ static CMPIStatus dev_to_rasd(const CMPI
inst_list_add(list, inst);
out:
+ free(id);
return s;
}
@@ -83,7 +168,12 @@ static CMPIStatus rasd_to_dev(const CMPI
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
const char *name = NULL;
+ char *host = NULL;
+ char *devid = NULL;
+ char *id = NULL;
uint16_t type;
+ int count = 1;
+ int i;
if (!match_hypervisor_prefix(ref, info))
return s;
@@ -92,6 +182,13 @@ static CMPIStatus rasd_to_dev(const CMPI
if (s.rc != CMPI_RC_OK)
goto out;
+ if (res_type_from_rasd_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing ResourceType");
+ goto out;
+ }
+
if (cu_get_str_path(ref, "InstanceID", &name) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
@@ -99,20 +196,48 @@ static CMPIStatus rasd_to_dev(const CMPI
goto out;
}
- if (res_type_from_rasd_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Missing ResourceType");
- goto out;
+ if (type == CIM_RES_TYPE_PROC) {
+ if (parse_fq_devid((char *)name, &host, &devid) != 1) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "No such instance (%s)",
+ name);
+ goto out;
+ }
+
+ count = get_proc_dev_count(name,
+ CLASSNAME(ref),
+ type,
+ host,
+ &s);
+ if (count <= 0)
+ goto out;
}
- s = get_device_by_name(_BROKER, ref, name, type, &inst);
- if (s.rc != CMPI_RC_OK)
- goto out;
+ for (i = 0; i < count; i++) {
+ if (type == CIM_RES_TYPE_PROC)
+ id = get_dev_id(host, i);
+ else
+ id = strdup(name);
- inst_list_add(list, inst);
+ if (id == NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "Unable to get RASD id from DeviceID");
+ goto out;
+ }
+
+ s = get_device_by_name(_BROKER, ref, id, type, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ inst_list_add(list, inst);
+ }
out:
+ free(id);
+ free(host);
+ free(devid);
return s;
}
1
0
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1211234740 14400
# Node ID d9042b4ea61771df5110e97872c9e504f71859e7
# Parent c949b1845113e11e01329abb5aa81ca6ade8e3ec
(#2) ProcessorRASD, the class that won't go away
Around and round we go on the merry-go-round of indecision, hopefully for our last ride. The definitely probably absolutely tentative final plan is that the default representation of processors as virt_device structs will be one per domain, with a quantity. Virt_Devices will just need to be told how to handle that, and all the RASD stuff will be much happier for it. And then we will never speak of this again.
So today being my last official day on the team, I kind of have to get this out in a not perfect state. From what I can see it does what it is supposed to do, but it is entirely possible (likely?) that there are a few things in here that aren't really great things to do. I wish I could polish it more but I think I've at least got it to the point where any work left to be done is generic "not a great idea in C" problems, as opposed to the much more annoying "what exactly are we supposed to do in this case" problems.
Changes from 1 to 2:
Close brace on if block. That one is really embarrassing; I have no idea what happened there. I mean that crap won't even compile.
Removed unnecessary proc_found boolean. That was me being lazy after changing my mind on something.
Cleaned up a couple leftover CU_DEBUG calls.
Addition of vcpu_inst function, which is similar to vcpu_instances but always only works on one instance and takes a dev_id. This is to prevent all instances from being given a dev_id of zero. It is unfortunately similar to vcpu_instances in other regards, but I'm not sure if it's worth the overhead of trying to combine the similar parts.
Fixed quantity v number problem in xml_parse_test that I appear to have been failing to address for about six years.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c949b1845113 -r d9042b4ea617 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/device_parsing.c Mon May 19 18:05:40 2008 -0400
@@ -337,7 +337,6 @@ static int parse_vcpu_device(xmlNode *no
struct virt_device *list = NULL;
char *count_str;
int count;
- int i;
count_str = get_node_content(node);
if (count_str == NULL)
@@ -347,24 +346,15 @@ static int parse_vcpu_device(xmlNode *no
free(count_str);
- list = calloc(count, sizeof(*list));
+ list = calloc(1, sizeof(*list));
if (list == NULL)
goto err;
-
- for (i = 0; i < count; i++) {
- struct virt_device *vdev = &list[i];
- struct vcpu_device *cdev = &vdev->dev.vcpu;
-
- cdev->number = i;
-
- vdev->type = CIM_RES_TYPE_PROC;
- if (asprintf(&vdev->id, "%i", i) == -1)
- vdev->id = NULL;
- }
+
+ list->dev.vcpu.quantity = count;
*vdevs = list;
- return count;
+ return 1;
err:
free(list);
@@ -620,7 +610,7 @@ struct virt_device *virt_device_dup(stru
dev->dev.mem.size = _dev->dev.mem.size;
dev->dev.mem.maxsize = _dev->dev.mem.maxsize;
} else if (dev->type == CIM_RES_TYPE_PROC) {
- dev->dev.vcpu.number = _dev->dev.vcpu.number;
+ dev->dev.vcpu.quantity = _dev->dev.vcpu.quantity;
} else if (dev->type == CIM_RES_TYPE_EMU) {
DUP_FIELD(dev, _dev, dev.emu.path);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
@@ -672,6 +662,32 @@ static int _get_mem_device(const char *x
return 1;
}
+static int _get_proc_device(const char *xml, struct virt_device **list)
+{
+ struct virt_device *proc_devs = NULL;
+ struct virt_device *proc_dev = NULL;
+ int ret;
+
+ ret = parse_devices(xml, &proc_devs, CIM_RES_TYPE_PROC);
+ if (ret <= 0)
+ return ret;
+
+ proc_dev = malloc(sizeof(*proc_dev));
+ if (proc_dev == NULL)
+ return 0;
+
+ memset(proc_dev, 0, sizeof(*proc_dev));
+
+ proc_dev->type = CIM_RES_TYPE_PROC;
+ proc_dev->id = strdup("proc");
+ proc_dev->dev.vcpu.quantity = proc_devs[0].dev.vcpu.quantity;
+ *list = proc_dev;
+
+ cleanup_virt_devices(&proc_devs, ret);
+
+ return 1;
+};
+
int get_devices(virDomainPtr dom, struct virt_device **list, int type)
{
char *xml;
@@ -683,6 +699,8 @@ int get_devices(virDomainPtr dom, struct
if (type == CIM_RES_TYPE_MEM)
ret = _get_mem_device(xml, list);
+ else if (type == CIM_RES_TYPE_PROC)
+ ret = _get_proc_device(xml, list);
else
ret = parse_devices(xml, list, type);
diff -r c949b1845113 -r d9042b4ea617 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/device_parsing.h Mon May 19 18:05:40 2008 -0400
@@ -50,7 +50,7 @@ struct mem_device {
};
struct vcpu_device {
- uint64_t number;
+ uint64_t quantity;
};
struct emu_device {
diff -r c949b1845113 -r d9042b4ea617 libxkutil/xml_parse_test.c
--- a/libxkutil/xml_parse_test.c Thu May 15 17:56:39 2008 -0700
+++ b/libxkutil/xml_parse_test.c Mon May 19 18:05:40 2008 -0400
@@ -96,7 +96,7 @@ static void print_dev_vcpu(struct virt_d
static void print_dev_vcpu(struct virt_device *dev,
FILE *d)
{
- print_u64(d, "Virtual CPU", dev->dev.vcpu.number);
+ print_u64(d, "Virtual CPU", dev->dev.vcpu.quantity);
}
static void print_dev_emu(struct virt_device *dev,
diff -r c949b1845113 -r d9042b4ea617 src/Virt_Device.c
--- a/src/Virt_Device.c Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_Device.c Mon May 19 18:05:40 2008 -0400
@@ -174,23 +174,6 @@ static CMPIInstance *mem_instance(const
return inst;
}
-static CMPIInstance *vcpu_instance(const CMPIBroker *broker,
- struct vcpu_device *dev,
- const virDomainPtr dom,
- const char *ns)
-{
- CMPIInstance *inst;
- virConnectPtr conn;
-
- conn = virDomainGetConnect(dom);
- inst = get_typed_instance(broker,
- pfx_from_conn(conn),
- "Processor",
- ns);
-
- return inst;
-}
-
static int device_set_devid(CMPIInstance *instance,
struct virt_device *dev,
const virDomainPtr dom)
@@ -229,43 +212,141 @@ static int device_set_systemname(CMPIIns
return 1;
}
-static CMPIInstance *device_instance(const CMPIBroker *broker,
- struct virt_device *dev,
- const virDomainPtr dom,
- const char *ns)
+static char *get_vcpu_inst_id(const virDomainPtr dom,
+ int proc_num)
{
- CMPIInstance *instance;
+ int rc;
+ char *id_num = NULL;
+ char *dev_id = NULL;
- if (dev->type == CIM_RES_TYPE_NET)
- instance = net_instance(broker,
- &dev->dev.net,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_DISK)
- instance = disk_instance(broker,
- &dev->dev.disk,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_MEM)
- instance = mem_instance(broker,
- &dev->dev.mem,
- dom,
- ns);
- else if (dev->type == CIM_RES_TYPE_PROC)
- instance = vcpu_instance(broker,
- &dev->dev.vcpu,
- dom,
- ns);
- else
- return NULL;
+ rc = asprintf(&id_num, "%d", proc_num);
+ if (rc == -1) {
+ free(dev_id);
+ dev_id = NULL;
+ goto out;
+ }
+
+ dev_id = get_fq_devid((char *)virDomainGetName(dom), id_num);
+ free(id_num);
- if (!instance)
- return NULL;
+ out:
+ return dev_id;
+}
- device_set_devid(instance, dev, dom);
- device_set_systemname(instance, dom);
+static bool vcpu_instances(const CMPIBroker *broker,
+ const virDomainPtr dom,
+ const char *ns,
+ uint64_t proc_count,
+ struct inst_list *list)
+{
+ int i;
+ char *dev_id;
+ CMPIInstance *inst;
+ virConnectPtr conn = NULL;
- return instance;
+ for (i = 0; i < proc_count; i++) {
+ conn = virDomainGetConnect(dom);
+ inst = get_typed_instance(broker,
+ pfx_from_conn(conn),
+ "Processor",
+ ns);
+ if (inst == NULL)
+ return false;
+
+ dev_id = get_vcpu_inst_id(dom, i);
+ CMSetProperty(inst, "DeviceID",
+ (CMPIValue *)dev_id, CMPI_chars);
+ free(dev_id);
+
+ device_set_systemname(inst, dom);
+ inst_list_add(list, inst);
+ }
+
+ return true;
+}
+
+static bool vcpu_inst(const CMPIBroker *broker,
+ const virDomainPtr dom,
+ const char *ns,
+ int dev_id_num,
+ struct inst_list *list)
+{
+ char *dev_id;
+ CMPIInstance *inst;
+ virConnectPtr conn = NULL;
+
+ conn = virDomainGetConnect(dom);
+ inst = get_typed_instance(broker,
+ pfx_from_conn(conn),
+ "Processor",
+ ns);
+ if (inst == NULL)
+ return false;
+
+ dev_id = get_vcpu_inst_id(dom, dev_id_num);
+ CMSetProperty(inst, "DeviceID",
+ (CMPIValue *)dev_id, CMPI_chars);
+ free(dev_id);
+
+ device_set_systemname(inst, dom);
+ inst_list_add(list, inst);
+
+ return true;
+}
+
+static bool device_instances(const CMPIBroker *broker,
+ struct virt_device *devs,
+ int count,
+ const virDomainPtr dom,
+ const char *ns,
+ struct inst_list *list)
+{
+ int i;
+ bool ret;
+ uint64_t proc_count = 0;
+ CMPIInstance *instance = NULL;
+
+ for (i = 0; i < count; i++) {
+ struct virt_device *dev = &devs[i];
+
+ if (dev->type == CIM_RES_TYPE_NET)
+ instance = net_instance(broker,
+ &dev->dev.net,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_DISK)
+ instance = disk_instance(broker,
+ &dev->dev.disk,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_MEM)
+ instance = mem_instance(broker,
+ &dev->dev.mem,
+ dom,
+ ns);
+ else if (dev->type == CIM_RES_TYPE_PROC) {
+ proc_count = dev->dev.vcpu.quantity;
+ continue;
+ } else
+ return false;
+
+ if (!instance)
+ return false;
+
+ device_set_devid(instance, dev, dom);
+ device_set_systemname(instance, dom);
+ inst_list_add(list, instance);
+ }
+
+ if (proc_count) {
+ ret = vcpu_instances(broker,
+ dom,
+ ns,
+ proc_count,
+ list);
+ }
+
+ return true;
}
uint16_t res_type_from_device_classname(const char *classname)
@@ -290,25 +371,27 @@ static CMPIStatus _get_devices(const CMP
{
CMPIStatus s = {CMPI_RC_OK, NULL};
int count;
- int i;
+ bool rc;
struct virt_device *devs = NULL;
count = get_devices(dom, &devs, type);
if (count <= 0)
goto out;
- for (i = 0; i < count; i++) {
- CMPIInstance *dev = NULL;
+ rc = device_instances(broker,
+ devs,
+ count,
+ dom,
+ NAMESPACE(reference),
+ list);
- dev = device_instance(broker,
- &devs[i],
- dom,
- NAMESPACE(reference));
- if (dev)
- inst_list_add(list, dev);
+ if (!rc) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Couldn't get device instances");
+ }
- cleanup_virt_device(&devs[i]);
- }
+ cleanup_virt_devices(&devs, count);
out:
free(devs);
@@ -427,6 +510,29 @@ static int parse_devid(const char *devid
return 1;
}
+static int proc_dev_list(uint64_t quantity,
+ struct virt_device **list)
+{
+ int i;
+ int rc;
+
+
+ *list = (struct virt_device *)calloc(quantity,
+ sizeof(struct virt_device));
+
+ for (i = 0; i < quantity; i++) {
+ char *dev_num;
+
+ rc = asprintf(&dev_num, "%d", i);
+
+ (*list)[i].id = strdup(dev_num);
+
+ free(dev_num);
+ }
+
+ return quantity;
+}
+
static struct virt_device *find_dom_dev(virDomainPtr dom,
char *device,
int type)
@@ -439,6 +545,17 @@ static struct virt_device *find_dom_dev(
count = get_devices(dom, &list, type);
if (!count)
goto out;
+
+ if (type == CIM_RES_TYPE_PROC) {
+ struct virt_device *tmp_list;
+ int tmp_count;
+
+ tmp_count = proc_dev_list(list[0].dev.vcpu.quantity,
+ &tmp_list);
+ cleanup_virt_devices(&list, count);
+ list = tmp_list;
+ count = tmp_count;
+ }
for (i = 0; i < count; i++) {
if (STREQC(device, list[i].id))
@@ -462,10 +579,13 @@ CMPIStatus get_device_by_name(const CMPI
CMPIStatus s = {CMPI_RC_OK, NULL};
char *domain = NULL;
char *device = NULL;
- CMPIInstance *instance = NULL;
virConnectPtr conn = NULL;
virDomainPtr dom = NULL;
struct virt_device *dev = NULL;
+ struct inst_list tmp_list;
+ bool rc;
+
+ inst_list_init(&tmp_list);
conn = connect_by_classname(broker, CLASSNAME(reference), &s);
if (conn == NULL) {
@@ -501,13 +621,30 @@ CMPIStatus get_device_by_name(const CMPI
goto err;
}
- instance = device_instance(broker,
- dev,
- dom,
- NAMESPACE(reference));
+ if (type == CIM_RES_TYPE_PROC) {
+ int ret;
+ int dev_id_num;
+
+ ret = sscanf(dev->id, "%d", &dev_id_num);
+
+ rc = vcpu_inst(broker,
+ dom,
+ NAMESPACE(reference),
+ dev_id_num,
+ &tmp_list);
+ } else {
+
+ rc = device_instances(broker,
+ dev,
+ 1,
+ dom,
+ NAMESPACE(reference),
+ &tmp_list);
+ }
+
cleanup_virt_device(dev);
- *_inst = instance;
+ *_inst = tmp_list.list[0];
err:
virDomainFree(dom);
@@ -515,6 +652,7 @@ CMPIStatus get_device_by_name(const CMPI
free(device);
out:
+ inst_list_free(&tmp_list);
virConnectClose(conn);
return s;
diff -r c949b1845113 -r d9042b4ea617 src/Virt_RASD.c
--- a/src/Virt_RASD.c Thu May 15 17:56:39 2008 -0700
+++ b/src/Virt_RASD.c Mon May 19 18:05:40 2008 -0400
@@ -173,10 +173,8 @@ static CMPIInstance *rasd_from_vdev(cons
CMSetProperty(inst, "Limit",
(CMPIValue *)&dev->dev.mem.maxsize, CMPI_uint64);
} else if (dev->type == CIM_RES_TYPE_PROC) {
- /* This would be the place to set the virtualquantity. */
- uint64_t quantity = dev->dev.vcpu.number + 1;
CMSetProperty(inst, "VirtualQuantity",
- (CMPIValue *)&quantity, CMPI_uint64);
+ (CMPIValue *)&dev->dev.vcpu.quantity, CMPI_uint64);
}
/* FIXME: Put the HostResource in place */
1
1

[PATCH] [TEST]Fixing 03_hs_to_settdefcap.py tc to accomadate the ValueRole/ValueRange changes in RASDs
by Deepti B. Kalakeri 19 May '08
by Deepti B. Kalakeri 19 May '08
19 May '08
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1211219013 25200
# Node ID 509c5b7c0923e1b56defa1f9f9bf04e20703d6e1
# Parent 1650b84084a49965c2088f56248d6018b470e60c
[TEST]Fixing 03_hs_to_settdefcap.py tc to accomadate the ValueRole/ValueRange changes in RASDs.
Tested with KVM, XenFV, Xen with latest and rpm libvirt-cim.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 1650b84084a4 -r 509c5b7c0923 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Mon May 19 09:31:22 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Mon May 19 10:43:33 2008 -0700
@@ -48,11 +48,13 @@ from CimTest.Globals import logger, CIM_
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, do_main
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.test_xml import testxml
-from XenKvmLib.test_doms import test_domain_function, destroy_and_undefine_all
+from XenKvmLib.test_doms import destroy_and_undefine_all
+from XenKvmLib.const import CIM_REV
sup_types = ['Xen', 'KVM', 'XenFV']
test_dom = "domgst"
test_vcpus = 1
+libvirtcim_sdc_rasd_rev = 571
def setup_env(server, virt="Xen"):
status = PASS
@@ -64,7 +66,7 @@ def setup_env(server, virt="Xen"):
logger.error("Failed to define the dom: %s", test_dom)
status = FAIL
- return status
+ return status, vsxml
def print_err(err, detail, cn):
logger.error(err % cn)
@@ -154,7 +156,7 @@ def get_alloccap(server, devpool, virt="
'%s_MemoryPool' % virt : 4,
'%s_DiskPool' % virt : 17 ,
'%s_NetworkPool' % virt : 10 }
-
+
for inst in devpool:
try:
assoc_info = Associators(server,
@@ -240,22 +242,26 @@ def check_rasd_vals(inst, cn, rt, rangel
if inst['ResourceType'] != rt:
logger.error("In ResourceType for %s " % rt)
return FAIL
+
+ # The following properties have been removed in the patchset 571
+ # but is present in the rpm libvirt-cim and hence retained it.
- ppolicy = inst['PropertyPolicy']
- if ppolicy != 0 and ppolicy != 1:
- logger.error("In PropertyPolicy for %s " % ppolicy)
- return FAIL
+ if CIM_REV < libvirtcim_sdc_rasd_rev:
+ ppolicy = inst['PropertyPolicy']
+ if ppolicy != 0 and ppolicy != 1:
+ logger.error("In PropertyPolicy for %s " % ppolicy)
+ return FAIL
- vrole = inst['ValueRole']
- if vrole < 0 or vrole > 4:
- logger.error("In ValueRole %s " % vrole)
- return FAIL
+ vrole = inst['ValueRole']
+ if vrole < 0 or vrole > 4:
+ logger.error("In ValueRole %s " % vrole)
+ return FAIL
- insid = inst['InstanceID']
- vrange = rangelist[insid]
- if vrange != inst['ValueRange']:
- logger.error("In ValueRange for %s " % vrange)
- return FAIL
+ insid = inst['InstanceID']
+ vrange = rangelist[insid]
+ if vrange != inst['ValueRange']:
+ logger.error("In ValueRange for %s " % vrange)
+ return FAIL
except Exception, detail:
logger.error("Error checking RASD attribute values %s" % detail)
@@ -263,40 +269,40 @@ def check_rasd_vals(inst, cn, rt, rangel
return PASS
-def clean_up(server, status):
- """
- Removing the guest and returning status
- """
- test_domain_function(test_dom, server, "undefine")
- sys.exit(status)
-
@do_main(sup_types)
def main():
options = main.options
status = PASS
- if options.virt == 'XenFV':
- options.virt = 'Xen'
+ server = options.ip
+ virt = options.virt
- status = setup_env(options.ip, options.virt)
+ if virt == 'XenFV':
+ virt = 'Xen'
+
+ status, vsxml = setup_env(server, virt)
if status != PASS:
return status
- status, hs, clsname = get_hostsys(options.ip, options.virt)
+ status, hs, clsname = get_hostsys(server, virt)
if status != PASS or hs == None:
- clean_up(options.ip, status)
+ vsxml.undefine(server)
+ return status
- status, devpool = get_hostrespool(options.ip, hs, clsname, options.virt)
+ status, devpool = get_hostrespool(server, hs, clsname, virt)
if status != PASS or devpool == None:
- clean_up(options.ip, status)
+ vsxml.undefine(server)
+ return status
- status, alloccap = get_alloccap(options.ip, devpool, options.virt)
+ status, alloccap = get_alloccap(server, devpool, virt)
if status != PASS or alloccap == None:
- clean_up(options.ip, status)
+ vsxml.undefine(server)
+ return status
- status = get_rasddetails(options.ip, alloccap, options.virt)
+ status = get_rasddetails(server, alloccap, virt)
- clean_up(options.ip, status)
+ vsxml.undefine(server)
+ return status
if __name__ == "__main__":
sys.exit(main())
1
0

[PATCH] [TEST]Fixing 01_memory.py tc to accomdate the memory changes
by Deepti B. Kalakeri 19 May '08
by Deepti B. Kalakeri 19 May '08
19 May '08
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1211214682 25200
# Node ID 1650b84084a49965c2088f56248d6018b470e60c
# Parent 80682d57c067810c97a92fce162c29dab2ea5451
[TEST]Fixing 01_memory.py tc to accomdate the memory changes.
Tested with KVM, XenFV, Xen with latest and rpm libvirt-cim.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 80682d57c067 -r 1650b84084a4 suites/libvirt-cim/cimtest/Memory/01_memory.py
--- a/suites/libvirt-cim/cimtest/Memory/01_memory.py Mon May 19 08:36:16 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Memory/01_memory.py Mon May 19 09:31:22 2008 -0700
@@ -31,11 +31,13 @@ from XenKvmLib.vxml import XenXML, KVMXM
from XenKvmLib.vxml import XenXML, KVMXML, get_class
from CimTest.Globals import logger
from CimTest.Globals import do_main
+from XenKvmLib.const import CIM_REV
sup_types = ['Xen', 'KVM', 'XenFV']
test_dom = "test_domain"
mem = 256 #MB
+mem_change_version=585
@do_main(sup_types)
def main():
@@ -43,7 +45,11 @@ def main():
vsxml = get_class(options.virt)(test_dom, mem)
vsxml.define(options.ip)
-
+ if CIM_REV >= mem_change_version:
+ alloc_mem = int(vsxml.xml_get_mem())
+ else:
+ alloc_mem = int(vsxml.xml_get_mem())/1024
+
devid = "%s/mem" % test_dom
key_list = { 'DeviceID' : devid,
'CreationClassName' : get_typed_class(options.virt, "Memory"),
@@ -60,8 +66,8 @@ def main():
capacity = dev.ConsumableBlocks * dev.BlockSize / 1024
- if capacity != mem:
- logger.error("Capacity should be %i MB instead of %i MB" % (mem, capacity))
+ if capacity != alloc_mem:
+ logger.error("Capacity should be %i MB instead of %i MB" % (alloc_mem, capacity))
status = 1
if status == 0:
1
0

[PATCH] [TEST] #2 Updating the cleanup_restore() function call in the tc to pass the server and virt parameters
by Deepti B. Kalakeri 19 May '08
by Deepti B. Kalakeri 19 May '08
19 May '08
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1211211376 25200
# Node ID 80682d57c067810c97a92fce162c29dab2ea5451
# Parent d013f73cf783cac1b458cec6dbc0c0308786f1e9
[TEST] #2 Updating the cleanup_restore() function call in the tc to pass the server and virt parameters.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r d013f73cf783 -r 80682d57c067 suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py
--- a/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Thu May 15 06:07:17 2008 -0700
+++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Mon May 19 08:36:16 2008 -0700
@@ -76,6 +76,7 @@ def main():
options = main.options
server = options.ip
+ virt = options.virt
# Verify DiskPool on machine
status = create_diskpool_file()
if status != PASS:
@@ -130,7 +131,7 @@ def main():
status = ret_value
if status != PASS:
break
- cleanup_restore()
+ cleanup_restore(server, virt)
return status
if __name__ == "__main__":
sys.exit(main())
diff -r d013f73cf783 -r 80682d57c067 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/03_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/03_reverse_errs.py Thu May 15 06:07:17 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/03_reverse_errs.py Mon May 19 08:36:16 2008 -0700
@@ -170,9 +170,9 @@ def err_invalid_keyvalue():
break
return status
-def clean_and_exit(server, msg):
+def clean_and_exit(server, virt, msg):
logger.error("------FAILED: Invalid %s.------", msg)
- cleanup_restore()
+ cleanup_restore(server, virt)
vsxml.undefine(server)
@do_main(platform_sup)
@@ -207,20 +207,20 @@ def main():
assoc_classname = get_typed_class(virt, "ElementAllocatedFromPool")
ret = err_invalid_keyname()
if ret != PASS:
- clean_and_exit(options.ip, "KeyName")
+ clean_and_exit(options.ip, virt, "KeyName")
return ret
ret = err_invalid_keyvalue()
if ret != PASS:
- clean_and_exit(options.ip, "KeyValue")
+ clean_and_exit(options.ip, virt, "KeyValue")
return ret
ret = err_invalid_ccname()
if ret != PASS:
- clean_and_exit(options.ip, "CCName")
+ clean_and_exit(options.ip, virt, "CCName")
return ret
- cleanup_restore()
+ cleanup_restore(options.ip, virt)
vsxml.undefine(options.ip)
return PASS
if __name__ == "__main__":
diff -r d013f73cf783 -r 80682d57c067 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Thu May 15 06:07:17 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Mon May 19 08:36:16 2008 -0700
@@ -477,9 +477,9 @@ def err_invalid_syscreationclassname_key
return try_assoc(conn, exp_ret, test_dom, test_keys, test_vals, log_msg)
-def clean_and_exit(server, msg):
+def clean_and_exit(server, virt, msg):
logger.error("------FAILED: Invalid %s.------", msg)
- cleanup_restore()
+ cleanup_restore(server, virt)
vsxml.undefine(server)
@do_main(platform_sup)
@@ -519,50 +519,50 @@ def main():
ret = err_invalid_sysname_keyname(conn, exp_list[0])
if ret != PASS:
- clean_and_exit(options.ip, "SystemName KeyName")
+ clean_and_exit(options.ip, virt, "SystemName KeyName")
return ret
ret = err_invalid_sysname_keyvalue(conn, exp_list[0])
if ret != PASS:
- clean_and_exit(options.ip, "SystemName Key Value")
+ clean_and_exit(options.ip, virt, "SystemName Key Value")
return ret
ret = err_invalid_devid_keyname(conn, exp_list[1])
if ret != PASS:
- clean_and_exit(options.ip, "DeviceID Keyname")
+ clean_and_exit(options.ip, virt, "DeviceID Keyname")
return ret
ret = err_invalid_devid_keyvalue(conn, exp_list[2])
if ret != PASS:
- clean_and_exit(options.ip, "DeviceID Keyvalue")
+ clean_and_exit(options.ip, virt, "DeviceID Keyvalue")
return ret
ret = err_invalid_classname(conn, exp_list[3])
if ret != PASS:
- clean_and_exit(options.ip, "classname Keyname")
+ clean_and_exit(options.ip, virt, "classname Keyname")
return ret
ret = err_invalid_creationclassname_keyname(conn, exp_list[4])
if ret != PASS:
- clean_and_exit(options.ip, "creationclassname Keyname")
+ clean_and_exit(options.ip, virt, "creationclassname Keyname")
return ret
ret = err_invalid_creationclassname_keyvalue(conn, exp_list[4])
if ret != PASS:
- clean_and_exit(options.ip, "creationclassname Keyvalue")
+ clean_and_exit(options.ip, virt, "creationclassname Keyvalue")
return ret
ret = err_invalid_syscreationclassname_keyname(conn, exp_list[5])
if ret != PASS:
- clean_and_exit(options.ip, "System creationclassname Keyname")
+ clean_and_exit(options.ip, virt, "System creationclassname Keyname")
return ret
ret = err_invalid_syscreationclassname_keyvalue(conn, exp_list[5])
if ret != PASS:
- clean_and_exit(options.ip, "System creationclassname Keyvalue")
+ clean_and_exit(options.ip, virt, "System creationclassname Keyvalue")
return ret
- cleanup_restore()
+ cleanup_restore(options.ip, virt)
vsxml.undefine(options.ip)
return PASS
if __name__ == "__main__":
diff -r d013f73cf783 -r 80682d57c067 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py
--- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Thu May 15 06:07:17 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Mon May 19 08:36:16 2008 -0700
@@ -179,7 +179,7 @@ def get_assocname_info(server, cn, an, q
status = FAIL
if status != PASS:
- cleanup_restore()
+ cleanup_restore(server, virt='Xen')
test_domain_function(test_dom, server, "destroy")
return status, assoc_info
@@ -221,7 +221,7 @@ def verify_eafp_values(server, in_pllist
except Exception, detail:
logger.error(CIM_ERROR_ASSOCIATORS, an)
logger.error("Exception: %s", detail)
- cleanup_restore()
+ cleanup_restore(server, virt='Xen')
status = FAIL
return status
@@ -229,7 +229,7 @@ def main():
def main():
options= main.options
server = options.ip
-
+ virt=options.virt
# Get the host info
status, host_name, classname = get_host_info(server)
if status != PASS:
@@ -256,14 +256,14 @@ def main():
status = setup_env(server)
if status != PASS:
- cleanup_restore()
+ cleanup_restore(server, vir=virt)
test_domain_function(test_dom, server, cmd = "destroy")
return status
in_pllist = pool_init_list(pool)
status = verify_eafp_values(server, in_pllist)
ret = test_domain_function(test_dom, server, cmd = "destroy")
- cleanup_restore()
+ cleanup_restore(server, virt=virt)
return status
if __name__ == "__main__":
sys.exit(main())
diff -r d013f73cf783 -r 80682d57c067 suites/libvirt-cim/cimtest/ResourcePool/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Thu May 15 06:07:17 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Mon May 19 08:36:16 2008 -0700
@@ -141,7 +141,7 @@ def main():
return FAIL
status = verify_fields(pool_list, netpool, get_typed_class(virt, np_cn))
- cleanup_restore()
+ cleanup_restore(ip, virt)
return status
if __name__ == "__main__":
diff -r d013f73cf783 -r 80682d57c067 suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Thu May 15 06:07:17 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/02_rp_gi_errors.py Mon May 19 08:36:16 2008 -0700
@@ -109,7 +109,7 @@ def main():
if not ret:
logger.error("Failed to create the Virtual Network '%s'",
test_network)
- cleanup_restore()
+ cleanup_restore(ip, virt)
return SKIP
netid = "%s/%s" % ("NetworkPool", test_network)
@@ -124,16 +124,16 @@ def main():
ret_value = err_invalid_instid_keyname(conn, cn, instid)
if ret_value != PASS:
logger.error("------ FAILED: Invalid InstanceID Key Name.------")
- cleanup_restore()
+ cleanup_restore(ip, virt)
return ret_value
ret_value = err_invalid_instid_keyvalue(conn, cn)
if ret_value != PASS:
logger.error("------ FAILED: Invalid InstanceID Key Value.------")
- cleanup_restore()
+ cleanup_restore(ip, virt)
return ret_value
- cleanup_restore()
+ cleanup_restore(ip, virt)
return PASS
if __name__ == "__main__":
1
0