[PATCH] Include stat.h
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1274737698 25200
# Node ID db79e8c20f6217503c7152186fd37751da9ce9ec
# Parent 19ce54b3c16676a443c5df53562b0d67294dc04c
Include stat.h
This file should be included to support *stat* functions.
Signed-off-by: Sharad Mishra<snmishra(a)us.ibm.com>
diff -r 19ce54b3c166 -r db79e8c20f62 libxkutil/infostore.c
--- a/libxkutil/infostore.c Thu May 06 21:22:31 2010 -0400
+++ b/libxkutil/infostore.c Mon May 24 14:48:18 2010 -0700
@@ -23,6 +23,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <inttypes.h>
+#include <sys/stat.h>
#include <sys/file.h>
#include <string.h>
14 years, 4 months
[PATCH] Workaround for Pegasus ObjectPath issue
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1274997567 25200
# Node ID 49781459fdcfb5cd91eb7c1e99701d663d5b53eb
# Parent 8b1793add36c7e72933c2f8f04c400fa9d3b8910
Workaround for Pegasus ObjectPath issue.
Pegasus loses its object path after a call to CMGetObjectPath.
This patch adds the object path back to indication.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 8b1793add36c -r 49781459fdcf src/Virt_ResourceAllocationSettingDataIndication.c
--- a/src/Virt_ResourceAllocationSettingDataIndication.c Thu May 27 14:09:56 2010 -0700
+++ b/src/Virt_ResourceAllocationSettingDataIndication.c Thu May 27 14:59:27 2010 -0700
@@ -113,6 +113,10 @@
args->classname = strdup(CLASSNAME(ref));
args->_ctx = _ctx;
+ /* This is a workaround for Pegasus, it loses its objectpath by
+ CMGetObjectPath. So set it back. */
+ ind->ft->setObjectPath((CMPIInstance *)ind, ref);
+
s = stdi_deliver(broker, ctx, args, (CMPIInstance *)ind);
if (s.rc == CMPI_RC_OK) {
CU_DEBUG("Indication delivered");
diff -r 8b1793add36c -r 49781459fdcf src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Thu May 27 14:09:56 2010 -0700
+++ b/src/Virt_VSMigrationService.c Thu May 27 14:59:27 2010 -0700
@@ -757,6 +757,11 @@
ind_name = ind_type_to_name(ind_type);
ref = CMGetObjectPath(inst, &s);
+
+ /* This is a workaround for Pegasus, it loses its objectpath by
+ CMGetObjectPath. So set it back. */
+ inst->ft->setObjectPath((CMPIInstance *)inst, ref);
+
if ((ref == NULL) || (s.rc != CMPI_RC_OK)) {
CU_DEBUG("Failed to get job reference");
} else {
14 years, 6 months
[PATCH] Generating Deleted indication after Modified indication.
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra<snmishra(a)us.ibm.com>
# Date 1269035366 25200
# Node ID 9147baed9cf8a7bf32a8076d7f98931a940eb59f
# Parent 4ee7c4354bc550780bc02ef1f69fbda387b3fe13
Generating Deleted indication after Modified indication.
This patch moves migration job deleted indication after migration job
modified (job completed) indication.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 4ee7c4354bc5 -r 9147baed9cf8 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Tue Mar 02 15:23:45 2010 -0800
+++ b/src/Virt_VSMigrationService.c Fri Mar 19 14:49:26 2010 -0700
@@ -1235,7 +1235,6 @@
}
out:
clear_infstore_migration_flag(dom);
- raise_deleted_ind(job);
free(uri);
free(xml);
@@ -1266,6 +1265,7 @@
CIM_JOBSTATE_COMPLETE,
"Completed");
+ raise_deleted_ind(job);
virConnectClose(job->conn);
free(job->domain);
free(job->ref_cn);
14 years, 7 months
[PATCH] Bypass cdrom check while defining VMs
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1274298264 25200
# Node ID 7e986e4a6963fa655d7a5ee70fd5819ae421471a
# Parent 19ce54b3c16676a443c5df53562b0d67294dc04c
Bypass cdrom check while defining VMs.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 19ce54b3c166 -r 7e986e4a6963 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Thu May 06 21:22:31 2010 -0400
+++ b/src/Virt_VirtualSystemManagementService.c Wed May 19 12:44:24 2010 -0700
@@ -810,8 +810,11 @@
if (type == VIRT_DISK_TYPE_DISK)
dev->dev.disk.device = strdup("disk");
- else if (type == VIRT_DISK_TYPE_CDROM)
+ else if (type == VIRT_DISK_TYPE_CDROM) {
dev->dev.disk.device = strdup("cdrom");
+ if (dev->dev.disk.disk_type == DISK_UNKNOWN)
+ dev->dev.disk.disk_type = DISK_PHY;
+ }
else if (type == VIRT_DISK_TYPE_FLOPPY)
dev->dev.disk.device = strdup("floppy");
else
14 years, 7 months
[PATCH] [TEST] Fix RPCS/08*py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1274093983 25200
# Node ID 6ef4afb32928a4f54e5ff7cdb3b0acd2d76da6b5
# Parent 456106b86cf4572684877cc923f3af991b4b65bb
[TEST] Fix RPCS/08*py
Fix the RPCS/08*py tc to use /var/lib/libvirt/images/ path for creating dik images instead of /tmp
The test has been verified with KVM and libvirt-cim current sources
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 456106b86cf4 -r 6ef4afb32928 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Mon Mar 15 09:16:15 2010 -0400
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/08_CreateDiskResourcePool.py Mon May 17 03:59:43 2010 -0700
@@ -62,7 +62,7 @@
libvirt_netfs_pool_support=869
def get_pool_attr(server, pool_type, dp_types, rev):
- pool_attr = { "Path" : "/tmp" }
+ pool_attr = { "Path" : "/var/lib/libvirt/images/" }
if rev >= libvirt_netfs_pool_support and \
pool_type == dp_types['DISK_POOL_NETFS']:
14 years, 7 months
[PATCH] [TEST] Test macvtap patch
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1267471822 28800
# Node ID ee89554f681d3aad027dbaa166cbe26267472448
# Parent 3655b03ada11d9e99a1d10b97aaa7cdb737fc493
[TEST] Test macvtap patch.
Verify that a vepa mode VM can be created.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 3655b03ada11 -r ee89554f681d suites/libvirt-cim/cimtest/VirtualSystemManagementService/27_definesystem_macvtap_dev.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/27_definesystem_macvtap_dev.py Mon Mar 01 11:30:22 2010 -0800
@@ -0,0 +1,152 @@
+#!/usr/bin/python
+#
+# Copyright 2010 IBM Corp.
+#
+# Authors:
+# Sharad Mishra <snmishra(a)us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Purpose:
+# Verify provider's support for macvtap.
+#
+# Steps:
+# 1) Build RASD parameters, making sure to specify macvtap mode for network
+# interface
+# 2) Create guest
+# 3) Verify guest is defined properly
+#
+
+import sys
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import FAIL, PASS, SKIP
+from XenKvmLib.classes import get_typed_class, inst_to_mof
+from XenKvmLib.rasd import get_default_rasds
+from XenKvmLib.const import do_main, get_provider_version
+from XenKvmLib.vxml import get_class
+from XenKvmLib.common_util import parse_instance_id
+from XenKvmLib.enumclass import EnumInstances
+
+sup_types = ['Xen', 'XenFV', 'KVM']
+test_dom = 'rstest_nic'
+
+target_dev_rev = 1029
+
+def get_rasd_list(ip, virt, target_dev, source_dev):
+ nrasd_cn = get_typed_class(virt, "NetResourceAllocationSettingData")
+
+ rasds = get_default_rasds(ip, virt)
+
+ rasd_list = {}
+
+ for rasd in rasds:
+ if rasd.classname == nrasd_cn and "Default" in rasd['InstanceID']:
+
+ rasd['NetworkMode'] = target_dev
+ rasd['NetworkType'] = "direct"
+ rasd['SourceDevice'] = source_dev
+
+ rasd_list[rasd.classname] = inst_to_mof(rasd)
+
+ return rasd_list
+
+def verify_net_rasd(ip, virt, target_dev, source_dev, guest_name):
+ inst = None
+
+ try:
+ nrasd_cn = get_typed_class(virt, 'NetResourceAllocationSettingData')
+ enum_list = EnumInstances(ip, nrasd_cn)
+
+ if enum_list < 1:
+ raise Exception("No %s instances returned" % nrasd_cn)
+
+ for rasd in enum_list:
+ guest, dev, status = parse_instance_id(rasd.InstanceID)
+ if status != PASS:
+ raise Exception("Unable to parse InstanceID: %s" % \
+ rasd.InstanceID)
+
+ if guest == guest_name:
+ inst = rasd
+ break
+
+ if inst is None:
+ raise Exception("%s instance for %s not found" % (nrasd_cn,
+ guest_name))
+
+ if inst.NetworkMode != target_dev:
+ raise Exception("Expected NetworkMode to be %s" % target_dev)
+
+ if inst.SourceDevice != source_dev:
+ raise Exception("Expected SourceDevice to be %s" % source_dev)
+
+ except Exception, details:
+ logger.error(details)
+ return FAIL
+
+ return PASS
+
+@do_main(sup_types)
+def main():
+ options = main.options
+
+ status = FAIL
+
+ curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
+ if curr_cim_rev < target_dev_rev:
+ logger.error("Network interface target device support is available" \
+ " in rev >= %s", target_dev_rev)
+ return SKIP
+
+ cxml = get_class(options.virt)(test_dom)
+
+ target_dev = "vepa"
+ source_dev = "eth1"
+
+ guest_defined = False
+
+ try:
+ rasd_list = get_rasd_list(options.ip, options.virt, target_dev, source_dev)
+ if len(rasd_list) < 1:
+ raise Exception("Unable to get template RASDs for %s" % test_dom)
+
+ cxml.set_res_settings(rasd_list)
+ ret = cxml.cim_define(options.ip)
+ if not ret:
+ raise Exception("Unable to define %s" % test_dom)
+
+ guest_defined = True
+
+ status = cxml.cim_start(options.ip)
+ if status != PASS:
+ raise Exception("Unable to start %s" % test_dom)
+
+ status = verify_net_rasd(options.ip, options.virt, target_dev,
+ source_dev, test_dom)
+ if status != PASS:
+ raise Exception("Failed to net interface for %s" % test_dom)
+
+ except Exception, details:
+ logger.error(details)
+ status = FAIL
+
+ if guest_defined == True:
+ cxml.undefine(options.ip)
+
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
+
14 years, 7 months
[PATCH] (#2) Use CIM 'AllocationUnits' to populate libvirt XML 'capacity unit' AND 'allocation unit'
by Chip Vincent
# HG changeset patch
# User Chip Vincent <cvincent(a)us.ibm.com>
# Date 1273081753 14400
# Node ID 293ef309c85b1b1b3551366624275d7a9bf6fb59
# Parent 22a4721a2d978fe611cb75255a094a0cc23abe5c
(#2) Use CIM 'AllocationUnits' to populate libvirt XML 'capacity unit' AND 'allocation unit'
Today, AllocationUnits only maps to capacity unit, which will leave allocation unit as the default (Kb). With this patch, both will be set to the same units.
Signed-off-by: Chip Vincent <cvincent(a)us.ibm.com>
diff -r 22a4721a2d97 -r 293ef309c85b libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Tue Mar 23 16:31:41 2010 -0700
+++ b/libxkutil/xmlgen.c Wed May 05 13:49:13 2010 -0400
@@ -1138,6 +1138,13 @@
goto out;
free(string);
+ if (vol->cap_units != NULL) {
+ xmlAttrPtr tmp = NULL;
+ tmp = xmlNewProp(cap, BAD_CAST "unit", BAD_CAST vol->cap_units);
+ if (tmp == NULL)
+ goto out;
+ }
+
ret = asprintf(&string, "%" PRIu16, vol->cap);
if (ret == -1)
return XML_ERROR;
14 years, 7 months
[PATCH] Use CIM 'AllocationUnits' to populate libvirt XML 'capacity unit' AND 'allocation unit'
by Chip Vincent
# HG changeset patch
# User Chip Vincent <cvincent(a)us.ibm.com>
# Date 1272996835 14400
# Node ID 91c26f188476c9b56aaf5536d5f2abb051db9796
# Parent 22a4721a2d978fe611cb75255a094a0cc23abe5c
Use CIM 'AllocationUnits' to populate libvirt XML 'capacity unit' AND 'allocation unit'
Today, AllocationUnits only maps to capacity unit, which will leave allocation unit as the default (Kb). With this patch, both will be set to the same units.
Signed-off-by: Chip Vincent <cvincent(a)us.ibm.com>
diff -r 22a4721a2d97 -r 91c26f188476 libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Tue Mar 23 16:31:41 2010 -0700
+++ b/libxkutil/xmlgen.c Tue May 04 14:13:55 2010 -0400
@@ -1138,7 +1138,14 @@
goto out;
free(string);
- ret = asprintf(&string, "%" PRIu16, vol->cap);
+ if (vol->cap_units != NULL) {
+ xmlAttrPtr tmp = NULL;
+ tmp = xmlNewProp(cap, BAD_CAST "unit", BAD_CAST vol->cap_units);
+ if (tmp == NULL)
+ goto out;
+ }
+
+ ret = asprintf(&string, "%" PRIu16, vol->cap);
if (ret == -1)
return XML_ERROR;
14 years, 7 months
[PATCH] [TEST] Fixing RPCS/10*py to work for libvirt_cim changes < 1032 revision
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1272267529 25200
# Node ID 3d5bb69edc67ab8097a61cff09927fdf4c5d3f4b
# Parent 456106b86cf4572684877cc923f3af991b4b65bb
[TEST] Fixing RPCS/10*py to work for libvirt_cim changes < 1032 revision
The test has been verified with KVM and libvirt-cim rpm for rev<1032
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 456106b86cf4 -r 3d5bb69edc67 suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py Mon Mar 15 09:16:15 2010 -0400
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/10_create_storagevolume.py Mon Apr 26 00:38:49 2010 -0700
@@ -45,6 +45,7 @@
pool_attr = { 'Path' : _image_dir }
vol_name = "cimtest-vol.img"
+libvirt_stovol_instance_id=1032
def get_template_rasd_from_sdc(virt, server, dp_inst_id):
rasd = None
@@ -231,7 +232,8 @@
if res[0] != PASS:
raise Exception("Failed to create the Vol %s" % vol_name)
- if res[1]['Resource']['InstanceID'] != exp_vol_path:
+ if res[1]['Resource']['InstanceID'] != exp_vol_path and \
+ cim_rev >= libvirt_stovol_instance_id:
raise Exception("Incorrect InstanceID")
else:
status = PASS
@@ -252,6 +254,8 @@
except Exception, details:
logger.error("Exception details: %s", details)
+ cleanup_pool_vol(server, virt, pool_name,
+ clean_pool, exp_vol_path)
status = FAIL
return status
14 years, 7 months