[PATCH] Fix potiential seg fault if user doesn't specify BootDevices attribute
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1244676797 25200
# Node ID fc8f08ab36dac00f5e8bc3f2a1d160d1a57fdc78
# Parent 6107c1026ed44acaf24ce9430a0e6dd2fa97f252
Fix potiential seg fault if user doesn't specify BootDevices attribute
If the user doesn't specify the BootDevices attribute, then we should return
from the bootord_vssd_to_domain(). Otherwise, the provider will seg fault when
it tries to get the length of the array. Since specifying a boot order is
optional, set the boot order count to 0 and return.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 6107c1026ed4 -r fc8f08ab36da src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Jun 01 18:19:42 2009 -0300
+++ b/src/Virt_VirtualSystemManagementService.c Wed Jun 10 16:33:17 2009 -0700
@@ -213,9 +213,11 @@
ret = cu_get_array_prop(inst, "BootDevices", &bootlist);
- if (ret != CMPI_RC_OK)
+ if (ret != CMPI_RC_OK) {
CU_DEBUG("Failed to get BootDevices property");
-
+ domain->os_info.fv.bootlist_ct = 0;
+ goto out;
+ }
bl_size = CMGetArrayCount(bootlist, &s);
if (s.rc != CMPI_RC_OK) {
@@ -256,6 +258,8 @@
domain->os_info.fv.bootlist_ct = bl_size;
domain->os_info.fv.bootlist = tmp_str_arr;
+ out:
+
return 1;
}
15 years, 5 months
[PATCH] Remove blank line from ServiceAccessBySAP.registration
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1244677461 25200
# Node ID 820b3743356157ff48ed8259c5bfe1f16010ac60
# Parent 6760811fdd47a781cc3a93926bb4197681e14235
Remove blank line from ServiceAccessBySAP.registration
The provider register script has trouble parsing the file with sfcb version
sfcbd 1.3.4preview - I haven't seen this issue with older version of sfcb.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 6760811fdd47 -r 820b37433561 schema/ServiceAccessBySAP.registration
--- a/schema/ServiceAccessBySAP.registration Wed Jun 10 16:44:19 2009 -0700
+++ b/schema/ServiceAccessBySAP.registration Wed Jun 10 16:44:21 2009 -0700
@@ -3,4 +3,3 @@
Xen_ServiceAccessBySAP root/virt Virt_ServiceAccessBySAP Virt_ServiceAccessBySAP association
KVM_ServiceAccessBySAP root/virt Virt_ServiceAccessBySAP Virt_ServiceAccessBySAP association
LXC_ServiceAccessBySAP root/virt Virt_ServiceAccessBySAP Virt_ServiceAccessBySAP association
-
15 years, 6 months
[PATCH] Add support for iscsi storage pools
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1242695586 25200
# Node ID 9ac4e06aa21334cf25b8096663dca6fea74dccd8
# Parent aa8e071730d2ce20064f1c0295a8005e31ef2cea
Add support for iscsi storage pools
You will need a system with iSCSI connected storage to test this
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r aa8e071730d2 -r 9ac4e06aa213 src/Virt_ResourcePoolConfigurationService.c
--- a/src/Virt_ResourcePoolConfigurationService.c Wed May 20 10:41:46 2009 -0700
+++ b/src/Virt_ResourcePoolConfigurationService.c Mon May 18 18:13:06 2009 -0700
@@ -179,6 +179,24 @@
return NULL;
}
+static const char *disk_iscsi_pool(CMPIInstance *inst,
+ struct virt_pool *pool)
+{
+ const char *val = NULL;
+
+ if (cu_get_str_prop(inst, "DevicePath", &val) != CMPI_RC_OK)
+ return "Missing `DevicePath' property";
+
+ pool->pool_info.disk.device_path = strdup(val);
+
+ if (cu_get_str_prop(inst, "Host", &val) != CMPI_RC_OK)
+ return "Missing `Host' property";
+
+ pool->pool_info.disk.host = strdup(val);
+
+ return NULL;
+}
+
static const char *disk_rasd_to_pool(CMPIInstance *inst,
struct virt_pool *pool)
{
@@ -201,6 +219,9 @@
case DISK_POOL_NETFS:
msg = disk_netfs_pool(inst, pool);
break;
+ case DISK_POOL_ISCSI:
+ msg = disk_iscsi_pool(inst, pool);
+ break;
default:
return "Storage pool type not supported";
}
15 years, 6 months
[PATCH] [TEST] #2 Add support for DiskPoolRASD / NetPoolRASD to get_exp_template_rasd_len()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1243630742 25200
# Node ID 10746e30b8d0532ee7eda8d0689a085d1b695ee2
# Parent 64548d3a357980326b64cebc8d2388f8b631049a
[TEST] #2 Add support for DiskPoolRASD / NetPoolRASD to get_exp_template_rasd_len()
Also update HostSystem 03 to support DiskPoolRASD / NetPoolRASD
Updates from 1 to 2:
-Add instance id to log message HostSystem/03_hs_to_settdefcap.py: 223
-Rework the DiskRASD portion of get_exp_disk_rasd_len() - only check for
volumed if the libvirt version is greater than 0.4.1.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 64548d3a3579 -r 10746e30b8d0 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Tue Jun 02 10:37:42 2009 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri May 29 13:59:02 2009 -0700
@@ -204,8 +204,10 @@
else:
rtype = {
"%s_DiskResourceAllocationSettingData" % virt : 17, \
+ "%s_DiskPoolResourceAllocationSettingData" % virt : 17, \
"%s_MemResourceAllocationSettingData" % virt : 4, \
"%s_NetResourceAllocationSettingData" % virt : 10, \
+ "%s_NetPoolResourceAllocationSettingData" % virt : 10, \
"%s_ProcResourceAllocationSettingData" % virt : 3
}
try:
@@ -218,8 +220,8 @@
exp_len = get_exp_template_rasd_len(virt, server, ap['InstanceID'])
if len(assoc_info) != exp_len:
- logger.error("'%s' returned %i RASD objects instead of %i",
- an, len(assoc_info), exp_len)
+ logger.error("%s returned %i RASD objects instead of %i for %s",
+ an, len(assoc_info), exp_len, ap['InstanceID'])
return FAIL
for inst in assoc_info:
diff -r 64548d3a3579 -r 10746e30b8d0 suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Jun 02 10:37:42 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri May 29 13:59:02 2009 -0700
@@ -31,6 +31,7 @@
from XenKvmLib.const import default_pool_name, default_network_name, \
get_provider_version
from XenKvmLib.pool import enum_volumes
+from XenKvmLib.xm_virt_util import virsh_version
pasd_cn = 'ProcResourceAllocationSettingData'
nasd_cn = 'NetResourceAllocationSettingData'
@@ -304,45 +305,76 @@
return rasd_insts, PASS
-def get_exp_template_rasd_len(virt, ip, id):
+def get_exp_disk_rasd_len(virt, ip, rev, id):
libvirt_rasd_template_changes = 707
libvirt_rasd_new_changes = 805
libvirt_rasd_dpool_changes = 839
- curr_cim_rev, changeset = get_provider_version(virt, ip)
+ libvirt_ver = virsh_version(ip, virt)
# For Diskpool, we have info 1 for each of Min, Max, Default, and Incr
exp_base_num = 4
exp_cdrom = 4
- exp_len = exp_base_num
+ exp_len = exp_base_num
- if 'DiskPool' in id:
- if virt == 'Xen' or virt == 'XenFV':
- # For Xen and XenFV, there is a template for PV and FV, so you
- # end up with double the number of templates
- xen_multi = 2
+ if id == "DiskPool/0":
+ pool_types = 3
+ return exp_base_num * pool_types
+
+ if virt == 'Xen' or virt == 'XenFV':
+ # For Xen and XenFV, there is a template for PV and FV, so you
+ # end up with double the number of templates
+ xen_multi = 2
- if curr_cim_rev >= libvirt_rasd_template_changes and \
- curr_cim_rev < libvirt_rasd_new_changes:
- exp_len = exp_base_num + exp_cdrom
+ if rev >= libvirt_rasd_template_changes and \
+ rev < libvirt_rasd_new_changes:
+ exp_len = exp_base_num + exp_cdrom
- elif curr_cim_rev >= libvirt_rasd_new_changes and \
- curr_cim_rev < libvirt_rasd_dpool_changes:
- exp_len = (exp_base_num + exp_cdrom) * xen_multi
+ elif rev >= libvirt_rasd_dpool_changes and libvirt_ver >= '0.4.1':
+ volumes = enum_volumes(virt, ip)
+ exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi
- elif curr_cim_rev >= libvirt_rasd_dpool_changes:
- volumes = enum_volumes(virt, ip)
- exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi
+ exp_len = (exp_base_num + exp_cdrom) * xen_multi
- elif virt == 'KVM':
- if curr_cim_rev >= libvirt_rasd_new_changes and \
- curr_cim_rev < libvirt_rasd_dpool_changes:
- exp_len = exp_base_num + exp_cdrom
+ elif virt == 'KVM':
+ if rev >= libvirt_rasd_new_changes and \
+ rev < libvirt_rasd_dpool_changes:
+ exp_len = exp_base_num + exp_cdrom
- elif curr_cim_rev >= libvirt_rasd_dpool_changes:
- volumes = enum_volumes(virt, ip)
- exp_len = (volumes * exp_base_num) + exp_cdrom
+ elif rev >= libvirt_rasd_dpool_changes:
+ volumes = enum_volumes(virt, ip)
+ exp_len = (volumes * exp_base_num) + exp_cdrom
return exp_len
+def get_exp_net_rasd_len(virt, rev, id):
+ net_rasd_template_changes = 861
+
+ exp_base_num = 4
+
+ if id == "NetworkPool/0":
+ pool_types = 3
+ forward_modes = 2
+
+ return (exp_base_num * pool_types) + (exp_base_num * forward_modes)
+
+ if rev >= net_rasd_template_changes:
+ dev_types = 2
+
+ return exp_base_num * dev_types
+
+def get_exp_template_rasd_len(virt, ip, id):
+ curr_cim_rev, changeset = get_provider_version(virt, ip)
+
+ exp_len = 4
+
+ if 'DiskPool' in id:
+ exp_len = get_exp_disk_rasd_len(virt, ip, curr_cim_rev, id)
+
+ elif 'NetworkPool' in id:
+ exp_len = get_exp_net_rasd_len(virt, curr_cim_rev, id)
+
+ return exp_len
+
+
15 years, 6 months
[PATCH] Adds indication capabilities to migration jobs (create, modify, delete)
by Richard Maciel
# HG changeset patch
# User Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
# Date 1244508974 10800
# Node ID c9699a6e245736c7dbf1e65960bd8ef130277dbf
# Parent b988eaa240cd4f577e74829e1c300aa2dabab023
Adds indication capabilities to migration jobs (create, modify, delete)
This code just adds the filter, since the event methods are already implemented
Signed-off-by: Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
diff -r b988eaa240cd -r c9699a6e2457 src/Virt_ComputerSystemMigrationIndication.c
--- a/src/Virt_ComputerSystemMigrationIndication.c Fri Jun 12 15:11:51 2009 -0700
+++ b/src/Virt_ComputerSystemMigrationIndication.c Mon Jun 08 21:56:14 2009 -0300
@@ -45,11 +45,17 @@
DECLARE_FILTER(xen_created, "Xen_ComputerSystemMigrationJobCreatedIndication");
DECLARE_FILTER(xen_mod, "Xen_ComputerSystemMigrationJobModifiedIndication");
DECLARE_FILTER(xen_deleted, "Xen_ComputerSystemMigrationJobDeletedIndication");
+DECLARE_FILTER(kvm_created, "KVM_ComputerSystemMigrationJobCreatedIndication");
+DECLARE_FILTER(kvm_deleted, "KVM_ComputerSystemMigrationJobDeletedIndication");
+DECLARE_FILTER(kvm_mod, "KVM_ComputerSystemMigrationJobModifiedIndication");
static struct std_ind_filter *filters[] = {
&xen_created,
&xen_mod,
&xen_deleted,
+ &kvm_created,
+ &kvm_mod,
+ &kvm_deleted,
NULL,
};
15 years, 6 months
[PATCH] [TEST] Cleanup guest in RASD 05
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1244059209 25200
# Node ID da1f502f0498e683e722c36ebd8afb55b9cb82a8
# Parent 3fd6cfd13a00acefa93b6f13dabbf5ace91bda3d
[TEST] Cleanup guest in RASD 05
The guest needs to be cleaned up each time through the loop to ensure a
fresh guest is being defined.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 3fd6cfd13a00 -r da1f502f0498 suites/libvirt-cim/cimtest/RASD/05_disk_rasd_emu_type.py
--- a/suites/libvirt-cim/cimtest/RASD/05_disk_rasd_emu_type.py Tue Jun 02 10:44:47 2009 -0700
+++ b/suites/libvirt-cim/cimtest/RASD/05_disk_rasd_emu_type.py Wed Jun 03 13:00:09 2009 -0700
@@ -81,11 +81,13 @@
if found_rasd is None:
raise Exception("DiskRASD for defined dom was not found")
+
+ cxml.undefine(options.ip)
+
except Exception, detail:
logger.error("Exception: %s", detail)
status = FAIL
-
- cxml.undefine(options.ip)
+ cxml.undefine(options.ip)
return status
15 years, 6 months
[PATCH] [TEST] Update RedirectionSerivce 01 to work with recent schema changes
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1243635120 25200
# Node ID 7dd85abd05e44f4a1c319e7284205a8365f56f5e
# Parent a22bbefc05e5b294b254c58236b0f2abda65a23a
[TEST] Update RedirectionSerivce 01 to work with recent schema changes
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r a22bbefc05e5 -r 7dd85abd05e4 suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py
--- a/suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py Fri May 29 13:59:02 2009 -0700
+++ b/suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py Fri May 29 15:12:00 2009 -0700
@@ -40,6 +40,7 @@
REDIRECTION_SER_TYPE = 3
CRS_MAX_SAP_REV = 724
libvirtcim_hr_crs_changes = 688
+schema_upgrade_change = 881
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@do_main(sup_types)
@@ -88,9 +89,13 @@
'EnabledState' : 2,
'EnabledDefault' : 2,
'RequestedState' : 12,
- 'MaxConcurrentEnabledSAPs': max_sap_sessions
}
+ if curr_cim_rev < schema_upgrade_change:
+ crs_list['MaxConcurrentEnabledSAPs'] = max_sap_sessions
+ else:
+ crs_list['MaxCurrentEnabledSAPs'] = max_sap_sessions
+
try:
crs = EnumInstances(server, classname)
except Exception, detail:
15 years, 6 months