Bug 786696 - 'XML error: bond interface misses the bond element' when try to stop a bond through command.
Summary: 'XML error: bond interface misses the bond element' when try to stop a bond t...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Laine Stump
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-02 07:40 UTC by Geyang Kong
Modified: 2016-04-26 17:07 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-13 21:22:13 UTC


Attachments (Terms of Use)
This is libvirtd's log (931 bytes, text/plain)
2012-02-02 07:41 UTC, Geyang Kong
no flags Details

Description Geyang Kong 2012-02-02 07:40:35 UTC
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

Comment 1 Geyang Kong 2012-02-02 07:41:03 UTC
Created attachment 559000 [details]
This is libvirtd's log

Comment 2 Laine Stump 2012-05-16 19:19:31 UTC
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.

Comment 5 Laine Stump 2014-08-13 21:22:13 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.