[PATCH] [TEST] Removing graphics device from this test
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1295022559 28800
# Node ID f98167abd981e7e9551c26ab8367c8b2b71829dd
# Parent d54a6a278fa33413148d9a2ca63257284e5f7a1c
[TEST] Removing graphics device from this test.
The VM does not have a graphics device. It is
being removed.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r d54a6a278fa3 -r f98167abd981 suites/libvirt-cim/cimtest/VirtualSystemManagementService/16_removeresource.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/16_removeresource.py Fri Jan 14 08:20:38 2011 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/16_removeresource.py Fri Jan 14 08:29:19 2011 -0800
@@ -66,7 +66,8 @@
sds_classname = get_typed_class(options.virt, 'SettingsDefineState')
mem = get_typed_class(options.virt, 'Memory')
proc = get_typed_class(options.virt, 'Processor')
- dev_not_rem = [mem, proc]
+ input = get_typed_class(options.virt, 'PointingDevice')
+ dev_not_rem = [mem, proc, input]
service = get_vsms_class(options.virt)(options.ip)
for dev in devs:
13 years, 10 months
[PATCH] [TEST] Memory is calculated in block sizes
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1295021879 28800
# Node ID 0d0d87b8a5b44ed0af9c32490db7d7fcc586cf21
# Parent a0f35dd8ba2843bd548a3c3d0186e0fc48a9113d
[TEST] Memory is calculated in block sizes.
This test was modifying the VM memory and then
verify that the new memory size matches the expected
memory. The test was failing because memory was not
getting multiplied by the block size (512). Updated this
test to account for memory size in blocks.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r a0f35dd8ba28 -r 0d0d87b8a5b4 suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Fri Jan 14 08:16:16 2011 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Fri Jan 14 08:17:59 2011 -0800
@@ -41,7 +41,7 @@
ntype = 'network'
cpu = 2
ncpu = 1
-nmem = 256
+nmem = 131072
new_int = randint(10, 99)
new_mac1 = "11:%s:22:%s:33:%s" % (new_int, new_int, new_int)
new_int += 1
13 years, 10 months
[PATCH] [TEST] Memory is calculated in block sizes
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1295019233 28800
# Node ID a99191b4a4f499c452cb50558b87f9c03925f1f2
# Parent 8866ff769a7637cbee7c793827152649856815f2
[TEST] Memory is calculated in block sizes.
This test was modifying the VM memory and then
verify that the new memory size matches the expected
memory. The test was failing because memory was not
getting multiplied by the block size (512). Updated this
test to account for memory size in blocks.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 8866ff769a76 -r a99191b4a4f4 suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py
--- a/suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py Fri Jan 14 07:25:16 2011 -0800
+++ b/suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py Fri Jan 14 07:33:53 2011 -0800
@@ -45,7 +45,7 @@
sup_types = ['KVM', 'Xen', 'XenFV']
libvirt_guest_rasd_indication_rev = 980
-nmem = 256
+nmem = 131072
nmac = '00:11:22:33:44:55'
def create_guest(test_dom, ip, virt, cxml):
13 years, 10 months
[PATCH] [TEST] Updated test to only verify disk RASD
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1295018716 28800
# Node ID 8866ff769a7637cbee7c793827152649856815f2
# Parent 2c9689c31d42c2320ecca7a4283bd564c5a27737
[TEST] Updated test to only verify disk RASD.
This test was written to look for disk and cdrom.
But default VM created by this test case only uses
disk and no cdrom. This test has been updated to
test for disk only.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 2c9689c31d42 -r 8866ff769a76 suites/libvirt-cim/cimtest/RASD/05_disk_rasd_emu_type.py
--- a/suites/libvirt-cim/cimtest/RASD/05_disk_rasd_emu_type.py Fri Jan 14 07:06:49 2011 -0800
+++ b/suites/libvirt-cim/cimtest/RASD/05_disk_rasd_emu_type.py Fri Jan 14 07:25:16 2011 -0800
@@ -42,47 +42,43 @@
if curr_cim_rev < libvirt_em_type_changeset:
return SKIP
- if options.virt == 'Xen':
- emu_types = [0]
- else:
- emu_types = [0, 1]
+ exp_emu_type = 0
try:
- for exp_emu_type in emu_types:
- virt_xml = get_class(options.virt)
- cxml = virt_xml(default_dom, emu_type=exp_emu_type)
- ret = cxml.cim_define(options.ip)
- if not ret:
- logger.error("Failed to call DefineSystem()")
- return FAIL
+ virt_xml = get_class(options.virt)
+ cxml = virt_xml(default_dom, emu_type=exp_emu_type)
+ ret = cxml.cim_define(options.ip)
+ if not ret:
+ logger.error("Failed to call DefineSystem()")
+ return FAIL
- drasd= get_typed_class(options.virt,
- 'DiskResourceAllocationSettingData')
+ drasd= get_typed_class(options.virt,
+ 'DiskResourceAllocationSettingData')
- drasd_list = EnumInstances(options.ip, drasd, ret_cim_inst=True)
- if len(drasd_list) < 1:
- raise Exception("%s returned %i instances, expected at least 1"\
- %(drasd, len(drasd_list)))
+ drasd_list = EnumInstances(options.ip, drasd, ret_cim_inst=True)
+ if len(drasd_list) < 1:
+ raise Exception("%s returned %i instances, expected at least 1"\
+ %(drasd, len(drasd_list)))
- found_rasd = None
- for rasd in drasd_list:
- guest, dev, status = parse_instance_id(rasd['InstanceID'])
- if status != PASS:
- raise Exception("Unable to parse InstanceID: %s" \
- % rasd['InstanceID'])
- if guest == default_dom:
- if rasd['EmulatedType'] == exp_emu_type:
- found_rasd = rasd
- status = PASS
- break
- else:
- raise Exception("EmulatedType Mismatch: got %d,"
- "expected %d" %(rasd['EmulatedType'],
- exp_emu_type))
+ found_rasd = None
+ for rasd in drasd_list:
+ guest, dev, status = parse_instance_id(rasd['InstanceID'])
+ if status != PASS:
+ raise Exception("Unable to parse InstanceID: %s" \
+ % rasd['InstanceID'])
+ if guest == default_dom:
+ if rasd['EmulatedType'] == exp_emu_type:
+ found_rasd = rasd
+ status = PASS
+ break
+ else:
+ raise Exception("EmulatedType Mismatch: got %d,"
+ "expected %d" %(rasd['EmulatedType'],
+ exp_emu_type))
- if found_rasd is None:
- raise Exception("DiskRASD for defined dom was not found")
+ if found_rasd is None:
+ raise Exception("DiskRASD for defined dom was not found")
- cxml.undefine(options.ip)
+ cxml.undefine(options.ip)
except Exception, detail:
logger.error("Exception: %s", detail)
13 years, 10 months
[PATCH] [TEST] Updated test case for VSI
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1295017601 28800
# Node ID a226c6d2bccad847da03d29746b8f2c821957517
# Parent bb3fbbcdfd16998662bc8187dcdac95f959473d0
[TEST] Updated test case for VSI.
libvirt-cim netpool template was changed to support VSI
and this test has been updated to reflect the new template
count.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r bb3fbbcdfd16 -r a226c6d2bcca suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri Jan 14 06:56:10 2011 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri Jan 14 07:06:41 2011 -0800
@@ -395,11 +395,14 @@
def get_exp_net_rasd_len(virt, rev, id):
net_rasd_template_changes = 861
net_rasd_direct_nettype_changes = 1029
+ net_rasd_vsi_nettype_changes = 1043
# NetRASD record for Direct NetType 1 for each min, max, incr, default
exp_direct = 4
exp_base_num = 4
+ dev_types = 2
+ net_types = 3
if id == "NetworkPool/0":
pool_types = 3
@@ -408,14 +411,13 @@
return (exp_base_num * pool_types) + (exp_base_num * forward_modes)
if rev >= net_rasd_template_changes:
- dev_types = 2
- net_types = 3
exp_base_num = exp_base_num * dev_types * net_types
- if rev >= net_rasd_direct_nettype_changes:
- exp_base_num += exp_direct
+ if rev >= net_rasd_direct_nettype_changes:
+ exp_base_num += exp_direct
- return exp_base_num
+ if rev >= net_rasd_vsi_nettype_changes:
+ exp_base_num = 4 * (dev_types * net_types + exp_direct)
return exp_base_num
13 years, 10 months
[PATCH] [TEST] Updated this testcase to focus on pause/resume
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1295017609 28800
# Node ID 2c9689c31d42c2320ecca7a4283bd564c5a27737
# Parent a226c6d2bccad847da03d29746b8f2c821957517
[TEST] Updated this testcase to focus on pause/resume.
This test was running suspend and reboot which is not
supported on all hypervisor types. So changed this test
case to focus on pause and resume.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r a226c6d2bcca -r 2c9689c31d42 suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Fri Jan 14 07:06:41 2011 -0800
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Fri Jan 14 07:06:49 2011 -0800
@@ -59,7 +59,7 @@
server = options.ip
virt = options.virt
- tc_scen = ['Start', 'Suspend', 'Reboot']
+ tc_scen = ['Start', 'Paused', 'Resume']
action_passed = PASS
try:
@@ -73,10 +73,10 @@
for action in tc_scen:
if action == "Start":
status = cxml.cim_start(server)
- elif action == "Suspend":
- status = cxml.cim_suspend(server)
- elif action == "Reboot":
- status = cxml.cim_reboot(server)
+ elif action == "Paused":
+ status = cxml.cim_pause(server)
+ elif action == "Resume":
+ status = cxml.cim_reset(server)
else:
raise Exception("Unexpected state change: %s" % action)
13 years, 10 months
Release of libvirt-cim-0.5.11 and libcmpiutil-0.5.4
by Chip Vincent
When publishing this release, I mistakenly overwrote the released tar
files with different ones. The "alternate" versions now have the
extension ".override" and you should avoid using them, if possible I'm
in the process now of publishing new release (and new version :) with
all the upstream content so everything is back in sync. Sorry for any
confusion.
Also, be aware libvirt-cim-0.5.11 depends on libcmpiutil-0.5.4.
libvirt-cim-0.5.11
ftp://libvirt.org/libvirt-cim/libvirt-cim-0.5.11.tar.gz
* Update indication providers to the std_indication interface change
introduced in libcmpiutil f967d9432f31 (Chip Vincent)
* Fix to support domain name with space (Sharad Mishra)
* Patch to allow cdrom media change (Sharad Mishra)
* Add domain UUID and timestamp to ComputerSystem and MigrationJob
Indications (Chip Vincent)
* Return profiles according to role (Chip Vincent)
* Removing the code to fetch sblim instance (Sharad Mishra)
* Update revision and force creation of INFO_STORE during install
(Chip Vincent)
* NetRASD enumeration to show VSI fields (Sharad Mishra)
* Set default VM autostart value (Sharad Mishra)
* Generating Deleted indication after Modified indication (Sharad
Mishra)
* Workaround for Pegasus ObjectPath issue. (Sharad Mishra)
* Bypass cdrom check while defining VMs (Sharad Mishra)
* Ensure AllocationUnits property populates the libvirt XML
'capacity unit' AND 'allocation unit' so they are the same (Chip
Vincent)
* Use libvirt to get StorageVolume Path to set SV InstanceID (Sharad
Mishra)
* Update xml generation to support vepa (Sharad Mishra)
libcmpiutil-0.5.4
ftp://libvirt.org/libvirt-cim/libcmpiutil-0.5.4.tar.gz
* Restore const to interface to avoid warnings (Chip Vincent)
* Add method to merge RASDs (Sharad Mishra)
* Missing namespace from migration indications (Sharad Mishra)
* Adding CMReturnDone after CMPI InvokeMethod (Sharad Mishra)
--
Chip Vincent
Open Virtualization, Linux Technology Center
IBM Systems & Technology Group
phone: 919-254-4482, T/L 444-4482
email: cvincent(a)us.ibm.com
13 years, 11 months
[PATCH] UUID and Timestamp were incorrectly set for indications
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1294774143 28800
# Node ID 16a78de40b7fd62ee6d83e1491b52a4cf86a3839
# Parent 28f3d6f46a06aa5be6aba8bcfeda55bd0ddc5468
UUID and Timestamp were incorrectly set for indications.
CMSetProperty call was failing to set uuid and timestamp
since they were not properly passed.
signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 28f3d6f46a06 -r 16a78de40b7f src/Virt_ComputerSystemIndication.c
--- a/src/Virt_ComputerSystemIndication.c Mon Dec 27 16:32:02 2010 -0800
+++ b/src/Virt_ComputerSystemIndication.c Tue Jan 11 11:29:03 2011 -0800
@@ -282,11 +282,11 @@
uuid = CMGetProperty(affected_inst, "UUID", &s);
CMSetProperty(ind, "IndicationIdentifier",
- (CMPIValue *)&uuid, CMPI_string);
+ (CMPIValue *)&(uuid.value), CMPI_string);
timestamp = CMNewDateTime(broker, &s);
CMSetProperty(ind, "IndicationTime",
- (CMPIValue *)timestamp, CMPI_dateTime);
+ (CMPIValue *)×tamp, CMPI_dateTime);
if (ind_type == CS_MODIFIED) {
CMSetProperty(ind, "PreviousInstance",
diff -r 28f3d6f46a06 -r 16a78de40b7f src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Mon Dec 27 16:32:02 2010 -0800
+++ b/src/Virt_VSMigrationService.c Tue Jan 11 11:29:03 2011 -0800
@@ -755,6 +755,7 @@
return false;
ind_name = ind_type_to_name(ind_type);
+ CU_DEBUG("Raising %s indication", ind_name);
ref = CMGetObjectPath(inst, &s);
@@ -847,7 +848,7 @@
timestamp = CMNewDateTime(broker, s);
CMSetProperty(ind, "IndicationTime",
- (CMPIValue *)timestamp, CMPI_dateTime);
+ (CMPIValue *)×tamp, CMPI_dateTime);
if (ind_type == MIG_MODIFIED) {
/* Need to copy job inst before attaching as PreviousInstance
13 years, 11 months
[PATCH] Fixing NullPointerException
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1293660976 28800
# Node ID a4f6fba67e8e85aaec6969c39cfaa016b60779d3
# Parent 35396e5b805193c024b6d4f065136d7b57a0b03d
Fixing NullPointerException
CMPIInstance 'inst' is used before it is set.
With this patch sending a one line change to
set previous instance correctly.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 35396e5b8051 -r a4f6fba67e8e src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Dec 14 13:59:51 2010 -0800
+++ b/src/Virt_VirtualSystemManagementService.c Wed Dec 29 14:16:16 2010 -0800
@@ -1378,16 +1378,6 @@
goto out;
}
- if (cu_get_str_prop(inst, "autoStart", &autoStartFlag) != CMPI_RC_OK)
- autoStartFlag = strdup("disable");
-
- if (STREQ(autoStartFlag, "enable"))
- autoflag = 1;
- else
- autoflag = 0;
- if((virDomainSetAutostart(dom, autoflag)) == -1)
- CU_DEBUG("Failed to set autostart flag.");
-
name = virDomainGetName(dom);
*s = get_domain_by_name(_BROKER, ref, name, &inst);
@@ -1396,6 +1386,20 @@
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
"Failed to lookup resulting system");
+ goto out;
+ }
+
+ if (inst != NULL) {
+ if (cu_get_str_prop(inst, "autoStart",
+ &autoStartFlag) != CMPI_RC_OK)
+ autoStartFlag = strdup("disable");
+
+ if (STREQ(autoStartFlag, "enable"))
+ autoflag = 1;
+ else
+ autoflag = 0;
+ if((virDomainSetAutostart(dom, autoflag)) == -1)
+ CU_DEBUG("Failed to set autostart flag.");
}
out:
@@ -2424,12 +2428,12 @@
goto out;
}
+ prev_inst = orig_inst;
s = cu_merge_instances(rasd, orig_inst);
if (s.rc != CMPI_RC_OK) {
CU_DEBUG("Failed to merge Instances");
goto out;
}
- prev_inst = orig_inst;
rasd = orig_inst;
}
13 years, 11 months
[PATCH] Patch to fix missing DiskPool type
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1293496322 28800
# Node ID 28f3d6f46a06aa5be6aba8bcfeda55bd0ddc5468
# Parent 35396e5b805193c024b6d4f065136d7b57a0b03d
Patch to fix missing DiskPool type.
DiskPool type was not being populated.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 35396e5b8051 -r 28f3d6f46a06 libxkutil/pool_parsing.c
--- a/libxkutil/pool_parsing.c Tue Dec 14 13:59:51 2010 -0800
+++ b/libxkutil/pool_parsing.c Mon Dec 27 16:32:02 2010 -0800
@@ -166,6 +166,30 @@
return 1;
}
+char *get_disk_pool_type(uint16_t type)
+{
+
+ switch (type) {
+ case DISK_POOL_DIR:
+ return "dir";
+ case DISK_POOL_FS:
+ return "fs";
+ case DISK_POOL_NETFS:
+ return "netfs";
+ case DISK_POOL_DISK:
+ return "disk";
+ case DISK_POOL_ISCSI:
+ return "iscsi";
+ case DISK_POOL_LOGICAL:
+ return "logical";
+ case DISK_POOL_SCSI:
+ return "scsi";
+ default:
+ return NULL;
+ }
+
+}
+
static const char *parse_disk_pool(xmlNodeSet *nsv, struct disk_pool *pool)
{
xmlNode **nodes = nsv->nodeTab;
diff -r 35396e5b8051 -r 28f3d6f46a06 libxkutil/pool_parsing.h
--- a/libxkutil/pool_parsing.h Tue Dec 14 13:59:51 2010 -0800
+++ b/libxkutil/pool_parsing.h Mon Dec 27 16:32:02 2010 -0800
@@ -86,6 +86,7 @@
void cleanup_virt_pool_res(struct virt_pool_res **res);
int get_pool_from_xml(const char *xml, struct virt_pool *pool, int type);
+char *get_disk_pool_type(uint16_t type);
int define_pool(virConnectPtr conn, const char *xml, int res_type);
int destroy_pool(virConnectPtr conn, const char *name, int res_type);
diff -r 35396e5b8051 -r 28f3d6f46a06 src/Virt_DevicePool.c
--- a/src/Virt_DevicePool.c Tue Dec 14 13:59:51 2010 -0800
+++ b/src/Virt_DevicePool.c Mon Dec 27 16:32:02 2010 -0800
@@ -172,6 +172,7 @@
virStoragePoolInfo info;
uint64_t cap;
uint64_t res;
+ uint16_t type;
struct virt_pool *pool_vals = NULL;
const char *pool_str = NULL;
@@ -204,6 +205,10 @@
CMSetProperty(inst, "Path",
(CMPIValue *)pool_str, CMPI_chars);
}
+ type = pool_vals->pool_info.disk.pool_type;
+ CMSetProperty(inst, "OtherResourceType",
+ (CMPIValue *)get_disk_pool_type(type),
+ CMPI_chars);
}
result = true;
@@ -957,11 +962,19 @@
const char *refcn,
const CMPIBroker *broker)
{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
char *poolid = NULL;
inst = get_typed_instance(broker, refcn, "DiskPool", ns);
+ if (inst == NULL) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to init DiskPool instance");
+ goto out;
+ }
+
if (asprintf(&poolid, "DiskPool/%s", pool->tag) == -1)
return NULL;
@@ -976,6 +989,7 @@
CU_DEBUG("Failed to set capacity for disk pool: %s",
pool->tag);
+out:
free(poolid);
return inst;
13 years, 11 months