Hide Forgot
Version-Release number of selected component (if applicable): libvirt-0.9.9-2.el6.x86_64 python-virtinst-0.600.0-5.el6.noarch qemu-kvm-0.12.1.2-2.218.el6.x86_64 virt-manager-0.9.0-7.el6.x86_64 Linux version 2.6.32-220.el6.x86_64 netcf-0.1.9-2.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. Stop NetworkManager service. 2. Start virt-manager. 3. Click Edit->Connection Details->Network Interfaces 4. Click '+' button and choose bond then click 'Forward' 5. Choose an eth device(mine is eth1), Set 'Start mode'=none, and check 'Activate now'. 6. Click 'Configure' button besides 'Bond mode' 7. Choose Bond mode as 'active-backup', Bond monitor mode as 'arpmon', interval=100, Validate mode=active Target address: 192.168.50.1, then press OK and finish the wizard 7. input 'virsh iface-destroy bond0' through terminal. Actual results: 1. There is an error appeared says 'XML error: bond interface misses the bond element', please refer to attachments for more information: Following is a part of libvirtd.log -------------------------------------------------------------------------------- 2012-02-02 19:55:25.415+0000: 2445: error : virInterfaceDefParseXML:793 : XML error: bond interface misses the bond element -------------------------------------------------------------------------------- Expected results: 1. Bond could be stopped normally without error. Additional info: None
Created attachment 559000 [details] This is libvirtd's log
libvirt is asking netcf for the live status of the bond. The live status currently only returns IP/MAC address configuration, not info about enslaved devices, so there is no <bond> element, but libvirt's parser is written to require a <bond> element. Either netcf needs to be enhanced to provide the <bond> element in a status dump, or libvirt needs to make it optional.
Among other places, this was also reported in Bug 878394 (RHEL7 libvirt) Bug 786694 (RHEL6 virt-manager) Bug 1057964 (RHEL7 netcf) This was fixed with the following upstream commit: commit 7284c499e54e538fd0ab35a1f09e358f06fc23b0 Author: Laine Stump <laine> Date: Mon Apr 7 15:32:00 2014 +0300 interface: dump inactive xml when interface isn't active Other drivers in libvirt (e.g. network, qemu) will automatically return the "inactive" (persistent configuration) XML of an object when that object is inactive. The netcf backend of the interface driver would always try to return the live status XML of the interface, even when it was down. Although netcf does return valid XML in that case, for bond interfaces it is missing almost all of its content, including the <bond> subelement itself, leading to this error message from "virsh iface-dumpxml" of a bond interface that is inactive: error: XML error: bond interface misses the bond element (this is because libvirt's validation of the XML returned by netcf always requires a <bond> element be present). This patch modifies the interface driver netcf backend to check if the interface is inactive, and in that case always return the inactive XML (which will always have a <bond> element, thus eliminating the error message, as well as making operation more in line with other drivers.