[PATCH] [TEST]#3 Fix HostedService.02, 03&04 to work with sblim base provider installed
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222482583 25200
# Node ID 145cde258442f326f9503bc261f9f3674e2fe82d
# Parent 0ecb3a22c3617eaa4298dfd9cd3b7b27b9846110
[TEST]#3 Fix HostedService.02,03&04 to work with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 0ecb3a22c361 -r 145cde258442 suites/libvirt-cim/cimtest/HostedService/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Sep 26 02:44:52 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Fri Sep 26 19:29:43 2008 -0700
@@ -25,6 +25,7 @@ from VirtLib import utils
from VirtLib import utils
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import get_host_info
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from XenKvmLib.const import do_main
@@ -37,11 +38,11 @@ def main():
def main():
options = main.options
keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
+ status, host_name, host_ccn = get_host_info(options.ip, options.virt)
+ if status != PASS:
+ logger.error("Check sblim provider or enumerate hostsystem error")
return FAIL
+
servicelist = {"ResourcePoolConfigurationService" : "RPCS",
"VirtualSystemManagementService" : "Management Service",
"VirtualSystemMigrationService" : "MigrationService"}
@@ -54,8 +55,8 @@ def main():
options.virt,
Name = v,
CreationClassName = get_typed_class(options.virt, k),
- SystemCreationClassName = host_sys.CreationClassName,
- SystemName = host_sys.Name)
+ SystemCreationClassName = host_ccn,
+ SystemName = host_name)
except Exception:
logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % item)
return FAIL
@@ -67,10 +68,10 @@ def main():
ccn = assoc_host[0].keybindings['CreationClassName']
name = assoc_host[0].keybindings['Name']
- if ccn != get_typed_class(options.virt, "HostSystem"):
+ if ccn != host_ccn:
logger.error("CreationClassName Error")
return FAIL
- elif name != host_sys.Name:
+ elif name != host_name:
logger.error("CCN Error")
return FAIL
diff -r 0ecb3a22c361 -r 145cde258442 suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Fri Sep 26 02:44:52 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Fri Sep 26 19:29:43 2008 -0700
@@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import get_host_info
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER, \
CIM_PASS, CIM_NS
@@ -40,24 +41,22 @@ def main():
options = main.options
rc = -1
status = FAIL
- keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
+ status, host_name, host_ccn = get_host_info(options.ip, options.virt)
+ if status != PASS:
+ logger.error("Error in calling get_host_info function")
return FAIL
-
-
+
conn = assoc.myWBEMConnection('http://%s' % options.ip,
(CIM_USER, CIM_PASS),
CIM_NS)
instanceref = CIMInstanceName(get_typed_class(options.virt, "HostSystem"),
- keybindings = {"Wrong" : "wrong", "CreationClassName" : host_sys.CreationClassName})
+ keybindings = {"Wrong" : "wrong", \
+ "CreationClassName" : host_ccn})
names = []
-
+ assoc_class = get_typed_class(options.virt, "HostedService")
try:
- names = conn.AssociatorNames(instanceref, AssocClass = get_typed_class(options.virt, "HostedService"))
+ names = conn.AssociatorNames(instanceref, AssocClass = assoc_class)
rc = 0
except pywbem.CIMError, (rc, desc):
if rc == exp_rc and desc.find(exp_desc) >= 0:
@@ -70,7 +69,8 @@ def main():
logger.error(details)
if rc == 0:
- logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of HostSystem input")
+ 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 0ecb3a22c361 -r 145cde258442 suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Fri Sep 26 02:44:52 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Fri Sep 26 19:29:43 2008 -0700
@@ -25,6 +25,7 @@ from pywbem.cim_obj import CIMInstanceNa
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
from XenKvmLib import enumclass
+from XenKvmLib.common_util import get_host_info
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_USER, \
CIM_PASS, CIM_NS
@@ -40,13 +41,10 @@ def main():
options = main.options
rc = -1
status = FAIL
- keys = ['Name', 'CreationClassName']
- try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
- except Exception:
- logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
+ status, host_name, host_ccn = get_host_info(options.ip, options.virt)
+ if status != PASS:
+ logger.error("Error in calling get_host_info function")
return FAIL
-
servicelist = {get_typed_class(options.virt, "ResourcePoolConfigurationService") : "RPCS",
get_typed_class(options.virt, "VirtualSystemManagementService") : "Management Service",
@@ -60,12 +58,12 @@ def main():
instanceref = CIMInstanceName(k,
keybindings = {"Wrong" : v,
"CreationClassName" : "wrong",
- "SystemCreationClassName" : host_sys.CreationClassName,
- "SystemName" : host_sys.Name})
+ "SystemCreationClassName" : host_name,
+ "SystemName" : host_ccn})
names = []
-
+ assoc_class = get_typed_class(options.virt, "HostedService")
try:
- names = conn.AssociatorNames(instanceref, AssocClass = get_typed_class(options.virt, "HostedService"))
+ names = conn.AssociatorNames(instanceref, AssocClass = assoc_class)
rc = 0
except pywbem.CIMError, (rc, desc):
if rc == exp_rc and desc.find(exp_desc) >= 0:
@@ -78,7 +76,8 @@ def main():
logger.error(details)
if rc == 0:
- logger.error("HostedService associator should NOT return excepted result with a wrong key name and value of %s input" % k)
+ logger.error("HostedService associator should NOT return excepted result\
+ with a wrong key name and value of %s input" % k)
status = FAIL
return status
16 years, 2 months
[PATCH] [TEST] Fixing and updating 02_reverse.py of HostedDependency to work with sblim-base-provider
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1222777504 25200
# Node ID 74c27c6878537864db0d9a2f37dcfc826abffa5b
# Parent 52f8b84c5bc6c3665b434b18707e2debbc0c0bff
[TEST] Fixing and updating 02_reverse.py of HostedDependency to work with sblim-base-provider.
1) Updated the tc to work with/without sblim-base-provider.
2) Updated the tc to use cim_define().
3) Updated call_request_state_change() to start the domain.
3) Included the bug no 00007.
4) Used get_host_info() for getting the host information.
Tested with Xen, XenFV, KVM on current sources and with/without sblim-base-provider installed.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 52f8b84c5bc6 -r 74c27c687853 suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Tue Sep 30 05:06:02 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Tue Sep 30 05:25:04 2008 -0700
@@ -29,7 +29,7 @@
# Example cli command is
# wbemcli ain -ac Xen_HostedDependency
# 'http://localhost:5988/root/virt:
-# Xen_HostSystem.CreationClassName="Xen_HostSystem",Name="mx3650b.in.ibm.com"'
+# Xen_HostSystem.CreationClassName="Xen_HostSystem",Name="3650b"'
#
# For which we get the following output
# localhost:5988/root/virt:Xen_ComputerSystem.
@@ -48,41 +48,50 @@ from XenKvmLib.classes import get_class_
from XenKvmLib.classes import get_class_basename
from CimTest.Globals import logger
from XenKvmLib.const import do_main
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
+from XenKvmLib.common_util import get_host_info, call_request_state_change
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "hd_domain"
test_mac = "00:11:22:33:44:55"
+TIME = "00000000000000.000000:000"
+bug_sblim = "00007"
@do_main(sup_types)
def main():
options = main.options
+ virt = options.virt
+ server = options.ip
status = PASS
- virtxml = vxml.get_class(options.virt)
- if options.virt == "LXC":
+ virtxml = vxml.get_class(virt)
+ if virt == "LXC":
cxml = virtxml(test_dom)
else:
cxml = virtxml(test_dom, mac = test_mac)
- ret = cxml.create(options.ip)
+ ret = cxml.cim_define(server)
if not ret:
- logger.error("ERROR: Failed to Create the dom: %s" % test_dom)
- status = FAIL
- return status
- keys = ['Name', 'CreationClassName']
+ logger.error("Failed to define the dom: %s" % test_dom)
+ return FAIL
+
+ rc = call_request_state_change(test_dom, server, 2, TIME, virt)
+ if rc != 0:
+ logger.error("Failed to start the dom: %s" % test_dom)
+ cxml.undefine(server)
+ return FAIL
+
try:
- host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
- if host_sys[0].Name == "":
- raise Exception("HostName seems to be empty")
- else:
- # Instance of the HostSystem
- host_sys = host_sys[0]
+ status, host_name, host_ccn = get_host_info(server, virt)
+ if status != PASS:
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return status
keys = ['Name', 'CreationClassName']
- cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys, options.virt)
- if options.virt == 'Xen' or options.virt == 'XenFV':
+ cs = enumclass.enumerate(server, 'ComputerSystem', keys, virt)
+ if virt == 'Xen' or options.virt == 'XenFV':
# Xen honors additional domain-0
cs_list_len = 2
else:
@@ -94,19 +103,27 @@ def main():
# ComputerSystem.EnumerateInstances()
cs_names = [x.name for x in cs]
+ if host_ccn != 'Linux_ComputerSystem':
+ hs_ccn = get_class_basename(host_ccn)
+ else:
+ hs_ccn = host_ccn
+
# Get a list of ComputerSystem instances from the HostSystem instace
- host_ccn = host_sys.CreationClassName
- systems = assoc.AssociatorNames(options.ip, "HostedDependency",
- get_class_basename(host_ccn),
- options.virt,
+ systems = assoc.AssociatorNames(server, "HostedDependency",
+ hs_ccn, virt,
CreationClassName=host_ccn,
- Name=host_sys.Name)
+ Name=host_name)
+
# Compare each returned instance to make sure it's in the list
# that ComputerSystem.EnumerateInstances() returned
if len(systems) < 1:
- raise Exception("HostedDependency returned %d, expected at least 1" %
- len(systems))
+ logger.error("HostedDependency returned %d, expected at least 1",
+ len(systems))
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return XFAIL_RC(bug_sblim)
+
ccn = cs[0].CreationClassName
for guest in systems:
@@ -119,7 +136,7 @@ def main():
# checking the CreationClassName returned is Xen_ComputerSystem
if ccn != guest["CreationClassName"]:
- logger.error("ERROR: CreationClassName does not match")
+ logger.error("CreationClassName does not match")
status = FAIL
# Go through anything remaining in the
@@ -131,15 +148,12 @@ def main():
guest["Name"])
status = FAIL
- except (UnboundLocalError, NameError), detail:
- logger.error("Exception: %s" % detail)
-
except Exception, detail:
- logger.error(detail)
+ logger.error("Exception: %s", detail)
status = FAIL
- cxml.destroy(options.ip)
- cxml.undefine(options.ip)
+ cxml.destroy(server)
+ cxml.undefine(server)
return status
if __name__ == "__main__":
16 years, 2 months
[PATCH] [TEST] Fixing and updating 03_enabledstate.py of HostedDependency to work with sblim-base-provider
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1222777662 25200
# Node ID 1672cfb8d124a9f0dec77fa035f7ca1ef2f890d6
# Parent 74c27c6878537864db0d9a2f37dcfc826abffa5b
[TEST] Fixing and updating 03_enabledstate.py of HostedDependency to work with sblim-base-provider.
1) Updated the tc to work with/without sblim-base-provider.
2) Updated the tc to use cim_define().
3) Updated call_request_state_change() to start the domain.
3) Included the bug no 00007.
4) Used get_host_info() for getting the host information.
5) Included library function print_field_error() to print error msg.
6) Included poll_for_state_change() to verify the EnabledState value.
Tested with Xen, XenFV, KVM on current sources and with/without sblim-base-provider installed.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 74c27c687853 -r 1672cfb8d124 suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Tue Sep 30 05:25:04 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Tue Sep 30 05:27:42 2008 -0700
@@ -37,120 +37,131 @@ from XenKvmLib import enumclass
from XenKvmLib import enumclass
from XenKvmLib import assoc
from XenKvmLib.classes import get_typed_class
-from XenKvmLib.common_util import get_host_info
+from XenKvmLib.common_util import get_host_info, print_field_error, \
+poll_for_state_change, call_request_state_change
from XenKvmLib.classes import get_class_basename
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS, \
CIM_ERROR_GETINSTANCE
from XenKvmLib.const import do_main
from XenKvmLib.devices import CIM_Instance
-from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
sup_types = ['Xen', 'KVM', 'XenFV']
+TIME = "00000000000000.000000:000"
test_dom = "hd_domain1"
test_mac = "00:11:22:33:44:55"
+bug_sblim = "00007"
def create_list(instance):
new_list = {
- 'CreationClassName': instance.CreationClassName, \
- 'EnabledState' : instance.EnabledState, \
- 'Name' : instance.Name, \
+ 'CreationClassName': instance.CreationClassName,
+ 'EnabledState' : instance.EnabledState,
+ 'Name' : instance.Name,
'RequestedState' : instance.RequestedState
}
return new_list
-def print_error(field, ret_val, req_val):
- logger.error("%s Mismatch", field)
- logger.error("Returned %s instead of %s", ret_val, req_val)
def poll_for_enabledstate_value(server, virt):
status = PASS
dom_field_list = {}
- check_reqstate_value = None
timeout = 10
try:
- for i in range(1, (timeout + 1)):
- sleep(1)
- ccn = get_typed_class(virt, 'ComputerSystem')
- keys = {
- 'Name' : test_dom,
- 'CreationClassName' : ccn
- }
- dom_cs = enumclass.getInstance(server, 'ComputerSystem', keys, virt)
- if dom_cs.EnabledState == "" or dom_cs.CreationClassName == "" or \
- dom_cs.Name == "" or dom_cs.RequestedState == "":
- logger.error("Empty EnabledState field.")
- status = FAIL
- return status, []
+ status, dom_cs = poll_for_state_change(server, virt, test_dom, 9,
+ timeout)
+ if status != PASS:
+ logger.error("Attributes for dom '%s' is not set as expected.",
+ test_dom)
+ return FAIL, []
- dom_field_list = create_list(dom_cs)
- check_reqstate_value = dom_field_list['EnabledState']
- if check_reqstate_value == 9:
- break
+ dom_field_list = create_list(dom_cs)
except Exception, detail:
logger.error(CIM_ERROR_GETINSTANCE, 'ComputerSystem')
logger.error("Exception: %s" % detail)
status = FAIL
- if check_reqstate_value != 9:
- logger.error("EnabledState has %i instead of 9.", check_reqstate_value)
- logger.error("Try to increase the timeout and run the test again")
- status = FAIL
-
return status, dom_field_list
-class HsError(Exception):
- pass
+def verify_fields(hs_ret_values, exp_hs_values):
+ try:
+ field_names = exp_hs_values.keys()
+ for field in field_names:
+ if hs_ret_values[field] != exp_hs_values[field]:
+ print_field_error(field, hs_ret_values[field],
+ exp_hs_values[field])
+ return FAIL
+ except Exception, details:
+ logger.error("Exception: In fn verify_fields() %s", details)
+ return FAIL
+
+ return PASS
+
@do_main(sup_types)
def main():
options = main.options
+ virt = options.virt
+ server = options.ip
status = PASS
- virtxml = vxml.get_class(options.virt)
+ virtxml = vxml.get_class(virt)
cxml = virtxml(test_dom, mac = test_mac)
- ret = cxml.create(options.ip)
+ ret = cxml.cim_define(server)
if not ret:
- logger.error("Failed to Create the dom: %s" % test_dom)
- status = FAIL
- return status
+ logger.error("Failed to define the dom: %s" % test_dom)
+ return FAIL
- ret = cxml.run_virsh_cmd(options.ip, "suspend")
+ rc = call_request_state_change(test_dom, server, 2, TIME, virt)
+ if rc != 0:
+ logger.error("Failed to start the dom: %s" % test_dom)
+ cxml.undefine(server)
+ return FAIL
- if not ret:
+ rc = call_request_state_change(test_dom, server, 9, TIME, virt)
+ if rc != 0:
logger.error("Failed to suspend the dom: %s" % test_dom)
- cxml.destroy(options.ip)
- cxml.undefine(options.ip)
- status = FAIL
- return status
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return FAIL
- status, host_name, host_ccn = get_host_info(options.ip, options.virt)
+ status, host_name, host_ccn = get_host_info(server, virt)
if status != PASS:
logger.error("Failed to get host info")
- cxml.destroy(options.ip)
- cxml.undefine(options.ip)
+ cxml.destroy(server)
+ cxml.undefine(server)
return status
try:
-#Polling for the value of EnabledState to be set to 9.
-#We need to wait for the EnabledState to be set appropriately since
-#it does not get set immediatley to value of 9 when suspended.
+ #Polling for the value of EnabledState to be set to 9.
+ #We need to wait for the EnabledState to be set appropriately since
+ #it does not get set immediatley to value of 9 when suspended.
dom_field_list = {}
- status, dom_field_list = poll_for_enabledstate_value(options.ip,
- options.virt)
+ status, dom_field_list = poll_for_enabledstate_value(server, virt)
if status != PASS or len(dom_field_list) == 0:
- raise HsError("Failed to poll for enabled state value")
+ logger.error("Failed to poll for enabled state value")
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return FAIL
- hs = assoc.Associators(options.ip, "HostedDependency",
- get_class_basename(host_ccn), options.virt,
+ if host_ccn != 'Linux_ComputerSystem':
+ hs_ccn = get_class_basename(host_ccn)
+ else:
+ hs_ccn = host_ccn
+
+ hs = assoc.Associators(server, "HostedDependency",
+ hs_ccn, virt,
CreationClassName=host_ccn, Name=host_name)
if len(hs) == 0:
- raise HsError("HostedDependency didn't return any instances.")
+ logger.error("HostedDependency didn't return any instances.")
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return XFAIL_RC(bug_sblim)
hs_field_list = []
for hsi in hs:
@@ -158,35 +169,20 @@ def main():
hs_field_list = create_list(CIM_Instance(hsi))
if len(hs_field_list) == 0:
- raise HsError("Association did not return expected guest instance.")
+ logger.error("Association did not return expected guest instance.")
+ cxml.destroy(server)
+ cxml.undefine(server)
+ return FAIL
- if dom_field_list['CreationClassName'] != hs_field_list['CreationClassName']:
- print_error('CreationClassName', hs_field_list['CreationClassName'], \
- dom_field_list['CreationClassName'])
- status = FAIL
- if dom_field_list['Name'] != hs_field_list['Name']:
- print_error('Name', hs_field_list['Name'], \
- dom_field_list['Name'])
- status = FAIL
-
- if dom_field_list['RequestedState'] != hs_field_list['RequestedState']:
- print_error('RequestedState', hs_field_list['RequestedState'], \
- dom_field_list['RequestedState'])
- status = FAIL
- if dom_field_list['EnabledState'] != hs_field_list['EnabledState']:
- print_error('EnabledState', hs_field_list['EnabledState'], \
- dom_field_list['EnabledState'])
- status = FAIL
- except HsError, detail:
- status = FAIL
- logger.error(detail)
+ status = verify_fields(hs_field_list, dom_field_list)
+
except Exception, detail:
logger.error(CIM_ERROR_ASSOCIATORS,'HostedDependency')
logger.error("Exception: %s" % detail)
status = FAIL
- cxml.destroy(options.ip)
- cxml.undefine(options.ip)
+ cxml.destroy(server)
+ cxml.undefine(server)
return status
if __name__ == "__main__":
16 years, 2 months
[PATCH 0 of 2] Refactor SettingsDefineCapabilities AC to RASD
by Kaitlin Rupert
Condensed the 4 functions (one for min, max, inc, and def for each resource type) into 1 function for each resource type. Condensing this removes the need for the sdc_rasd structs and the sdc_rasd_list.
The provider behavior should stay the same, the only change here is the layout of the code.
16 years, 2 months
[PATCH] [TEST] Fixing assoc.py and updating the Associators and AssociatorNames to work with sblim-base-providers
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1222776362 25200
# Node ID 52f8b84c5bc6c3665b434b18707e2debbc0c0bff
# Parent 0ecb3a22c3617eaa4298dfd9cd3b7b27b9846110
[TEST] Fixing assoc.py and updating the Associators and AssociatorNames to work with sblim-base-providers.
Tested with Xen, XenFV, KVM on current sources and with/without sblim-base-provider installed.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 0ecb3a22c361 -r 52f8b84c5bc6 suites/libvirt-cim/lib/XenKvmLib/assoc.py
--- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Sep 26 02:44:52 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Tue Sep 30 05:06:02 2008 -0700
@@ -42,13 +42,16 @@ def AssociatorNames(host, basetype, base
type = basetype.split('_')
if len(type) == 2:
basetype = type[1]
-
- obj = baseobj.split('_')
- if len(type) == 2:
- baseobj = obj[1]
+
+ if baseobj != 'Linux_ComputerSystem':
+ obj = baseobj.split('_')
+ if len(obj) == 2:
+ baseobj = obj[1]
+ obj = get_typed_class(virt, baseobj)
+ else:
+ obj = baseobj
type = get_typed_class(virt, basetype)
- obj = get_typed_class(virt, baseobj)
conn = myWBEMConnection('http://%s' % host,
(Globals.CIM_USER, Globals.CIM_PASS),
Globals.CIM_NS)
@@ -77,12 +80,16 @@ def Associators(host, basetype, baseobj,
if len(type) == 2:
basetype = type[1]
- obj = baseobj.split('_')
- if len(obj) == 2:
- baseobj = obj[1]
+ if baseobj != 'Linux_ComputerSystem':
+ obj = baseobj.split('_')
+ if len(obj) == 2:
+ baseobj = obj[1]
+ obj = get_typed_class(virt, baseobj)
+ else:
+ obj = baseobj
+
type = get_typed_class(virt, basetype)
- obj = get_typed_class(virt, baseobj)
conn = myWBEMConnection('http://%s' % host,
(Globals.CIM_USER, Globals.CIM_PASS),
Globals.CIM_NS)
16 years, 2 months
[PATCH] Add network device support for Containers in DefineSystem()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1222793853 25200
# Node ID 45420ac045c39b2bbd0737ff86aaf404b9bd6d64
# Parent f1e00176a0991945dee31e9767a6868e866ce637
Add network device support for Containers in DefineSystem()
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r f1e00176a099 -r 45420ac045c3 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Sep 29 18:08:20 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Tue Sep 30 09:57:33 2008 -0700
@@ -541,6 +541,8 @@
return mem_rasd_to_vdev(inst, dev);
} else if (type == CIM_RES_TYPE_DISK) {
return lxc_disk_rasd_to_vdev(inst, dev);
+ } else if (type == CIM_RES_TYPE_NET) {
+ return net_rasd_to_vdev(inst, dev, ns);
}
return "Resource type not supported on this platform";
16 years, 2 months
make uninstall error
by Deepti B Kalakeri
The following error is seen because of the missing space after the
$(LIBS) at line no 648 in the src/Makefile.
Making uninstall in src
make[1]: Entering directory `/data/users/deepti/SRC/elm3b41/libvirt-cim/src'
Makefile:649: *** missing separator. Stop.
make[1]: Leaving directory `/data/users/deepti/SRC/elm3b41/libvirt-cim/src'
make: *** [uninstall-recursive] Error 1
Including space after $(LIBS) continues the make uninstall.
This is on F10 with the latest sources.
Thanks and Regards,
Deepti.
16 years, 2 months
[PATCH] Remove MemoryAllocationCapabilities from EC
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1222736895 25200
# Node ID ed531540158bb3ad8f7c0f47252442c9ed83bbc0
# Parent 407ad692aa963c7e07ad92b06f19cfef562b235a
Remove MemoryAllocationCapabilities from EC.
This class doesn't exist. Also remove the virtual_system_management_capabilities struct. It's now identical to the host_caps struct.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 407ad692aa96 -r ed531540158b src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Mon Sep 29 10:46:57 2008 -0700
+++ b/src/Virt_ElementCapabilities.c Mon Sep 29 18:08:15 2008 -0700
@@ -391,16 +391,6 @@
NULL
};
-static char* virtual_system_management_capabilities[] = {
- "Xen_VirtualSystemManagementCapabilities",
- "Xen_VirtualSystemMigrationCapabilities",
- "KVM_VirtualSystemManagementCapabilities",
- "KVM_VirtualSystemMigrationCapabilities",
- "LXC_VirtualSystemManagementCapabilities",
- "LXC_VirtualSystemMigrationCapabilities",
- NULL,
-};
-
static char *host_caps[] = {
"Xen_VirtualSystemManagementCapabilities",
"Xen_VirtualSystemMigrationCapabilities",
@@ -408,9 +398,6 @@
"KVM_VirtualSystemMigrationCapabilities",
"LXC_VirtualSystemManagementCapabilities",
"LXC_VirtualSystemMigrationCapabilities",
- "Xen_MemoryAllocationCapabilities",
- "KVM_MemoryAllocationCapabilities",
- "LXC_MemoryAllocationCapabilities",
NULL,
};
@@ -428,7 +415,7 @@
};
static struct std_assoc vsm_cap_to_sys_or_service = {
- .source_class = (char**)&virtual_system_management_capabilities,
+ .source_class = (char**)&host_caps,
.source_prop = "Capabilities",
.target_class = (char**)&host_sys_and_service,
@@ -454,7 +441,7 @@
.source_class = (char**)&service,
.source_prop = "ManagedElement",
- .target_class = (char**)&virtual_system_management_capabilities,
+ .target_class = (char**)&host_caps,
.target_prop = "Capabilities",
.assoc_class = (char**)&assoc_classname,
16 years, 2 months
[PATCH] Add support for <type> tag for Containers
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1222710417 25200
# Node ID 726b7a1acb055a2b03919fc3571d24bc73c8800c
# Parent 330a579be15c3967ea54158f89c85fe10363db02
Add support for <type> tag for Containers.
Libvirt now requires a type tag for Containers guests. This should be set to 'exe'.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 330a579be15c -r 726b7a1acb05 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Mon Sep 29 08:53:57 2008 -0700
+++ b/libxkutil/device_parsing.c Mon Sep 29 10:46:57 2008 -0700
@@ -935,6 +935,7 @@
free(dom->os_info.fv.loader);
free(dom->os_info.fv.boot);
} else if (dom->type == DOMAIN_LXC) {
+ free(dom->os_info.lxc.type);
free(dom->os_info.lxc.init);
} else {
CU_DEBUG("Unknown domain type %i", dom->type);
diff -r 330a579be15c -r 726b7a1acb05 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h Mon Sep 29 08:53:57 2008 -0700
+++ b/libxkutil/device_parsing.h Mon Sep 29 10:46:57 2008 -0700
@@ -91,6 +91,7 @@
};
struct lxc_os_info {
+ char *type; /* Should always be 'exe' */
char *init;
};
diff -r 330a579be15c -r 726b7a1acb05 libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Mon Sep 29 08:53:57 2008 -0700
+++ b/libxkutil/xmlgen.c Mon Sep 29 10:46:57 2008 -0700
@@ -587,11 +587,16 @@
int ret;
char *xml = NULL;
+ if (os->type == NULL)
+ os->type = strdup("exe");
+
ret = asprintf(&xml,
"<os>\n"
" <init>%s</init>\n"
+ " <type>%s</type>\n"
"</os>\n",
- os->init);
+ os->init,
+ os->type);
if (ret == -1)
xml = NULL;
16 years, 2 months
[PATCH] Add a bit more logic to check for FQDN
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1222703637 25200
# Node ID 330a579be15c3967ea54158f89c85fe10363db02
# Parent 3c3b312723817f4a418658e68de19cf38d51fc4f
Add a bit more logic to check for FQDN.
Depending on how /etc/hosts is arranged, it's possible for gethostbyname() a non-FQDN. This happens on F10 is /etc/hosts has something like:
hostname hostname.my.domain localhost
This bit a logic looks through the domains in h_aliases to see if a FQDN exists.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 3c3b31272381 -r 330a579be15c src/Virt_HostSystem.c
--- a/src/Virt_HostSystem.c Mon Sep 29 08:53:27 2008 -0700
+++ b/src/Virt_HostSystem.c Mon Sep 29 08:53:57 2008 -0700
@@ -41,6 +41,7 @@
static int resolve_host(char *host, char *buf, int size)
{
struct hostent *he;
+ int i;
he = gethostbyname(host);
if (he == NULL) {
@@ -48,6 +49,15 @@
return -1;
}
+ for (i = 0; he->h_aliases[i] != NULL; i++) {
+ if ((strchr(he->h_aliases[i], '.') != NULL) &&
+ (strstr(he->h_aliases[i], "localhost") == NULL)) {
+ strncpy(buf, he->h_aliases[i], size);
+ return 0;
+ }
+ }
+
+ CU_DEBUG("Unable to find FQDN, using hostname.");
strncpy(buf, he->h_name, size);
return 0;
16 years, 2 months