Hide Forgot
Description of problem: There's no problem when using virsh command to define and start a vlan, but dumpxml for the active vlan, will get an error. When downgrade netcf to netcf-0.1.8-1.el6, still get the problem, but downgrade libvirt to libvirt-0.8.7-18.el6, there's no problem, so it's a regression bug. Version-Release number of selected component (if applicable): libvirt-0.9.4-11.el6.x86_64 netcf-0.1.9-1.el6 How reproducible: always Steps to Reproduce: 1.Define and start a vlan from vlan.xml. # cat vlan.xml <interface type='vlan' name='eth0.1'> <start mode='onboot'/> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <vlan tag='1'> <interface name='eth0'/> </vlan> </interface> # virsh iface-define vlan.xml Interface eth0.1 defined from vlan.xml # virsh iface-start eth0.1 Interface eth0.1 started 2.Try to get the xml of the active vlan # virsh iface-dumpxml eth0.1 error: XML error: vlan interface misses the vlan element 3.Destroy the vlan and dumpxml again # virsh iface-destroy eth0.1 Interface eth0.1 destroyed # virsh iface-dumpxml eth0.1 <interface type='ethernet' name='eth0.1'> </interface> Actual results: error: XML error: vlan interface misses the vlan element Expected results: # virsh iface-dumpxml eth0.1 <interface type='vlan' name='eth0.1'> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <protocol family='ipv6'> <ip address='fe80::baac:6fff:fe3a:f6f4' prefix='64'/> </protocol> <vlan tag='1'> <interface name='eth0'/> </vlan> </interface> Additional info: libvirt.log ------ 17:51:30.787: 2107: error : virInterfaceDefParseXML:814 : XML error: vlan interface misses the vlan element ------ BTW, when encounter this bug, it also affect virt-manager to install a new guest.
retried with libvirt-0.9.4-11.el6.x86_64 + netcf-0.1.8-1.el6, after downgrade netcf and restart libvirtd, #virsh iface-dumpxml $vlan can get the correct result. So it's a netcf regression. There's already a Bug 736920 - [netcf][Regression] Command "virsh iface-dumpxml $BOND" will got an error with netcf-0.1.9-1, but not other version, which error is: error: XML error: bond interface misses the bond element both these two bugs belong to the same series. So please close it if it's a duplicate bug, thanks.
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);
A fix for this bug is available in a new netcf build for RHEL6: https://brewweb.devel.redhat.com/buildinfo?buildID=180923
tested with libvirt-0.9.4-13.el6.x86_64 netcf-0.1.9-2.el6.x86_64 Steps [root@dhcp-93-106 ~]# virsh iface-define vlan.xml Interface eth0.1 defined from vlan.xml [root@dhcp-93-106 ~]# virsh iface-start eth0.1 Interface eth0.1 started [root@dhcp-93-106 ~]# virsh iface-dumpxml eth0.1 <interface type='vlan' name='eth0.1'> <protocol family='ipv4'> <ip address='192.168.177.1' prefix='24'/> </protocol> <protocol family='ipv6'> <ip address='fe80::221:9bff:fe57:9f58' prefix='64'/> </protocol> <vlan tag='1'> <interface name='eth0'/> </vlan> </interface> [root@dhcp-93-106 ~]# virsh iface-destroy eth0.1 Interface eth0.1 destroyed [root@dhcp-93-106 ~]# virsh iface-dumpxml eth0.1 <interface type='ethernet' name='eth0.1'> </interface> According to above steps , set bug status to VERIFIED
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