[PATCH] (#3) Fix device_parsing of processors
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1208284430 14400
# Node ID f07c4d4649dfabce47957ca276b5227290bcbcae
# Parent 01b0a24fc16f9daff19f3733552f223ddf6d7a18
(#3) Fix device_parsing of processors.
Kaitlin discovered that my changes to device_parsing.c make it so we only get one Processor as well, not just one Proc RASD. This moves the flattening step up a little higher so that enumerating on Processor works correctly. It's not the prettiest approach to things, but I think given Processor's unique Device-RASD relationship it's a good compromise. I would of course be open to suggestions for making it a bit more elegant.
Changes from 1 to 2:
Fix xml_parse_test.c's print_dev_vcpu, and by "fix" I mean "fix, because once again I made a change that breaks it."
Changes from 2 to 3:
VirtualQuantity is supposed to be 64-bit, not 32.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r 01b0a24fc16f -r f07c4d4649df libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Mon Apr 14 15:17:08 2008 -0700
+++ b/libxkutil/device_parsing.c Tue Apr 15 14:33:50 2008 -0400
@@ -337,6 +337,7 @@ 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)
@@ -346,15 +347,24 @@ static int parse_vcpu_device(xmlNode *no
free(count_str);
- list = calloc(1, sizeof(*list));
+ list = calloc(count, sizeof(*list));
if (list == NULL)
goto err;
-
- list->dev.vcpu.quantity = count;
+
+ 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;
+ }
*vdevs = list;
- return 1;
+ return count;
err:
free(list);
@@ -610,7 +620,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.quantity = _dev->dev.vcpu.quantity;
+ dev->dev.vcpu.number = _dev->dev.vcpu.number;
} else if (dev->type == CIM_RES_TYPE_EMU) {
DUP_FIELD(dev, _dev, dev.emu.path);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
@@ -662,32 +672,6 @@ 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;
@@ -699,8 +683,6 @@ 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 01b0a24fc16f -r f07c4d4649df libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Mon Apr 14 15:17:08 2008 -0700
+++ b/libxkutil/device_parsing.h Tue Apr 15 14:33:50 2008 -0400
@@ -50,7 +50,7 @@ struct mem_device {
};
struct vcpu_device {
- uint32_t quantity;
+ uint64_t number;
};
struct emu_device {
diff -r 01b0a24fc16f -r f07c4d4649df libxkutil/xml_parse_test.c
--- a/libxkutil/xml_parse_test.c Mon Apr 14 15:17:08 2008 -0700
+++ b/libxkutil/xml_parse_test.c Tue Apr 15 14:33:50 2008 -0400
@@ -18,10 +18,12 @@ static void print_u64(FILE *d, const cha
fprintf(d, "%-15s: %" PRIu64 "\n", name, val);
}
+#if 0
static void print_u32(FILE *d, const char *name, uint32_t val)
{
fprintf(d, "%-15s: %" PRIu32 "\n", name, val);
}
+#endif
static void print_os(struct domain *dom,
FILE *d)
@@ -94,7 +96,7 @@ static void print_dev_vcpu(struct virt_d
static void print_dev_vcpu(struct virt_device *dev,
FILE *d)
{
- print_u32(d, "Virtual CPUs", dev->dev.vcpu.quantity);
+ print_u64(d, "Virtual CPU", dev->dev.vcpu.number);
}
static void print_dev_emu(struct virt_device *dev,
diff -r 01b0a24fc16f -r f07c4d4649df src/Virt_RASD.c
--- a/src/Virt_RASD.c Mon Apr 14 15:17:08 2008 -0700
+++ b/src/Virt_RASD.c Tue Apr 15 14:33:50 2008 -0400
@@ -169,8 +169,10 @@ 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 *)&dev->dev.vcpu.quantity, CMPI_uint32);
+ (CMPIValue *)&quantity, CMPI_uint64);
}
/* FIXME: Put the HostResource in place */
@@ -343,6 +345,22 @@ static CMPIStatus _get_rasds(const CMPIB
if (count <= 0)
goto out;
+ /* Bit hackish, but for proc we need to cut list down to one. */
+ if (type == CIM_RES_TYPE_PROC) {
+ struct virt_device *tmp_dev = NULL;
+ tmp_dev = calloc(1, sizeof(*tmp_dev));
+ tmp_dev = virt_device_dup(&devs[count - 1]);
+
+ tmp_dev->id = strdup("proc");
+
+ for (i = 0; i < count; i++)
+ cleanup_virt_device(&devs[i]);
+
+ free(devs);
+ devs = tmp_dev;
+ count = 1;
+ }
+
for (i = 0; i < count; i++) {
CMPIInstance *dev = NULL;
const char *host = NULL;
16 years, 8 months
[PATCH] [TEST] #2 Remove uses of "finally" keyword
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1208283972 25200
# Node ID 22fa9f89fddbe1892f0c5fa10ce60027dd171059
# Parent b9ce0dcc277e51d5865b611ebd092874e856bbe2
[TEST] #2 Remove uses of "finally" keyword.
python2.4 doesn't support it, and in most cases, it isn't needed.
Updates:
-Nothing changed. The system has an appropriate time set now.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Tue Apr 15 11:26:12 2008 -0700
@@ -115,9 +115,8 @@ RequestedStateChange()", action, default
logger.error("Exception: %s", detail)
status = FAIL
- finally:
- # undefine the vs
- undefine_test_domain(default_dom, options.ip, options.virt)
+ # undefine the vs
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Tue Apr 15 11:26:12 2008 -0700
@@ -114,9 +114,8 @@ RequestedStateChange()", action, default
logger.error("Exception: %s", detail)
status = FAIL
- finally:
- # undefine the vs
- undefine_test_domain(default_dom, options.ip, options.virt)
+ # undefine the vs
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Tue Apr 15 11:26:12 2008 -0700
@@ -118,9 +118,8 @@ RequestedStateChange()", action, default
logger.error("Exception: %s", detail)
status = FAIL
- finally:
- # undefine the vs
- undefine_test_domain(default_dom, options.ip, options.virt)
+ # undefine the vs
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Tue Apr 15 11:26:12 2008 -0700
@@ -115,9 +115,8 @@ RequestedStateChange()", action, default
logger.error("Exception: %s", detail)
status = FAIL
- finally:
- # undefine the vs
- undefine_test_domain(default_dom, options.ip, options.virt)
+ # undefine the vs
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Tue Apr 15 11:26:12 2008 -0700
@@ -95,8 +95,7 @@ def main():
logger.error("Exception: %s", detail)
status = rc
- finally:
- undefine_test_domain(default_dom, options.ip, options.virt)
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py
--- a/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Tue Apr 15 11:26:12 2008 -0700
@@ -80,11 +80,11 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- sub.unsubscribe(dict['default_auth'])
- logger.info("Cancelling subscription for %s" % indication_name)
- os.kill(pid, signal.SIGKILL)
- undefine_test_domain(test_dom, options.ip, options.virt)
+
+ sub.unsubscribe(dict['default_auth'])
+ logger.info("Cancelling subscription for %s" % indication_name)
+ os.kill(pid, signal.SIGKILL)
+ undefine_test_domain(test_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Tue Apr 15 11:26:12 2008 -0700
@@ -55,11 +55,11 @@ def try_assoc(ref, ref_class, exp_rc, ex
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("ElementCapabilities associator should NOT return excepted \
- result with a wrong key name and value of %s input" % ref_class)
- status = FAIL
+
+ if rc == 0:
+ logger.error("ElementCapabilities associator should NOT return excepted \
+ result with a wrong key name and value of %s input" % ref_class)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py Tue Apr 15 11:26:12 2008 -0700
@@ -54,11 +54,11 @@ def try_assoc(ref, ref_class, exp_rc, ex
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("ElementCapabilities associator should NOT return excepted result \
- with a wrong key name and value of %s input" % ref_class)
- status = FAIL
+
+ if rc == 0:
+ logger.error("ElementCapabilities associator should NOT return excepted result \
+ with a wrong key name and value of %s input" % ref_class)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Tue Apr 15 11:26:12 2008 -0700
@@ -68,10 +68,10 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of HostSystem input")
- status = FAIL
+
+ if rc == 0:
+ logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of HostSystem input")
+ status = FAIL
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Tue Apr 15 11:26:12 2008 -0700
@@ -76,10 +76,10 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of %s input" % k)
- status = FAIL
+
+ if rc == 0:
+ logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of %s input" % k)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/Memory/02_defgetmem.py
--- a/suites/libvirt-cim/cimtest/Memory/02_defgetmem.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Memory/02_defgetmem.py Tue Apr 15 11:26:12 2008 -0700
@@ -83,8 +83,7 @@ def main():
logger.error("Exception: %s" % detail)
status = 1
- finally:
- undefine_test_domain(default_dom, options.ip)
+ undefine_test_domain(default_dom, options.ip)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py
--- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Tue Apr 15 11:26:12 2008 -0700
@@ -96,8 +96,7 @@ def main():
logger.error("Exception: %s" % detail)
status = 1
- finally:
- undefine_test_domain(default_dom, options.ip)
+ undefine_test_domain(default_dom, options.ip)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Tue Apr 15 11:26:12 2008 -0700
@@ -66,10 +66,10 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("ResourceAllocationFromPool associator should NOT return excepted result with a wrong InstanceID value of %s input" %k)
- status = FAIL
+
+ if rc == 0:
+ logger.error("ResourceAllocationFromPool associator should NOT return excepted result with a wrong InstanceID value of %s input" %k)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Tue Apr 15 11:26:12 2008 -0700
@@ -65,10 +65,10 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("ResourceAllocationSettingData should NOT return excepted result with a wrong InstanceID value of %s input" %k)
- status = FAIL
+
+ if rc == 0:
+ logger.error("ResourceAllocationSettingData should NOT return excepted result with a wrong InstanceID value of %s input" %k)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py Tue Apr 15 11:26:12 2008 -0700
@@ -155,12 +155,11 @@ def main():
logger.info(details)
status = FAIL
- finally:
- if rc == 0:
- logger.info("Success returned for wrong key and ID")
- logger.info("Class = %s , key = %s , keyval = %s " %
- (item, i , keyval))
- return XFAIL_RC(bug)
+ if rc == 0:
+ logger.info("Success returned for wrong key and ID")
+ logger.info("Class = %s , key = %s , keyval = %s " %
+ (item, i , keyval))
+ return XFAIL_RC(bug)
except Exception, details:
logger.info("exception" , details)
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py Tue Apr 15 11:26:12 2008 -0700
@@ -93,8 +93,8 @@ def main():
except Exception, details:
logger.error('Error invoking AddRS')
logger.error(details)
- finally:
- cxml.undefine(options.ip)
+
+ cxml.undefine(options.ip)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py Tue Apr 15 11:26:12 2008 -0700
@@ -74,10 +74,10 @@ def main():
logger.error('Error invoking AddRS')
logger.error(details)
status = FAIL
- finally:
- cxml.undefine(options.ip)
- if rc == 0:
- return XFAIL_RC(bug)
+
+ cxml.undefine(options.ip)
+ if rc == 0:
+ return XFAIL_RC(bug)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Tue Apr 15 11:26:12 2008 -0700
@@ -96,10 +96,10 @@ def main():
logger.error('Error invoking ModifyRS')
logger.error(details)
return XFAIL_RC(bug_net)
- finally:
- cxml.undefine(options.ip)
- if rc == -1:
- return XFAIL_RC(bug_cpu)
+
+ cxml.undefine(options.ip)
+ if rc == -1:
+ return XFAIL_RC(bug_cpu)
return status
diff -r b9ce0dcc277e -r 22fa9f89fddb suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Tue Apr 15 11:26:12 2008 -0700
@@ -84,9 +84,9 @@ def main():
except Exception, details:
logger.error('Unknown exception happened')
logger.error(details)
- finally:
- if rc == 0:
- logger.error('Migrate to host method should NOT return OK with a wrong key input')
+
+ if rc == 0:
+ logger.error('Migrate to host method should NOT return OK with a wrong key input')
destroy_and_undefine_domain(test_dom, options.ip)
return status
16 years, 8 months
[PATCH] [TEST] Remove uses of "finally" keyword
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1179814951 25200
# Node ID da131bc9102a6c0893194cfa5ec13812fc4a7560
# Parent b9ce0dcc277e51d5865b611ebd092874e856bbe2
[TEST] Remove uses of "finally" keyword.
python2.4 doesn't support it, and in most cases, it isn't needed.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Mon May 21 23:22:31 2007 -0700
@@ -115,9 +115,8 @@ RequestedStateChange()", action, default
logger.error("Exception: %s", detail)
status = FAIL
- finally:
- # undefine the vs
- undefine_test_domain(default_dom, options.ip, options.virt)
+ # undefine the vs
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Mon May 21 23:22:31 2007 -0700
@@ -114,9 +114,8 @@ RequestedStateChange()", action, default
logger.error("Exception: %s", detail)
status = FAIL
- finally:
- # undefine the vs
- undefine_test_domain(default_dom, options.ip, options.virt)
+ # undefine the vs
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Mon May 21 23:22:31 2007 -0700
@@ -118,9 +118,8 @@ RequestedStateChange()", action, default
logger.error("Exception: %s", detail)
status = FAIL
- finally:
- # undefine the vs
- undefine_test_domain(default_dom, options.ip, options.virt)
+ # undefine the vs
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Mon May 21 23:22:31 2007 -0700
@@ -115,9 +115,8 @@ RequestedStateChange()", action, default
logger.error("Exception: %s", detail)
status = FAIL
- finally:
- # undefine the vs
- undefine_test_domain(default_dom, options.ip, options.virt)
+ # undefine the vs
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Mon May 21 23:22:31 2007 -0700
@@ -95,8 +95,7 @@ def main():
logger.error("Exception: %s", detail)
status = rc
- finally:
- undefine_test_domain(default_dom, options.ip, options.virt)
+ undefine_test_domain(default_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py
--- a/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Mon May 21 23:22:31 2007 -0700
@@ -80,11 +80,11 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- sub.unsubscribe(dict['default_auth'])
- logger.info("Cancelling subscription for %s" % indication_name)
- os.kill(pid, signal.SIGKILL)
- undefine_test_domain(test_dom, options.ip, options.virt)
+
+ sub.unsubscribe(dict['default_auth'])
+ logger.info("Cancelling subscription for %s" % indication_name)
+ os.kill(pid, signal.SIGKILL)
+ undefine_test_domain(test_dom, options.ip, options.virt)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Mon May 21 23:22:31 2007 -0700
@@ -55,11 +55,11 @@ def try_assoc(ref, ref_class, exp_rc, ex
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("ElementCapabilities associator should NOT return excepted \
- result with a wrong key name and value of %s input" % ref_class)
- status = FAIL
+
+ if rc == 0:
+ logger.error("ElementCapabilities associator should NOT return excepted \
+ result with a wrong key name and value of %s input" % ref_class)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py Mon May 21 23:22:31 2007 -0700
@@ -54,11 +54,11 @@ def try_assoc(ref, ref_class, exp_rc, ex
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("ElementCapabilities associator should NOT return excepted result \
- with a wrong key name and value of %s input" % ref_class)
- status = FAIL
+
+ if rc == 0:
+ logger.error("ElementCapabilities associator should NOT return excepted result \
+ with a wrong key name and value of %s input" % ref_class)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Mon May 21 23:22:31 2007 -0700
@@ -68,10 +68,10 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of HostSystem input")
- status = FAIL
+
+ if rc == 0:
+ logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of HostSystem input")
+ status = FAIL
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Mon May 21 23:22:31 2007 -0700
@@ -76,10 +76,10 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of %s input" % k)
- status = FAIL
+
+ if rc == 0:
+ logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of %s input" % k)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/Memory/02_defgetmem.py
--- a/suites/libvirt-cim/cimtest/Memory/02_defgetmem.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Memory/02_defgetmem.py Mon May 21 23:22:31 2007 -0700
@@ -83,8 +83,7 @@ def main():
logger.error("Exception: %s" % detail)
status = 1
- finally:
- undefine_test_domain(default_dom, options.ip)
+ undefine_test_domain(default_dom, options.ip)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py
--- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Mon May 21 23:22:31 2007 -0700
@@ -96,8 +96,7 @@ def main():
logger.error("Exception: %s" % detail)
status = 1
- finally:
- undefine_test_domain(default_dom, options.ip)
+ undefine_test_domain(default_dom, options.ip)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Mon May 21 23:22:31 2007 -0700
@@ -66,10 +66,10 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("ResourceAllocationFromPool associator should NOT return excepted result with a wrong InstanceID value of %s input" %k)
- status = FAIL
+
+ if rc == 0:
+ logger.error("ResourceAllocationFromPool associator should NOT return excepted result with a wrong InstanceID value of %s input" %k)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Mon May 21 23:22:31 2007 -0700
@@ -65,10 +65,10 @@ def main():
except Exception, details:
logger.error("Unknown exception happened")
logger.error(details)
- finally:
- if rc == 0:
- logger.error("ResourceAllocationSettingData should NOT return excepted result with a wrong InstanceID value of %s input" %k)
- status = FAIL
+
+ if rc == 0:
+ logger.error("ResourceAllocationSettingData should NOT return excepted result with a wrong InstanceID value of %s input" %k)
+ status = FAIL
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py Mon May 21 23:22:31 2007 -0700
@@ -155,12 +155,11 @@ def main():
logger.info(details)
status = FAIL
- finally:
- if rc == 0:
- logger.info("Success returned for wrong key and ID")
- logger.info("Class = %s , key = %s , keyval = %s " %
- (item, i , keyval))
- return XFAIL_RC(bug)
+ if rc == 0:
+ logger.info("Success returned for wrong key and ID")
+ logger.info("Class = %s , key = %s , keyval = %s " %
+ (item, i , keyval))
+ return XFAIL_RC(bug)
except Exception, details:
logger.info("exception" , details)
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py Mon May 21 23:22:31 2007 -0700
@@ -93,8 +93,8 @@ def main():
except Exception, details:
logger.error('Error invoking AddRS')
logger.error(details)
- finally:
- cxml.undefine(options.ip)
+
+ cxml.undefine(options.ip)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py Mon May 21 23:22:31 2007 -0700
@@ -74,10 +74,10 @@ def main():
logger.error('Error invoking AddRS')
logger.error(details)
status = FAIL
- finally:
- cxml.undefine(options.ip)
- if rc == 0:
- return XFAIL_RC(bug)
+
+ cxml.undefine(options.ip)
+ if rc == 0:
+ return XFAIL_RC(bug)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Mon May 21 23:22:31 2007 -0700
@@ -96,10 +96,10 @@ def main():
logger.error('Error invoking ModifyRS')
logger.error(details)
return XFAIL_RC(bug_net)
- finally:
- cxml.undefine(options.ip)
- if rc == -1:
- return XFAIL_RC(bug_cpu)
+
+ cxml.undefine(options.ip)
+ if rc == -1:
+ return XFAIL_RC(bug_cpu)
return status
diff -r b9ce0dcc277e -r da131bc9102a suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Mon Apr 14 01:16:57 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Mon May 21 23:22:31 2007 -0700
@@ -84,9 +84,9 @@ def main():
except Exception, details:
logger.error('Unknown exception happened')
logger.error(details)
- finally:
- if rc == 0:
- logger.error('Migrate to host method should NOT return OK with a wrong key input')
+
+ if rc == 0:
+ logger.error('Migrate to host method should NOT return OK with a wrong key input')
destroy_and_undefine_domain(test_dom, options.ip)
return status
16 years, 8 months
[PATCH] (#2) Fix device_parsing of processors
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1208274605 14400
# Node ID f0153bd85ec1bdffabaf99266bc65472e1c080ad
# Parent 01b0a24fc16f9daff19f3733552f223ddf6d7a18
(#2) Fix device_parsing of processors.
Kaitlin discovered that my changes to device_parsing.c make it so we only get one Processor as well, not just one Proc RASD. This moves the flattening step up a little higher so that enumerating on Processor works correctly. It's not the prettiest approach to things, but I think given Processor's unique Device-RASD relationship it's a good compromise. I would of course be open to suggestions for making it a bit more elegant.
Changes from 1 to 2:
Fix xml_parse_test.c's print_dev_vcpu, and by "fix" I mean "fix, because once again I made a change that breaks it."
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r 01b0a24fc16f -r f0153bd85ec1 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Mon Apr 14 15:17:08 2008 -0700
+++ b/libxkutil/device_parsing.c Tue Apr 15 11:50:05 2008 -0400
@@ -337,6 +337,7 @@ 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)
@@ -346,15 +347,24 @@ static int parse_vcpu_device(xmlNode *no
free(count_str);
- list = calloc(1, sizeof(*list));
+ list = calloc(count, sizeof(*list));
if (list == NULL)
goto err;
-
- list->dev.vcpu.quantity = count;
+
+ 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;
+ }
*vdevs = list;
- return 1;
+ return count;
err:
free(list);
@@ -610,7 +620,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.quantity = _dev->dev.vcpu.quantity;
+ dev->dev.vcpu.number = _dev->dev.vcpu.number;
} else if (dev->type == CIM_RES_TYPE_EMU) {
DUP_FIELD(dev, _dev, dev.emu.path);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
@@ -662,32 +672,6 @@ 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;
@@ -699,8 +683,6 @@ 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 01b0a24fc16f -r f0153bd85ec1 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Mon Apr 14 15:17:08 2008 -0700
+++ b/libxkutil/device_parsing.h Tue Apr 15 11:50:05 2008 -0400
@@ -50,7 +50,7 @@ struct mem_device {
};
struct vcpu_device {
- uint32_t quantity;
+ uint32_t number;
};
struct emu_device {
diff -r 01b0a24fc16f -r f0153bd85ec1 libxkutil/xml_parse_test.c
--- a/libxkutil/xml_parse_test.c Mon Apr 14 15:17:08 2008 -0700
+++ b/libxkutil/xml_parse_test.c Tue Apr 15 11:50:05 2008 -0400
@@ -94,7 +94,7 @@ static void print_dev_vcpu(struct virt_d
static void print_dev_vcpu(struct virt_device *dev,
FILE *d)
{
- print_u32(d, "Virtual CPUs", dev->dev.vcpu.quantity);
+ print_u32(d, "Virtual CPU", dev->dev.vcpu.number);
}
static void print_dev_emu(struct virt_device *dev,
diff -r 01b0a24fc16f -r f0153bd85ec1 src/Virt_RASD.c
--- a/src/Virt_RASD.c Mon Apr 14 15:17:08 2008 -0700
+++ b/src/Virt_RASD.c Tue Apr 15 11:50:05 2008 -0400
@@ -169,8 +169,10 @@ 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. */
+ int quantity = dev->dev.vcpu.number + 1;
CMSetProperty(inst, "VirtualQuantity",
- (CMPIValue *)&dev->dev.vcpu.quantity, CMPI_uint32);
+ (CMPIValue *)&quantity, CMPI_uint32);
}
/* FIXME: Put the HostResource in place */
@@ -343,6 +345,22 @@ static CMPIStatus _get_rasds(const CMPIB
if (count <= 0)
goto out;
+ /* Bit hackish, but for proc we need to cut list down to one. */
+ if (type == CIM_RES_TYPE_PROC) {
+ struct virt_device *tmp_dev = NULL;
+ tmp_dev = calloc(1, sizeof(*tmp_dev));
+ tmp_dev = virt_device_dup(&devs[count - 1]);
+
+ tmp_dev->id = strdup("proc");
+
+ for (i = 0; i < count; i++)
+ cleanup_virt_device(&devs[i]);
+
+ free(devs);
+ devs = tmp_dev;
+ count = 1;
+ }
+
for (i = 0; i < count; i++) {
CMPIInstance *dev = NULL;
const char *host = NULL;
16 years, 8 months
CimTest Report on XenFV 10-04-2008
by Deepti B Kalakeri
Hi,
Please find the test case list that are failing for the XenFV below:
Please see the attachment for the complete result.
Total FAIL : 14
ComputerSystem - 04_defineStartVS.py: FAIL
Thu, 10 Apr 2008 12:42:52:TEST LOG:INFO -
====04_defineStartVS.py Log====
Thu, 10 Apr 2008 12:42:53:TEST LOG:ERROR - Error: property
values are not set for VS domguest
ComputerSystem - 06_paused_active_suspend.py: FAIL
Thu, 10 Apr 2008 12:42:58:TEST LOG:INFO -
====06_paused_active_suspend.py Log====
Thu, 10 Apr 2008 12:42:59:TEST LOG:ERROR - Exception: (1,
u'CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Domain not running"')
Thu, 10 Apr 2008 12:42:59:TEST LOG:ERROR - Unable to suspend dom
DomST1 using RequestedStateChange()
ComputerSystem - 23_suspend_suspend.py: FAIL
Thu, 10 Apr 2008 12:43:03:TEST LOG:INFO -
====23_suspend_suspend.py Log====
Thu, 10 Apr 2008 12:43:04:TEST LOG:ERROR - Unexpected rc code 1
and description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
Thu, 10 Apr 2008 12:43:04:TEST LOG:ERROR - Unable to define
domain test_domain using DefineSystem()
ComputerSystem - 27_define_suspend_errs.py: FAIL
Thu, 10 Apr 2008 12:43:05:TEST LOG:INFO -
====27_define_suspend_errs.py Log====
Thu, 10 Apr 2008 12:43:05:TEST LOG:ERROR - Unexpected rc code 1
and description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
Thu, 10 Apr 2008 12:43:05:TEST LOG:ERROR - Unable to define
domain test_domain using DefineSystem()
ComputerSystem - 32_start_reboot.py: FAIL
Thu, 10 Apr 2008 12:43:06:TEST LOG:INFO -
====32_start_reboot.py Log====
Thu, 10 Apr 2008 12:43:06:TEST LOG:ERROR - Unexpected rc code 1
and description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
Thu, 10 Apr 2008 12:43:06:TEST LOG:ERROR - Unable to define
domain test_domain using DefineSystem()
ComputerSystem - 33_suspend_reboot.py: FAIL
Thu, 10 Apr 2008 12:43:08:TEST LOG:INFO -
====33_suspend_reboot.py Log====
Thu, 10 Apr 2008 12:43:08:TEST LOG:ERROR - Unexpected rc code 1
and description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
Thu, 10 Apr 2008 12:43:08:TEST LOG:ERROR - Unable to define
domain test_domain using DefineSystem()
ComputerSystem - 35_start_reset.py: FAIL
Thu, 10 Apr 2008 12:43:09:TEST LOG:INFO - ====35_start_reset.py
Log====
Thu, 10 Apr 2008 12:43:09:TEST LOG:ERROR - Unexpected rc code 1
and description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
Thu, 10 Apr 2008 12:43:09:TEST LOG:ERROR - Unable to define
domain test_domain using DefineSystem()
ComputerSystem - 40_RSC_start.py: FAIL
Thu, 10 Apr 2008 12:43:10:TEST LOG:INFO - ====40_RSC_start.py
Log====
Thu, 10 Apr 2008 12:43:11:TEST LOG:ERROR - Unexpected rc code 1
and description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
Thu, 10 Apr 2008 12:43:11:TEST LOG:ERROR - Exception: ('Unable
create domain %s using DefineSystem()', 'test_domain')
ComputerSystemIndication - 01_created_indication.py: FAIL
Thu, 10 Apr 2008 12:43:14:TEST LOG:INFO -
====01_created_indication.py Log====
Thu, 10 Apr 2008 12:46:23:TEST LOG:ERROR - error : (110,
'Connection timed out')
Memory - 02_defgetmem.py: FAIL
Thu, 10 Apr 2008 12:47:30:TEST LOG:INFO - ====02_defgetmem.py Log====
Thu, 10 Apr 2008 12:47:30:TEST LOG:ERROR - Unexpected rc code 1 and
description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
Thu, 10 Apr 2008 12:47:30:TEST LOG:ERROR - Exception: Unable to
create domain domu using DefineSys()
NetworkPort - 01_netport.py: FAIL
Thu, 10 Apr 2008 12:47:35:TEST LOG:INFO - ====01_netport.py Log====
Thu, 10 Apr 2008 12:47:36:TEST LOG:ERROR - KeyError : '__eq__'
Processor - 02_definesys_get_procs.py: FAIL
Thu, 10 Apr 2008 12:47:45:TEST LOG:INFO -
====02_definesys_get_procs.py Log====
Thu, 10 Apr 2008 12:47:45:TEST LOG:ERROR - Unexpected rc code 1
and description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
Thu, 10 Apr 2008 12:47:45:TEST LOG:ERROR - Exception: Unable
create domain test_domain using DefineSystem()
VirtualSystemManagementService - 01_definesystem_name.py: FAIL
Thu, 10 Apr 2008 12:49:09:TEST LOG:INFO -
====01_definesystem_name.py Log====
Thu, 10 Apr 2008 12:49:09:TEST LOG:ERROR - Unexpected rc code 1
and description:
CIM_ERR_FAILED: A general error occurred that is not covered by a more
specific error code: "Failed to create domain"
VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL
Thu, 10 Apr 2008 12:49:17:TEST LOG:INFO -
====05_destroysystem_neg.py Log====
Thu, 10 Apr 2008 12:49:17:TEST LOG:ERROR -
destroy_fail>>nonexistent: Got rc: 2, but we expect 4
Thu, 10 Apr 2008 12:49:17:TEST LOG:ERROR -
destroy_fail>>nonexistent: Got rc: 2, but we expect 4
Thanks and Regards,
Deepti.
16 years, 8 months
[PATCH] Add revision information to the VSMS
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1208209155 25200
# Node ID 606a412caaf41e1d49ca47809ec0e94e65f29785
# Parent 67e30fff0026214f509e688bdb082d07ffd267f2
Add revision information to the VSMS
This is done at build time, if possible. If not, the changeset/revision
at the last automake run will be used. This should make it work for the
tarball/release case as well as the RPM build.
The way this works, if you build, then apply a patch or pull a new changeset,
the exposed revision/version information will be stale unless you do a clean.
Since this is really just for the purposes of test-tracking, I think this
is a reasonable restriction that can be minded by the people doing testing.
The changeset hash and revision number are exposed in aptly-named properties
of the VSMS for each platform. If anyone has a better place for these to
show up, or a better format, please bring it up.
Changes:
- Update the VSMS schema for the new values
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 67e30fff0026 -r 606a412caaf4 Makefile.am
--- a/Makefile.am Mon Apr 14 10:49:02 2008 -0700
+++ b/Makefile.am Mon Apr 14 14:39:15 2008 -0700
@@ -98,7 +98,8 @@ pkgdata_SCRIPTS = provider-register.sh
EXTRA_DIST = schema $(pkgdata_DATA) $(pkgdata_SCRIPTS) \
libvirt-cim.spec.in libvirt-cim.spec \
- doc/CodingStyle doc/SubmittingPatches
+ doc/CodingStyle doc/SubmittingPatches \
+ .changeset .revision
preinstall:
sh -x base_schema/install_base_schema.sh `pwd`/base_schema
diff -r 67e30fff0026 -r 606a412caaf4 acinclude.m4
--- a/acinclude.m4 Mon Apr 14 10:49:02 2008 -0700
+++ b/acinclude.m4 Mon Apr 14 14:39:15 2008 -0700
@@ -313,4 +313,23 @@ AC_DEFUN([DEFINE_DISK_CONFIG],
[
AC_DEFINE_UNQUOTED([DISK_POOL_CONFIG], "$1", [Disk pool config filepath.])
]
-)
\ No newline at end of file
+)
+
+AC_DEFUN([SET_CSET],
+ [
+ if test -d .hg && test -x $(which hg); then
+ cs='-DLIBVIRT_CIM_CS=\"`hg id -i`\"'
+ rv='-DLIBVIRT_CIM_RV=\"`hg id -n`\"'
+ elif test -f .changeset; then
+ cset=$(cat .changeset)
+ revn=$(cat .revision)
+ cs="-DLIBVIRT_CIM_CS=\\\"$cset\\\""
+ rv="-DLIBVIRT_CIM_RV=\\\"$revn\\\""
+ else
+ cs='-DLIBVIRT_CIM_CS=\"Unknown\"'
+ rv='-DLIBVIRT_CIM_RV=\"0\"'
+ fi
+
+ CFLAGS="$CFLAGS $cs $rv"
+ ]
+)
diff -r 67e30fff0026 -r 606a412caaf4 autoconfiscate.sh
--- a/autoconfiscate.sh Mon Apr 14 10:49:02 2008 -0700
+++ b/autoconfiscate.sh Mon Apr 14 14:39:15 2008 -0700
@@ -17,4 +17,12 @@ echo "Running autoconf ..." &&
echo "Running autoconf ..." &&
autoconf --force &&
+if test -x $(which hg); then
+ hg id -i > .changeset
+ hg id -n > .revision
+else
+ echo "Unknown" > .changeset
+ echo "0" > .revision
+fi
+
echo "You may now run ./configure"
diff -r 67e30fff0026 -r 606a412caaf4 configure.ac
--- a/configure.ac Mon Apr 14 10:49:02 2008 -0700
+++ b/configure.ac Mon Apr 14 14:39:15 2008 -0700
@@ -143,6 +143,7 @@ AC_SUBST(CFLAGS_STRICT)
AC_SUBST(CFLAGS_STRICT)
CFLAGS="$CFLAGS $CC_WARNINGS"
+SET_CSET
# Display configuration options
echo "----------------------------------------------------------"
diff -r 67e30fff0026 -r 606a412caaf4 schema/VirtualSystemManagementService.mof
--- a/schema/VirtualSystemManagementService.mof Mon Apr 14 10:49:02 2008 -0700
+++ b/schema/VirtualSystemManagementService.mof Mon Apr 14 14:39:15 2008 -0700
@@ -3,14 +3,29 @@
[Provider("cmpi::Virt_VirtualSystemManagementService")]
class Xen_VirtualSystemManagementService : CIM_VirtualSystemManagementService
{
+ [Description("HG changeset id of the providers")]
+ string Changeset;
+
+ [Description("HG revision number of the providers")]
+ string Revision;
};
[Provider("cmpi::Virt_VirtualSystemManagementService")]
class KVM_VirtualSystemManagementService : CIM_VirtualSystemManagementService
{
+ [Description("HG changeset id of the providers")]
+ string Changeset;
+
+ [Description("HG revision number of the providers")]
+ string Revision;
};
[Provider("cmpi::Virt_VirtualSystemManagementService")]
class LXC_VirtualSystemManagementService : CIM_VirtualSystemManagementService
{
+ [Description("HG changeset id of the providers")]
+ string Changeset;
+
+ [Description("HG revision number of the providers")]
+ string Revision;
};
diff -r 67e30fff0026 -r 606a412caaf4 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Apr 14 10:49:02 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Mon Apr 14 14:39:15 2008 -0700
@@ -1246,6 +1246,12 @@ CMPIStatus get_vsms(const CMPIObjectPath
CMSetProperty(inst, "SystemCreationClassName",
(CMPIValue *)ccname, CMPI_chars);
+ CMSetProperty(inst, "Changeset",
+ (CMPIValue *)LIBVIRT_CIM_CS, CMPI_chars);
+
+ CMSetProperty(inst, "Revision",
+ (CMPIValue *)LIBVIRT_CIM_RV, CMPI_chars);
+
if (is_get_inst) {
s = cu_validate_ref(broker, reference, inst);
if (s.rc != CMPI_RC_OK)
16 years, 8 months
[PATCH] Fix device_parsing of processors
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1208268646 14400
# Node ID fe472b0c6ec8714120c16165e8f09207f8823efb
# Parent a185e443ad6012d86690194112393d58e8c51967
Fix device_parsing of processors.
Kaitlin discovered that my changes to device_parsing.c make it so we only get one Processor as well, not just one Proc RASD. This moves the flattening step up a little higher so that enumerating on Processor works correctly. It's not the prettiest approach to things, but I think given Processor's unique Device-RASD relationship it's a good compromise. I would of course be open to suggestions for making it a bit more elegant.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r a185e443ad60 -r fe472b0c6ec8 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Tue Apr 08 11:32:06 2008 -0400
+++ b/libxkutil/device_parsing.c Tue Apr 15 10:10:46 2008 -0400
@@ -337,6 +337,7 @@ 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)
@@ -346,15 +347,24 @@ static int parse_vcpu_device(xmlNode *no
free(count_str);
- list = calloc(1, sizeof(*list));
+ list = calloc(count, sizeof(*list));
if (list == NULL)
goto err;
-
- list->dev.vcpu.quantity = count;
+
+ 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;
+ }
*vdevs = list;
- return 1;
+ return count;
err:
free(list);
@@ -610,7 +620,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.quantity = _dev->dev.vcpu.quantity;
+ dev->dev.vcpu.number = _dev->dev.vcpu.number;
} else if (dev->type == CIM_RES_TYPE_EMU) {
DUP_FIELD(dev, _dev, dev.emu.path);
} else if (dev->type == CIM_RES_TYPE_GRAPHICS) {
@@ -662,32 +672,6 @@ 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;
@@ -699,8 +683,6 @@ 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 a185e443ad60 -r fe472b0c6ec8 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Tue Apr 08 11:32:06 2008 -0400
+++ b/libxkutil/device_parsing.h Tue Apr 15 10:10:46 2008 -0400
@@ -50,7 +50,7 @@ struct mem_device {
};
struct vcpu_device {
- uint32_t quantity;
+ uint32_t number;
};
struct emu_device {
diff -r a185e443ad60 -r fe472b0c6ec8 src/Virt_RASD.c
--- a/src/Virt_RASD.c Tue Apr 08 11:32:06 2008 -0400
+++ b/src/Virt_RASD.c Tue Apr 15 10:10:46 2008 -0400
@@ -169,8 +169,10 @@ 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. */
+ int quantity = dev->dev.vcpu.number + 1;
CMSetProperty(inst, "VirtualQuantity",
- (CMPIValue *)&dev->dev.vcpu.quantity, CMPI_uint32);
+ (CMPIValue *)&quantity, CMPI_uint32);
}
/* FIXME: Put the HostResource in place */
@@ -343,6 +345,22 @@ static CMPIStatus _get_rasds(const CMPIB
if (count <= 0)
goto out;
+ /* Bit hackish, but for proc we need to cut list down to one. */
+ if (type == CIM_RES_TYPE_PROC) {
+ struct virt_device *tmp_dev = NULL;
+ tmp_dev = calloc(1, sizeof(*tmp_dev));
+ tmp_dev = virt_device_dup(&devs[count - 1]);
+
+ tmp_dev->id = strdup("proc");
+
+ for (i = 0; i < count; i++)
+ cleanup_virt_device(&devs[i]);
+
+ free(devs);
+ devs = tmp_dev;
+ count = 1;
+ }
+
for (i = 0; i < count; i++) {
CMPIInstance *dev = NULL;
const char *host = NULL;
16 years, 8 months
[PATCH] [TEST] fix error code and description in ElementConforms.04
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208240754 -28800
# Node ID 0dd12af47c75cf09c45b00684c05a5b04efce8fa
# Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2
[TEST] fix error code and description in ElementConforms.04
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 137e5079c73f -r 0dd12af47c75 suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Fri Apr 11 16:58:23 2008 +0530
+++ b/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Tue Apr 15 14:25:54 2008 +0800
@@ -91,11 +91,18 @@
ac_classname = 'Xen_ElementConformsToProfile'
bug = '92642'
-expr_values = {
- "INVALID_CCName_Keyname" : { 'rc' : '' , 'desc' : '' }, \
- "INVALID_CCName_Keyvalue" : { 'rc' : '' , 'desc' : '' }, \
- "INVALID_Name_Keyname" : { 'rc' : '' , 'desc' : '' }, \
- "INVALID_Name_Keyvalue" : { 'rc' : '' , 'desc' : '' }
+cs_values = {
+ "INVALID_CCName_Keyname" : { 'rc' : 6 , 'desc' : 'No such instance' }, \
+ "INVALID_CCName_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' }, \
+ "INVALID_Name_Keyname" : { 'rc' : 1 , 'desc' : 'No domain name specified'}, \
+ "INVALID_Name_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' }
+ }
+
+hs_values = {
+ "INVALID_CCName_Keyname" : { 'rc' : 6 , 'desc' : 'No such instance' }, \
+ "INVALID_CCName_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' }, \
+ "INVALID_Name_Keyname" : { 'rc' : 6 , 'desc' : 'No such instance'}, \
+ "INVALID_Name_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' }
}
def try_invalid_assoc(classname, name_val, i, field):
@@ -106,6 +113,10 @@
for j in range(len(name_val)/2):
k = j * 2
keys[name_val[k]] = name_val[k+1]
+ if classname == "Xen_HostSystem":
+ expr_values = hs_values
+ else:
+ expr_values = cs_values
ret_val = try_assoc(conn, classname, ac_classname, keys, field_name=field, \
expr_values=expr_values[field], bug_no=bug)
if ret_val != PASS:
16 years, 8 months