[PATCH] ProcessorRASD, the class that won't go away
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1210778696 14400
# Node ID 5d6e45906bf07c81d973e2edcc10dcefbc265dab
# Parent 0b26d79ea3283461b349d20dbcfdf1715344afcd
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.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r 0b26d79ea328 -r 5d6e45906bf0 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Fri May 02 16:32:37 2008 -0400
+++ b/libxkutil/device_parsing.c Wed May 14 11:24:56 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 0b26d79ea328 -r 5d6e45906bf0 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Fri May 02 16:32:37 2008 -0400
+++ b/libxkutil/device_parsing.h Wed May 14 11:24:56 2008 -0400
@@ -50,7 +50,7 @@ struct mem_device {
};
struct vcpu_device {
- uint64_t number;
+ uint64_t quantity;
};
struct emu_device {
diff -r 0b26d79ea328 -r 5d6e45906bf0 src/Virt_Device.c
--- a/src/Virt_Device.c Fri May 02 16:32:37 2008 -0400
+++ b/src/Virt_Device.c Wed May 14 11:24:56 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,114 @@ 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)
-{
- CMPIInstance *instance;
-
- 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;
-
- if (!instance)
- return NULL;
-
- device_set_devid(instance, dev, dom);
- device_set_systemname(instance, dom);
-
- return instance;
+static char *get_vcpu_inst_id(const virDomainPtr dom,
+ int proc_num)
+{
+ int rc;
+ char *id_num = NULL;
+ char *dev_id = 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);
+
+ out:
+ return dev_id;
+}
+
+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;
+
+ 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 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;
+ bool proc_found = false;
+ 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_found = true;
+ 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 +344,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;
-
- dev = device_instance(broker,
- &devs[i],
- dom,
- NAMESPACE(reference));
- if (dev)
- inst_list_add(list, dev);
-
- cleanup_virt_device(&devs[i]);
- }
+ rc = device_instances(broker,
+ devs,
+ count,
+ dom,
+ NAMESPACE(reference),
+ list);
+
+ if (!rc) {
+ CU_DEBUG("Problem getting device instances");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Couldn't get device instances");
+
+ cleanup_virt_devices(&devs, count);
out:
free(devs);
@@ -427,6 +483,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 +518,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 +552,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 +594,27 @@ CMPIStatus get_device_by_name(const CMPI
goto err;
}
- instance = device_instance(broker,
- dev,
- dom,
- NAMESPACE(reference));
+ if (type == CIM_RES_TYPE_PROC) {
+ CU_DEBUG("PROC");
+ rc = vcpu_instances(broker,
+ dom,
+ NAMESPACE(reference),
+ 1,
+ &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];
+ CU_DEBUG("cleaning up");
err:
virDomainFree(dom);
@@ -515,6 +622,7 @@ CMPIStatus get_device_by_name(const CMPI
free(device);
out:
+ inst_list_free(&tmp_list);
virConnectClose(conn);
return s;
diff -r 0b26d79ea328 -r 5d6e45906bf0 src/Virt_RASD.c
--- a/src/Virt_RASD.c Fri May 02 16:32:37 2008 -0400
+++ b/src/Virt_RASD.c Wed May 14 11:24:56 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 */
16 years, 7 months
CimTest Report for KVM on F9 14-05-2008
by Deepti B Kalakeri
========================================================================
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 : 77
LibVirtCIM : 587
CIMTEST : 138
=======================================================
PASS : 94
FAIL : 15
XFAIL : 4
SKIP : 16
-----------------
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
HostSystem - 03_hs_to_settdefcap.py: FAIL
Memory - 01_memory.py: FAIL [This is extra failure from the last test
run , this is bcs of the recent memory modifications.]
Memory - 02_defgetmem.py: FAIL
NetworkPort - 03_user_netport.py: FAIL
Processor - 02_definesys_get_procs.py: FAIL
SettingsDefine - 02_reverse.py: FAIL
SettingsDefineCapabilities - 01_forward.py: FAIL [ This tc was skipped
last time, fails here bcs it require the storage pool.]
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 - Error invoke method `DefineSystem'. invalid extra attributes [u'EMBEDDEDOBJECT']
ERROR - Exception: ('Unable create domain %s using DefineSystem()', 'test_domain')
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: PASS
ComputerSystemIndication - 01_created_indication.py: FAIL
ERROR - Error invoke method `DefineSystem'. invalid extra attributes [u'EMBEDDEDOBJECT']
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: 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 - HostedResourcePool has returned 3 instances, expected 4 instances
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: FAIL
ERROR - Capacity should be 256 MB instead of 262144 MB
Memory - 02_defgetmem.py: FAIL
ERROR - Error invoke method `DefineSystem'. invalid extra attributes [u'EMBEDDEDOBJECT']
ERROR - Exception: Unable to create domain domu using DefineSys()
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 - Error invoke method `DefineSystem'. invalid extra attributes [u'EMBEDDEDOBJECT']
ERROR - Exception: Unable create domain test_domain using DefineSystem()
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: FAIL
ERROR - AttributeError : 'list' object has no attribute 'InstanceID'
CIM_ERR_NOT_FOUND: No such instance (foo)
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 - Error invoke method `DefineSystem'. invalid extra attributes [u'EMBEDDEDOBJECT']
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
16 years, 7 months
[PATCH] [TEST] add AC and related pool class for LXC AC support
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1210750647 25200
# Node ID 2466e8715737283b27fe04426b1f7ebc555ac35b
# Parent 06c87ac466e374f7ca5b7e3dd1923ee32f1ef2ce
[TEST] add AC and related pool class for LXC AC support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 06c87ac466e3 -r 2466e8715737 suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Tue May 13 06:07:27 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py Wed May 14 00:37:27 2008 -0700
@@ -119,10 +119,16 @@ class KVM_MemoryPool(CIM_ResourcePool):
class KVM_MemoryPool(CIM_ResourcePool):
pass
+class LXC_MemoryPool(CIM_ResourcePool):
+ pass
+
class Xen_ProcessorPool(CIM_ResourcePool):
pass
class KVM_ProcessorPool(CIM_ResourcePool):
+ pass
+
+class LXC_ProcessorPool(CIM_ResourcePool):
pass
class Xen_VirtualSystemManagementCapabilities(CIM_VirtualSystemManagementCapabilities):
@@ -149,12 +155,18 @@ class KVM_DiskPool(CIM_ResourcePool):
class KVM_DiskPool(CIM_ResourcePool):
pass
+class LXC_DiskPool(CIM_ResourcePool):
+ pass
+
class Xen_NetworkPool(CIM_ResourcePool):
pass
class KVM_NetworkPool(CIM_ResourcePool):
pass
+class LXC_NetworkPool(CIM_ResourcePool):
+ pass
+
class Xen_VirtualSystemMigrationCapabilities(Virt_VirtualSystemMigrationCapabilities):
pass
@@ -165,6 +177,9 @@ class Xen_AllocationCapabilities(CIM_All
pass
class KVM_AllocationCapabilities(CIM_AllocationCapabilities):
+ pass
+
+class LXC_AllocationCapabilities(CIM_AllocationCapabilities):
pass
class Xen_VirtualSystemMigrationSettingData(CIM_VirtualSystemMigrationSettingData):
16 years, 7 months
[PATCH] [TEST] add LXC class to library for test
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1210749855 25200
# Node ID ea663bc93926cbff6fac7c484a2f61749b51eb32
# Parent 06c87ac466e374f7ca5b7e3dd1923ee32f1ef2ce
[TEST] add LXC class to library for test
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 06c87ac466e3 -r ea663bc93926 suites/libvirt-cim/lib/XenKvmLib/devices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/devices.py Tue May 13 06:07:27 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py Wed May 14 00:24:15 2008 -0700
@@ -75,10 +75,16 @@ class KVM_LogicalDisk(CIM_LogicalDisk):
class KVM_LogicalDisk(CIM_LogicalDisk):
pass
+class LXC_LogicalDisk(CIM_LogicalDisk):
+ pass
+
class Xen_NetworkPort(CIM_NetworkPort):
pass
class KVM_NetworkPort(CIM_NetworkPort):
+ pass
+
+class LXC_NetworkPort(CIM_NetworkPort):
pass
class Xen_Memory(CIM_Memory):
@@ -87,10 +93,16 @@ class KVM_Memory(CIM_Memory):
class KVM_Memory(CIM_Memory):
pass
+class LXC_Memory(CIM_Memory):
+ pass
+
class Xen_Processor(CIM_Processor):
pass
class KVM_Processor(CIM_Processor):
+ pass
+
+class LXC_Processor(CIM_Processor):
pass
def get_class(classname):
diff -r 06c87ac466e3 -r ea663bc93926 suites/libvirt-cim/lib/XenKvmLib/hostsystem.py
--- a/suites/libvirt-cim/lib/XenKvmLib/hostsystem.py Tue May 13 06:07:27 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/hostsystem.py Wed May 14 00:24:15 2008 -0700
@@ -50,6 +50,8 @@ class KVM_HostSystem(CIM_System):
class KVM_HostSystem(CIM_System):
pass
+class LXC_HostSystem(CIM_System):
+ pass
def enumerate(server, virt='Xen'):
conn = pywbem.WBEMConnection('http://%s' % server,
diff -r 06c87ac466e3 -r ea663bc93926 suites/libvirt-cim/lib/XenKvmLib/rpcs.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rpcs.py Tue May 13 06:07:27 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/rpcs.py Wed May 14 00:24:15 2008 -0700
@@ -50,6 +50,8 @@ class KVM_ResourcePoolConfigurationServi
class KVM_ResourcePoolConfigurationService(CIM_ResourcePoolConfigurationService):
pass
+class LXC_ResourcePoolConfigurationService(CIM_ResourcePoolConfigurationService):
+ pass
def enumerate(server, classname):
conn = pywbem.WBEMConnection('http://%s' % server,
diff -r 06c87ac466e3 -r ea663bc93926 suites/libvirt-cim/lib/XenKvmLib/vsms.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Tue May 13 06:07:27 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed May 14 00:24:15 2008 -0700
@@ -64,6 +64,9 @@ class Xen_VirtualSystemManagementService
pass
class KVM_VirtualSystemManagementService(CIM_VirtualSystemManagementService):
+ pass
+
+class LXC_VirtualSystemManagementService(CIM_VirtualSystemManagementService):
pass
@eval_cls('VirtualSystemManagementService')
16 years, 7 months
[PATCH] [TEST] Updating 01_forward.py of SDC
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1210684825 25200
# Node ID cf44a468be8440eb3b09c9a43804af7ecf5f9ae0
# Parent a6ffa074aab4b3867358eb77c0dcc7c622c595d4
[TEST] Updating 01_forward.py of SDC.
To use the storage pool present on the machine.
This tc will now pass on latest libvirt-cim for KVM.
This tc will require virsh_version() and diskpool_list() and create_diskpool() function
changes to work.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r a6ffa074aab4 -r cf44a468be84 suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Tue May 13 06:12:22 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Tue May 13 06:20:25 2008 -0700
@@ -59,17 +59,16 @@ from XenKvmLib import enumclass
from XenKvmLib import enumclass
from XenKvmLib.test_xml import netxml
from XenKvmLib.test_doms import create_vnet
-from VirtLib.live import net_list
+from VirtLib.live import net_list, virsh_version
from CimTest.ReturnCodes import PASS, FAIL, SKIP
from CimTest.Globals import do_main, platform_sup, logger, \
CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
-create_diskpool_file
+create_diskpool_file, diskpoolconf_rev, create_diskpool, dpoolname
from XenKvmLib.common_util import print_field_error
from XenKvmLib.const import CIM_REV
-diskid = "%s/%s" % ("DiskPool", test_dpath)
memid = "%s/%s" % ("MemoryPool", 0)
procid = "%s/%s" % ("ProcessorPool", 0)
libvirtcim_sdc_rasd_rev = 571
@@ -130,6 +129,18 @@ def get_pool_details(virt, server):
def get_pool_details(virt, server):
dpool = npool = mpool = ppool = None
try :
+ libvirt_version = virsh_version(server, virt)
+ if virt == 'KVM' and libvirt_version >= '0.4.1' and \
+ CIM_REV > diskpoolconf_rev:
+ diskid = "%s/%s" % ("DiskPool", dpoolname)
+ status = create_diskpool(server, virt=virt)
+ else:
+ diskid = "%s/%s" % ("DiskPool", test_dpath)
+ status = create_diskpool_file()
+
+ if status != PASS:
+ return status, dpool, npool, mpool, ppool
+
dpool = get_pool_info(virt, server, diskid, poolname="DiskPool")
mpool = get_pool_info(virt, server, memid, poolname= "MemoryPool")
ppool = get_pool_info(virt, server, procid, poolname= "ProcessorPool")
@@ -145,7 +156,7 @@ def get_pool_details(virt, server):
if not ret:
logger.error("Failed to create Virtual Network '%s'",
test_network)
- return SKIP
+ return SKIP, dpool, npool, mpool, ppool
netid = "%s/%s" % ("NetworkPool", test_network)
npool = get_pool_info(virt, server, netid, poolname= "NetworkPool")
@@ -225,11 +236,6 @@ def main():
server = options.ip
virt = options.virt
- # Verify DiskPool on machine
- status = create_diskpool_file()
- if status != PASS:
- return status
-
status, dpool, npool, mpool, ppool = get_pool_details(virt, server)
if status != PASS or dpool.InstanceID == None or mpool.InstanceID == None \
or npool.InstanceID == None or ppool.InstanceID == None:
16 years, 7 months
[PATCH] [TEST] Adding create_diskpool() function
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1210684342 25200
# Node ID a6ffa074aab4b3867358eb77c0dcc7c622c595d4
# Parent f81fd5f73b3e71630bf2b6e6e6a51a8f7f254346
[TEST] Adding create_diskpool() function
To create the storage pool on machine with libvirt >= 0.4.1
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r f81fd5f73b3e -r a6ffa074aab4 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue May 13 06:07:27 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue May 13 06:12:22 2008 -0700
@@ -1,3 +1,4 @@
+#!/usr/bin/python
#
# Copyright 2008 IBM Corp.
#
@@ -32,9 +33,12 @@ from XenKvmLib.classes import get_typed_
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, log_param, CIM_ERROR_ENUMERATE
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
-from XenKvmLib.const import CIM_REV
+from XenKvmLib.const import CIM_REV, default_pool_name
+from VirtLib.live import diskpool_list
+from XenKvmLib.vxml import PoolXML
test_dpath = "foo"
+dpoolname = default_pool_name
diskpoolconf_rev = 558
if CIM_REV < diskpoolconf_rev:
@@ -294,3 +298,17 @@ def create_diskpool_file():
return conf_file()
+def create_diskpool(server, virt='KVM'):
+ dpool_list = diskpool_list(server, virt='KVM')
+ if len(dpool_list) > 0:
+ dpoolname=dpool_list[0]
+ else:
+ global dpoolname
+ diskxml = PoolXML(server, virt=virt)
+ ret = diskxml.create_vpool()
+ if not ret:
+ logger.error('Failed to create the disk pool "%s"',
+ dpoolname)
+ return FAIL
+ logger.info("Disk Pool on machine is: %s ", dpoolname)
+ return PASS
16 years, 7 months
[PATCH] [TEST] Add PoolXML class for creating a virtual pool in vxml.py
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1210779243 -28800
# Node ID dcb1f04780e641973d1070440bc6f50fac2e9831
# Parent cdcf642c493a548d2deb499f223bb9a1f414cb3c
[TEST] Add PoolXML class for creating a virtual pool in vxml.py
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r cdcf642c493a -r dcb1f04780e6 suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py Mon May 12 03:23:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Wed May 14 23:34:03 2008 +0800
@@ -37,6 +37,9 @@
default_bridge_name = 'testbridge'
default_network_name = 'default-net'
+#vxml.PoolXML
+default_pool_name = 'testpool'
+
# vxml.VirtXML
default_domname = 'domU1'
default_memory = 128
diff -r cdcf642c493a -r dcb1f04780e6 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon May 12 03:23:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed May 14 23:34:03 2008 +0800
@@ -143,7 +143,7 @@
self.vuri = 'qemu:///system'
def run(self, ip, vcmd, param):
- file_arg_cmds = ['define', 'create', 'net-create']
+ file_arg_cmds = ['define', 'create', 'net-create', 'pool-create']
if vcmd in file_arg_cmds:
ntf = tempfile.NamedTemporaryFile('w')
ntf.write(param)
@@ -211,6 +211,27 @@
def create_vnet(self):
return self.run(self.server, 'net-create', self.xml_string)
+class PoolXML(Virsh, XMLClass):
+
+ def __init__(self, server, poolname=const.default_pool_name,
+ virt='xen'):
+
+ XMLClass.__init__(self)
+ if virt == 'XenFV':
+ virt = 'xen'
+ Virsh.__init__(self, str(virt).lower())
+ self.pool_name = poolname
+ self.server = server
+
+ pool = self.add_sub_node(self.xdoc, 'pool', type='dir')
+ self.add_sub_node(pool, 'name', self.pool_name)
+ source = self.add_sub_node(pool, 'source')
+ self.add_sub_node(source, 'device', path='/tmp')
+ target = self.add_sub_node(pool, 'target')
+ self.add_sub_node(target, 'path', '/tmp')
+
+ def create_vpool(self):
+ return self.run(self.server, 'pool-create', self.xml_string)
class VirtXML(Virsh, XMLClass):
"""Base class for all XML generation & operation"""
16 years, 7 months
[PATCH] [TEST] Adding virsh_version() and diskpool_list() to live.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1210684047 25200
# Node ID f81fd5f73b3e71630bf2b6e6e6a51a8f7f254346
# Parent cdcf642c493a548d2deb499f223bb9a1f414cb3c
[TEST] Adding virsh_version() and diskpool_list() to live.py.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r cdcf642c493a -r f81fd5f73b3e lib/VirtLib/live.py
--- a/lib/VirtLib/live.py Mon May 12 03:23:12 2008 -0700
+++ b/lib/VirtLib/live.py Tue May 13 06:07:27 2008 -0700
@@ -313,3 +313,28 @@ def network_by_bridge(bridge, server, vi
return network
return None
+
+def virsh_version(server, virt="KVM"):
+ cmd = "virsh -c %s -v " % utils.virt2uri(virt)
+ ret, out = utils.run_remote(server, cmd)
+ if ret != 0:
+ return None
+ return out
+
+def diskpool_list(server, virt="KVM"):
+ """Function to list active DiskPool list"""
+ names = []
+ cmd = "virsh -c %s pool-list | sed -e '1,2 d' -e '$ d'" % \
+ utils.virt2uri(virt)
+ ret, out = utils.run_remote(server, cmd)
+
+ if ret != 0:
+ return names
+
+ lines = out.split("\n")
+ for line in lines:
+ disk_pool = line.split()
+ if len(disk_pool) >= 1 and disk_pool[1] == "active":
+ names.append(disk_pool[0])
+
+ return names
16 years, 7 months
[PATCH] [TEST] Capture return from create_using_definesystem() in 01_created_indication.py
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1210559507 25200
# Node ID 0647d07426408da321b42cb23eaefab0032f50e6
# Parent 336c6f965baed9b56b484507171ad940e09e6096
[TEST] Capture return from create_using_definesystem() in 01_created_indication.py
This test was returning a false positive in the case where create_using_definesystem() fails.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 336c6f965bae -r 0647d0742640 suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py
--- a/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Wed May 07 09:54:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Sun May 11 19:31:47 2008 -0700
@@ -63,7 +63,13 @@
else:
sys.exit(0)
else:
- create_using_definesystem(test_dom, options.ip, None, None, options.virt)
+ status = create_using_definesystem(test_dom, options.ip, None, None, options.virt)
+ if status != PASS:
+ sub.unsubscribe(dict['default_auth'])
+ logger.info("Cancelling subscription for %s" % indication_name)
+ os.kill(pid, signal.SIGKILL)
+ return status
+
for i in range(0,100):
pw = os.waitpid(pid, os.WNOHANG)[1]
if pw == 0:
16 years, 7 months
[PATCH] Make ReferencedConfiguration optional
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1210633918 25200
# Node ID b9ddfef54aa7b51515efea27b95faf00edc5ace7
# Parent 1a31955ae3975f88582287fd1c3bbb7a57da3ed9
Make ReferencedConfiguration optional.
The profile states that this parameter can be NULL.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 1a31955ae397 -r b9ddfef54aa7 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon May 12 09:21:07 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Mon May 12 16:11:58 2008 -0700
@@ -1373,7 +1373,7 @@
.handler = define_system,
.args = {{"SystemSettings", CMPI_instance, false},
{"ResourceSettings", CMPI_instanceA, false},
- {"ReferenceConfiguration", CMPI_ref, false},
+ {"ReferenceConfiguration", CMPI_ref, true},
ARG_END
}
};
16 years, 7 months