Bug 855572 - Command "virsh iface-dumpxml $BOND" will got an error with netcf-0.1.9-1, but not other version
Summary: Command "virsh iface-dumpxml $BOND" will got an error with netcf-0.1.9-1, but...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: netcf
Version: 17
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
Assignee: Laine Stump
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-09 03:09 UTC by Laine Stump
Modified: 2012-10-15 03:40 UTC (History)
3 users (show)

Fixed In Version:
Clone Of: 736920
Environment:
Last Closed: 2012-10-15 03:40:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Laine Stump 2012-09-09 03:09:34 UTC
+++ This bug was initially created as a clone of Bug #736920 +++

Description of problem:

Command "virsh iface-dumpxml ..." will got an error like "error: XML error: bond interface misses the bond element" when we want to check the bond interface's xml file. It happened when netcf's version is 0.1.9-1. The version of 0.1.8-1 and 0.1.7-1 have no this problem.

Version-Release number of selected component (if applicable):

libvirt-0.9.4-10.el6.x86_64
netcf-0.1.9-1.el6.x86_64

How reproducible:

always

Steps to Reproduce:

Need two NIC, eth0 and eth1

1.Create a file with content below, assuming the name is bond0.xml:
<interface type='bond' name='bond0'>
   <start mode='none'/>
   <protocol family='ipv4'>
    <dhcp/>
   </protocol>
   <bond mode='active-backup'>
    <miimon freq='100' updelay='10' carrier='ioctl'/>
    <interface type='ethernet' name='eth0'>
   </interface>
    <interface type='ethernet' name='eth1'>
    </interface>
   </bond>
</interface>

2.stop NetworkManager service
# service NetworkManager stop
  and restart network service.
# service network restart

3.Define new bond0
# virsh iface-define bond0.xml
# virsh iface-start bond0

4. Check the new bond0
# virsh iface-dumpxml bond0

Actual results:

Actually, we will got "error: XML error: bond interface misses the bond element"


Expected results:

Show the detail information about the bond0. It should be the same with bond0.xml.


Additional info:

--- Additional comment from pm-rhel on 2011-09-09 02:02:18 EDT ---

Since this issue was entered in bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

--- Additional comment from pm-rhel on 2011-09-09 02:11:36 EDT ---

This bugzilla has Keywords: Regression or TestBlocker.

Since no regressions or test blockers are allowed between releases,
it is also being [proposed|marked] as a blocker for this release.

Please resolve ASAP.

--- Additional comment from laine on 2011-09-22 08:36:49 EDT ---

The following has been posted for review upstream (not showing up in the archives yet, so I can't just paste a link):

commit 2637ff98c0cd1ff6712068d990bc7f8e6ad13c30
Author: Laine Stump <laine>
Date:   Thu Sep 22 01:40:48 2011 -0400

    Fix missing vlan/bond/ethernet info in dumpxml --live
    
    This patch addresses:
    
      https://bugzilla.redhat.com/show_bug.cgi?id=736920
      https://bugzilla.redhat.com/show_bug.cgi?id=739505
    
    Commit 38f44cf (pushed between 0.1.8 and 0.1.9) put a check for an
    invalid ifindex into the functions that add type-specific status data
    to the xml document (e.g. the mac address of an ethernet, or tag of a
    vlan). This check was inadvertently done incorrectly ("ifindex !=
    RTNL_LINK_NOT_FOUND" rather than "ifindex == RTNL_LINK_NOT_FOUND").
    This patch corrects that error.
    
    Because these functions are a part of the code to gather info from the
    kernel via libnl (netlink) calls, there is unfortunately no simple way
    to incorporate a build-time test to prevent similar regressions in the
    future; we will instead have to rely on separate testing.

diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index 75492ba..730be45 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -909,7 +909,7 @@ static void add_ethernet_info(struct netcf *ncf,
     struct rtnl_link *filter_link = NULL;
 
     /* if interface isn't currently available, nothing to add */
-    if (ifindex != RTNL_LINK_NOT_FOUND)
+    if (ifindex == RTNL_LINK_NOT_FOUND)
         return;
 
     filter_link = rtnl_link_alloc();
@@ -998,7 +998,7 @@ static void add_vlan_info(struct netcf *ncf,
     struct rtnl_link *filter_link = NULL;
 
     /* if interface isn't currently available, nothing to add */
-    if (ifindex != RTNL_LINK_NOT_FOUND)
+    if (ifindex == RTNL_LINK_NOT_FOUND)
         return;
 
     filter_link = rtnl_link_alloc();
@@ -1113,7 +1113,7 @@ static void add_bond_info(struct netcf *ncf,
         = { doc, root, NULL, ifindex, ncf };
 
     /* if interface isn't currently available, nothing to add */
-    if (ifindex != RTNL_LINK_NOT_FOUND)
+    if (ifindex == RTNL_LINK_NOT_FOUND)
         return;
 
     nl_cache_foreach(ncf->driver->link_cache, add_bond_info_cb, &cb_data);

--- Additional comment from veillard on 2011-09-26 11:28:23 EDT ---

Giving devel ACK since patch is present and upstream and this would be seen
as a regression,

Daniel

--- Additional comment from laine on 2011-09-26 15:02:55 EDT ---

A fix for this bug is available in a new netcf build for RHEL6:

  https://brewweb.devel.redhat.com/buildinfo?buildID=180923

--- Additional comment from errata-xmlrpc on 2011-09-26 15:05:59 EDT ---

Bug report changed to ON_QA status by Errata System.
A QE request has been submitted for advisory RHBA-2011:11532-02
http://errata.devel.redhat.com/errata/show/11532

--- Additional comment from vbian on 2011-09-26 23:33:36 EDT ---

tested with 
libvirt-0.9.4-13.el6.x86_64
netcf-0.1.9-2.el6.x86_64

Steps:
1.Create a file with content below, assuming the name is bond0.xml:
<interface type='bond' name='bond0'>
   <start mode='none'/>
   <protocol family='ipv4'>
    <dhcp/>
   </protocol>
   <bond mode='active-backup'>
    <miimon freq='100' updelay='10' carrier='ioctl'/>
    <interface type='ethernet' name='eth0'>
   </interface>
    <interface type='ethernet' name='eth1'>
    </interface>
   </bond>
</interface>

2.stop NetworkManager service
# service NetworkManager stop
  and restart network service.
# service network restart

3.Define new bond0
# virsh iface-define bond0.xml
# virsh iface-start bond0

4. Check the new bond0
# virsh iface-dumpxml bond0
<interface type='bond' name='bond0'>
 <bond>
    <interface type='ethernet' name='eth0'>
       <mac address='00:21:9b:57:9f:58'/>
    </interface>
    <interface type='ethernet' name='eth1'>
       <mac address='00:21:9b:57:9f:59'/>
    </interface>
 </bond>
</interface>

According to above , set bug status to VERIFIED

--- Additional comment from errata-xmlrpc on 2011-12-06 10:19:20 EST ---

Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1631.html

Comment 1 Fedora Update System 2012-09-09 03:27:34 UTC
netcf-0.2.2-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/netcf-0.2.2-1.fc17

Comment 2 Fedora Update System 2012-09-10 22:23:21 UTC
Package netcf-0.2.2-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing netcf-0.2.2-1.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-13735/netcf-0.2.2-1.fc17
then log in and leave karma (feedback).


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