[PATCH] Set status in all error cases for DestroySystem in VSMS
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1206730931 25200
# Node ID 95caba1628c467332ffb129f663cef5289039744
# Parent 321e3b4320ff3c849c684f1d940f0fa917f6555c
Set status in all error cases for DestroySystem in VSMS.
Be sure to set a status message for the IM_RC_FAILED case. In the case that connect_by_classname() fails, set rc = -1 because connect_by_classname() sets the status.
Remove domain_exists() - this has been replaced by virDomainLookupByName().
Fix typo in CU_DEBUG() statement.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 321e3b4320ff -r 95caba1628c4 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Wed Apr 09 10:57:05 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Fri Mar 28 12:02:11 2008 -0700
@@ -488,8 +488,10 @@ static CMPIStatus destroy_system(CMPIMet
conn = connect_by_classname(_BROKER,
CLASSNAME(reference),
&status);
- if (conn == NULL)
+ if (conn == NULL) {
+ rc = -1;
goto error;
+ }
if (cu_get_ref_arg(argsin, "AffectedSystem", &sys) != CMPI_RC_OK)
goto error;
@@ -498,13 +500,9 @@ static CMPIStatus destroy_system(CMPIMet
if (dom_name == NULL)
goto error;
- // Make sure system exists and destroy it.
- if (!domain_exists(conn, dom_name))
- goto error;
-
dom = virDomainLookupByName(conn, dom_name);
if (dom == NULL) {
- CU_DEBUG("No such domain `%s', dom_name");
+ CU_DEBUG("No such domain `%s'", dom_name);
rc = IM_RC_SYS_NOT_FOUND;
goto error;
}
@@ -522,6 +520,10 @@ error:
cu_statusf(_BROKER, &status,
CMPI_RC_ERR_FAILED,
"Failed to find domain");
+ else if (rc == IM_RC_FAILED)
+ cu_statusf(_BROKER, &status,
+ CMPI_RC_ERR_FAILED,
+ "Unable to retrieve domain name.");
else if (rc == IM_RC_OK)
status = (CMPIStatus){CMPI_RC_OK, NULL};
16 years, 9 months
[PATCH] Add missing newlines in some LXC schema lines
by lizg@cn.ibm.com
# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1206669991 -28800
# Node ID 888b094934bd3d17b95df1702a0ad654d5fdf5e2
# Parent c2b027700cb7a3075a9b9f56acd6d52cbd1f6fdf
Add missing newlines in some LXC schema lines
Signed-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r c2b027700cb7 -r 888b094934bd schema/HostedResourcePool.registration
--- a/schema/HostedResourcePool.registration Tue Mar 25 13:45:01 2008 -0700
+++ b/schema/HostedResourcePool.registration Fri Mar 28 10:06:31 2008 +0800
@@ -1,4 +1,5 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
Xen_HostedResourcePool root/virt Virt_HostedResourcePool Virt_HostedResourcePool association
-KVM_HostedResourcePool root/virt Virt_HostedResourcePool Virt_HostedResourcePool associationLXC_HostedResourcePool root/virt Virt_HostedResourcePool Virt_HostedResourcePool association
+KVM_HostedResourcePool root/virt Virt_HostedResourcePool Virt_HostedResourcePool association
+LXC_HostedResourcePool root/virt Virt_HostedResourcePool Virt_HostedResourcePool association
diff -r c2b027700cb7 -r 888b094934bd schema/NetPool.registration
--- a/schema/NetPool.registration Tue Mar 25 13:45:01 2008 -0700
+++ b/schema/NetPool.registration Fri Mar 28 10:06:31 2008 +0800
@@ -1,4 +1,5 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
Xen_NetworkPool root/virt Virt_DevicePool Virt_DevicePool instance
-KVM_NetworkPool root/virt Virt_DevicePool Virt_DevicePool instanceLXC_NetworkPool root/virt Virt_DevicePool Virt_DevicePool instance
+KVM_NetworkPool root/virt Virt_DevicePool Virt_DevicePool instance
+LXC_NetworkPool root/virt Virt_DevicePool Virt_DevicePool instance
diff -r c2b027700cb7 -r 888b094934bd schema/ResourceAllocationFromPool.registration
--- a/schema/ResourceAllocationFromPool.registration Tue Mar 25 13:45:01 2008 -0700
+++ b/schema/ResourceAllocationFromPool.registration Fri Mar 28 10:06:31 2008 +0800
@@ -1,4 +1,5 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
Xen_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPool Virt_ResourceAllocationFromPool association
-KVM_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPool Virt_ResourceAllocationFromPool associationLXC_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPool Virt_ResourceAllocationFromPool association
+KVM_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPool Virt_ResourceAllocationFromPool association
+LXC_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPool Virt_ResourceAllocationFromPool association
diff -r c2b027700cb7 -r 888b094934bd schema/ResourcePoolConfigurationCapabilities.registration
--- a/schema/ResourcePoolConfigurationCapabilities.registration Tue Mar 25 13:45:01 2008 -0700
+++ b/schema/ResourcePoolConfigurationCapabilities.registration Fri Mar 28 10:06:31 2008 +0800
@@ -1,4 +1,5 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
Xen_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilities Virt_ResourcePoolConfigurationCapabilities instance
-KVM_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilities Virt_ResourcePoolConfigurationCapabilities instanceLXC_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilities Virt_ResourcePoolConfigurationCapabilities instance
+KVM_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilities Virt_ResourcePoolConfigurationCapabilities instance
+LXC_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilities Virt_ResourcePoolConfigurationCapabilities instance
diff -r c2b027700cb7 -r 888b094934bd schema/ResourcePoolConfigurationService.registration
--- a/schema/ResourcePoolConfigurationService.registration Tue Mar 25 13:45:01 2008 -0700
+++ b/schema/ResourcePoolConfigurationService.registration Fri Mar 28 10:06:31 2008 +0800
@@ -1,4 +1,5 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
Xen_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationService Virt_ResourcePoolConfigurationService instance method
-KVM_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationService Virt_ResourcePoolConfigurationService instance methodLXC_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationService Virt_ResourcePoolConfigurationService instance method
+KVM_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationService Virt_ResourcePoolConfigurationService instance method
+LXC_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationService Virt_ResourcePoolConfigurationService instance method
diff -r c2b027700cb7 -r 888b094934bd schema/VSMigrationCapabilities.registration
--- a/schema/VSMigrationCapabilities.registration Tue Mar 25 13:45:01 2008 -0700
+++ b/schema/VSMigrationCapabilities.registration Fri Mar 28 10:06:31 2008 +0800
@@ -1,4 +1,5 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
Xen_VirtualSystemMigrationCapabilities root/virt Virt_VSMigrationCapabilities Virt_VSMigrationCapabilities instance
-KVM_VirtualSystemMigrationCapabilities root/virt Virt_VSMigrationCapabilities Virt_VSMigrationCapabilities instanceLXC_VirtualSystemMigrationCapabilities root/virt Virt_VSMigrationCapabilities Virt_VSMigrationCapabilities instance
+KVM_VirtualSystemMigrationCapabilities root/virt Virt_VSMigrationCapabilities Virt_VSMigrationCapabilities instance
+LXC_VirtualSystemMigrationCapabilities root/virt Virt_VSMigrationCapabilities Virt_VSMigrationCapabilities instance
diff -r c2b027700cb7 -r 888b094934bd schema/VSMigrationService.registration
--- a/schema/VSMigrationService.registration Tue Mar 25 13:45:01 2008 -0700
+++ b/schema/VSMigrationService.registration Fri Mar 28 10:06:31 2008 +0800
@@ -1,4 +1,5 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
Xen_VirtualSystemMigrationService root/virt Virt_VSMigrationService Virt_VSMigrationService instance method
-KVM_VirtualSystemMigrationService root/virt Virt_VSMigrationService Virt_VSMigrationService instance methodLXC_VirtualSystemMigrationService root/virt Virt_VSMigrationService Virt_VSMigrationService instance method
+KVM_VirtualSystemMigrationService root/virt Virt_VSMigrationService Virt_VSMigrationService instance method
+LXC_VirtualSystemMigrationService root/virt Virt_VSMigrationService Virt_VSMigrationService instance method
16 years, 9 months
[PATCH] [TEST] Add kernel params in VSSD construction in vsms
by lizg@cn.ibm.com
# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1206696365 -28800
# Node ID f9d1d6a61670a3700c5a569d2eeb31d29b5f9da2
# Parent 877558f5cbe913300335b7069d8e21a6257638a4
[TEST] Add kernel params in VSSD construction in vsms
Provider has added Kernel/Bootloader properties for para-virt. This is
the change to utilize those properties.
Signed-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r 877558f5cbe9 -r f9d1d6a61670 suites/libvirt-cim/lib/XenKvmLib/vsms.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Fri Mar 28 17:23:54 2008 +0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Fri Mar 28 17:26:05 2008 +0800
@@ -25,6 +25,7 @@ import pywbem
import pywbem
from CimTest.CimExt import CIMMethodClass, CIMClassMOF
from CimTest import Globals
+from VirtLib import live
from XenKvmLib import vxml
from XenKvmLib.classes import get_typed_class, get_class_type, virt_types
@@ -33,6 +34,10 @@ RASD_TYPE_NET_ETHER = 10
RASD_TYPE_NET_ETHER = 10
RASD_TYPE_NET_OTHER = 11
RASD_TYPE_DISK = 17
+
+VSSD_RECOVERY_NONE = 2
+VSSD_RECOVERY_RESTART = 3
+VSSD_RECOVERY_PRESERVE = 123
def eval_cls(basename):
def func(f):
@@ -81,17 +86,25 @@ def enumerate_instances(server, virt='Xe
# classes to define VSSD parameters
class CIM_VirtualSystemSettingData(CIMClassMOF):
- def __init__(self, name='test_domain', set_vs_id = True):
+ def __init__(self, name='test_domain', virt):
type = get_class_type(self.__class__.__name__)
self.InstanceID = '%s:%s' % (type, name)
self.Caption = self.Description = 'Virtual System'
- self.ElementName = name
+ self.VirtualSystemIdentifier = self.ElementName = name
self.VirtualSystemType = type
self.CreationClassName = self.__class__.__name__
- self.isFullVirt = (type == 'KVM')
+ self.AutomaticShutdownAction = VSSD_RECOVERY_NONE
+ self.AutomaticRecoveryAction = VSSD_RECOVERY_NONE
+
+ self.isFullVirt = (type == 'KVM' or virt == 'XenFV')
+ if self.isFullVirt:
+ self.BootDevice = 'hd'
+ else:
+ self.Bootloader = live.bootloader(Globals.CIM_IP, 0)
+ self.BootloaderArgs = ''
+ self.Kernel = vxml.XenXML.kernel_path
+ self.Ramdisk = vxml.XenXML.init_path
- if set_vs_id == True:
- self.VirtualSystemIdentifier = name
class Xen_VirtualSystemSettingData(CIM_VirtualSystemSettingData):
pass
@@ -193,7 +206,7 @@ def default_vssd_rasd_str(dom_name='test
mem_mb=512,
virt='Xen'):
class_vssd = get_vssd_class(virt)
- vssd = class_vssd(name=dom_name)
+ vssd = class_vssd(name=dom_name, virt=virt)
class_dasd = get_dasd_class(virt)
if virt == 'KVM':
16 years, 9 months
[PATCH] [TEST] Add virt tag to set_uuid in common_util.py
by lizg@cn.ibm.com
# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1206685818 -28800
# Node ID 0ffa3f03d77302fb7f289f8ddb537380fc885040
# Parent c9bb4d898469450c851139d5faa58a5818835e08
[TEST] Add virt tag to set_uuid in common_util.py
Otherwise, KVM domain's uuid is not recorded.
Signed-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r c9bb4d898469 -r 0ffa3f03d773 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Mar 27 11:07:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Mar 28 14:30:18 2008 +0800
@@ -93,7 +93,7 @@ def create_using_definesystem(domain_nam
undefine_test_domain(dname, options.ip, virt=virt)
return XFAIL_RC(bug)
- set_uuid(viruuid(domain_name, ip))
+ set_uuid(viruuid(domain_name, ip, virt=virt))
myxml = dumpxml(domain_name, ip, virt=virt)
name = xml_get_dom_name(myxml)
16 years, 9 months
Announcement: test suite now available
by Dan Smith
I'm pleased to announce that our internal test suite has been made
public. The tree is available here:
http://libvirt.org/hg/cimtest
I'm sure that there will be all kinds of brokenness exposed as people
try to use it outside of our environment. Please post any issues that
you may have.
The suite uses pywbem (current svn snapshot required) for the CIM
client tasks and ssh to connect to the machine under test to validate
against virsh. The cimtest_sshkey.pub file must be added to root's
authorized_keys file to enable this. Changes to allow generation of a
site ssh key will need to be made to mitigate the obvious risk
involved.
A sample invocation looks like this:
% export CIM_USER=root
% export CIM_PASS=password
% export CIM_NS=root/virt
% ./runtests libvirt-cim -i localhost
We will start posting regular test results on various platforms using
this soon, which should provide a baseline to compare against.
More detail will need to be added to the website, I'm sure, but this
should be enough to get people started.
Please post issues you have and test results if you can get them!
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
16 years, 9 months
[PATCH] (#2) Make isMigratable return true if it makes it all the way through the checks,
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1206553643 25200
# Node ID 055180f1b8538a497dac8272a02ff63c626f3190
# Parent c2b027700cb7a3075a9b9f56acd6d52cbd1f6fdf
(#2) Make isMigratable return true if it makes it all the way through the checks,
false otherwise. These should be independent of the return code and the
status, which the patch fixes.
Changes:
- Removed stupidity
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c2b027700cb7 -r 055180f1b853 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Tue Mar 25 13:45:01 2008 -0700
+++ b/src/Virt_VSMigrationService.c Wed Mar 26 10:47:23 2008 -0700
@@ -543,7 +543,7 @@ static CMPIStatus vs_migratable(const CM
CMPIStatus s;
virConnectPtr conn = NULL;
virConnectPtr dconn = NULL;
- uint32_t retcode = 1;
+ uint32_t retcode = CIM_SVPC_RETURN_COMPLETED;
CMPIBoolean isMigratable = 0;
uint16_t type;
virDomainPtr dom = NULL;
@@ -598,14 +598,13 @@ static CMPIStatus vs_migratable(const CM
goto out;
}
- retcode = CIM_SVPC_RETURN_COMPLETED;
+ isMigratable = 1;
cu_statusf(_BROKER, &s,
CMPI_RC_OK,
"");
out:
CMReturnData(results, (CMPIValue *)&retcode, CMPI_uint32);
- isMigratable = (retcode == 0);
CMAddArg(argsout, "IsMigratable",
(CMPIValue *)&isMigratable, CMPI_boolean);
16 years, 9 months
[PATCH] Make isMigratable return true if it makes it all the way through the checks,
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1206551684 25200
# Node ID 19f1da7d9a42f35ab345699b36e22d6981b26342
# Parent c2b027700cb7a3075a9b9f56acd6d52cbd1f6fdf
Make isMigratable return true if it makes it all the way through the checks,
false otherwise. These should be independent of the return code and the
status, which the patch fixes.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c2b027700cb7 -r 19f1da7d9a42 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Tue Mar 25 13:45:01 2008 -0700
+++ b/src/Virt_VSMigrationService.c Wed Mar 26 10:14:44 2008 -0700
@@ -543,7 +543,7 @@ static CMPIStatus vs_migratable(const CM
CMPIStatus s;
virConnectPtr conn = NULL;
virConnectPtr dconn = NULL;
- uint32_t retcode = 1;
+ uint32_t retcode = SVPC_RETURN_COMPLETED;
CMPIBoolean isMigratable = 0;
uint16_t type;
virDomainPtr dom = NULL;
@@ -598,14 +598,13 @@ static CMPIStatus vs_migratable(const CM
goto out;
}
- retcode = CIM_SVPC_RETURN_COMPLETED;
+ isMigratable = 1;
cu_statusf(_BROKER, &s,
CMPI_RC_OK,
"");
out:
CMReturnData(results, (CMPIValue *)&retcode, CMPI_uint32);
- isMigratable = (retcode == 0);
CMAddArg(argsout, "IsMigratable",
(CMPIValue *)&isMigratable, CMPI_boolean);
16 years, 9 months