[PATCH] Resolve hotplug failure for VSMS test 22

Followup to exchange as part of previous cimtest checkin: https://www.redhat.com/archives/libvirt-cim/2013-May/msg00005.html Test was failing as follows: VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - (1, u"CIM_ERR_FAILED: Unable to change (0) device: internal error unable to execute QEMU command 'device_add': Bus 'pci.0' does not support hotplugging") ERROR - Error invoking AddRS: add_net_res ERROR - AddResourceSettings call failed ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unable to change (0) device: internal error unable to execute QEMU command 'device_add': Bus 'pci.0' does not support hotplugging Bug:<00015> Through some investigation, I found/figured that Acpi needed to be set for the domain so that hotplug would work properly. After applying this patch, the test succeeds for me. John Ferlan (1): Allow adding bridged network for running domain .../22_addmulti_brg_interface.py | 9 +++++++-- suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 17 +++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) -- 1.8.1.4

Test failed with following: VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - (1, u"CIM_ERR_FAILED: Unable to change (0) device: internal error unable to execute QEMU command 'device_add': Bus 'pci.0' does not support hotplugging") ERROR - Error invoking AddRS: add_net_res ERROR - AddResourceSettings call failed ERROR - Failed to destroy Virtual Network 'my_network1' InvokeMethod(AddResourceSettings): CIM_ERR_FAILED: Unable to change (0) device: internal error unable to execute QEMU command 'device_add': Bus 'pci.0' does not support hotplugging Bug:<00015> The fix for this was that the domain needed to be created with the "acpi=True" flag. This allowed the test to get a bit further, but it then failed with the following: VirtualSystemManagementService - 22_addmulti_brg_interface.py: XFAIL ERROR - Got 88:aa:bb:cc:ee:ff, exp 88:aa:bb:cc:ee:ff. Got None, exp my_network1. ERROR - Error invoking AddRS: add_net_res ERROR - Error adding rs for net mac ERROR - Failed to destroy Virtual Network 'my_network1' The issue here is that the created network bridge didn't have an xml resource "source network" as 'my_network1', rather that name is assigned to the pool. A network bridge has a resource "source bridge" which can be compared. Since I wasn't sure how a Xen domain would look I separated the valiation comparisons. --- .../22_addmulti_brg_interface.py | 9 +++++++-- suites/libvirt-cim/lib/XenKvmLib/vsms_util.py | 17 +++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py index 36d1873..0452bf6 100644 --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/22_addmulti_brg_interface.py @@ -63,8 +63,13 @@ def main(): service = get_vsms_class(options.virt)(options.ip) classname = get_typed_class(options.virt, 'VirtualSystemSettingData') - vsxml = get_class(options.virt)(test_dom, mac=default_mac, ntype=ntype, - net_name=default_brg) + # Seems ACPI needs to be set for KVM in order for hotplug to work right + if options.virt == "KVM": + vsxml = get_class(options.virt)(test_dom, mac=default_mac, ntype=ntype, + net_name=default_brg, acpi=True) + else: + vsxml = get_class(options.virt)(test_dom, mac=default_mac, ntype=ntype, + net_name=default_brg) try: ret = vsxml.cim_define(options.ip) if not ret: diff --git a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py index 075c09f..cba7ce0 100644 --- a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py @@ -189,9 +189,14 @@ def add_net_res(server, service, virt, cxml, vssd_ref, nasd, attr): % attr['nmac']) if virt == "KVM": + # For KVM, compare the source bridge name = cxml.get_value_xpath( - '/domain/devices/interface/source/@network[. = "%s"]' - % attr['net_name']) + '/domain/devices/interface/source/@bridge[. = "%s"]' + % attr['virt_net']) + if mac != attr['nmac'] or name != attr['virt_net']: + logger.error("MAC: Got %s, exp %s. NAME: Got %s, exp %s.", + mac, attr['nmac'], name, attr['virt_net']) + raise Exception('Error adding rs for net mac') else: # For Xen, network interfaces are converted to bridge interfaces. @@ -202,10 +207,10 @@ def add_net_res(server, service, virt, cxml, vssd_ref, nasd, attr): if name != None: name = attr['net_name'] - if mac != attr['nmac'] or name != attr['net_name']: - logger.error("Got %s, exp %s. Got %s, exp %s.", mac, - attr['nmac'], name, attr['net_name']) - raise Exception('Error adding rs for net mac') + if mac != attr['nmac'] or name != attr['net_name']: + logger.error("MAC: Got %s, exp %s. NAME: Got %s, exp %s. br %s", + mac, attr['nmac'], name, attr['net_name'], br) + raise Exception('Error adding rs for net mac') logger.info('good status for net_mac') except Exception, details: -- 1.8.1.4
participants (1)
-
John Ferlan