Bug 1600330 - The dumped filterbinding can not pass the xml validate
Summary: The dumped filterbinding can not pass the xml validate
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: yalzhang@redhat.com
Depends On:
TreeView+ depends on / blocked
Reported: 2018-07-12 01:55 UTC by yalzhang@redhat.com
Modified: 2018-10-30 09:59 UTC (History)
4 users (show)

Fixed In Version: libvirt-4.5.0-4.el7
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2018-10-30 09:58:24 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 None None None 2018-10-30 09:59:15 UTC

Description yalzhang@redhat.com 2018-07-12 01:55:42 UTC
Description of problem:
The dumped filterbinding can not pass the xml validate

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

How reproducible:

Steps to Reproduce:
1. start a vm with interface defined with nwfilter
# virsh dumpxml rhel  | grep /interface -B8
    <interface type='network'>
      <mac address='52:54:00:a1:99:dc'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <filterref filter='clean-traffic'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>

2. check the network ports which have filters associated with them
# virsh nwfilter-binding-list 
 Port Dev              Filter               
 vnet0                 clean-traffic       

3. Output the network filter binding XML for the network device vnet0
# virsh nwfilter-binding-dumpxml vnet0
  <portdev name='vnet0'/>
  <mac address='52:54:00:a1:99:dc'/>
  <filterref filter='clean-traffic'>
    <parameter name='MAC' value='52:54:00:a1:99:dc'/>

4. validate the dumped xml by virt-xml-validate, it fails
# virsh nwfilter-binding-dumpxml vnet0 > filterbinding.xml
# virt-xml-validate filterbinding.xml
filterbinding.xml:1: element filterbinding: Relax-NG validity error : Expecting element filter, got filterbinding
filterbinding.xml fails to validate

Actual results:
step 4, the dumped xml can not pass the xml validate

Expected results:
the dumped xml can pass the xml validate

Additional info:

Comment 2 John Ferlan 2018-07-19 18:05:35 UTC
Patch posted upstream:


Comment 3 John Ferlan 2018-07-19 20:19:43 UTC
Now pushed upstream:

$ git show
commit a47d053720f3b4965184bc9a5a87a86d301957ea
Author: Han Han <hhan@redhat.com>
Date:   Fri Jul 13 09:39:29 2018 +0800

    virt-xml-validate: Add schema for nwfilterbinding
    Add nwfilterbinding schema in virt-xml-validate for autoprobing.
    Add document of nwfilterbinding schema in tools/virt-xml-validate.pod.
    Signed-off-by: Han Han <hhan@redhat.com>
    Reviewed-by: John Ferlan <jferlan@redhat.com>

$ git describe a47d053720f3b4965184bc9a5a87a86d301957ea

Comment 6 yalzhang@redhat.com 2018-07-26 05:52:42 UTC
test on libvirt-4.5.0-4.el7.x86_64, the result is as expected, set this bug to be verified.

1. collect all the built-in nwfilter name in a file called 'test'
# virsh nwfilter-list > test
# cat test

2. prepare xmls included different filters
# cat run.sh

while read line; do 
echo "<interface type='network'>
      <source network='default'/>
<filterref filter='$line'/>
    </interface> " > vnet$k
done < test


3. Find the interface with 'allow-dhcp-server' filter, edit the file to add the dhcp server parameter
# cat vnet3
<interface type='network'>
      <source network='default'/>
<filterref filter='allow-dhcp-server'>
<parameter name='DHCPSERVER' value=''/>

4. prepare configs with parameters:
# cat vnet18
<interface type='bridge'>
<source bridge='br0'/>
    <mac address='00:16:3e:5d:c7:9e'/>
    <filterref filter='clean-traffic'>
      <parameter name='IP' value=''/>
      <parameter name='IP' value=''/>
      <parameter name='IP' value=''/>

# cat vnet19
<interface type='bridge'>
  <source bridge='br0'/>
  <filterref filter='clean-traffic'>
    <parameter name='CTRL_IP_LEARNING' value='dhcp'/>

# for i in {1..19}; do virsh attach-device rhel vnet$i --config; done
# virsh start rhel
# for i in {1..19}; do virsh nwfilter-binding-dumpxml  vnet$i > binding$i; virt-xml-validate binding$i;done
binding1 validates
binding2 validates
binding3 validates
binding4 validates
binding5 validates
binding6 validates
binding7 validates
binding8 validates
binding9 validates
binding10 validates
binding11 validates
binding12 validates
binding13 validates
binding14 validates
binding15 validates
binding16 validates
binding17 validates
binding18 validates
binding19 validates

Comment 8 errata-xmlrpc 2018-10-30 09:58:24 UTC
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.


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