Bug 1746617 - virt-xml-validate fail to validate network port xml
Summary: virt-xml-validate fail to validate network port xml
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Daniel Berrangé
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks: 1585087
TreeView+ depends on / blocked
 
Reported: 2019-08-29 01:07 UTC by yalzhang@redhat.com
Modified: 2020-11-02 09:34 UTC (History)
5 users (show)

Fixed In Version: libvirt-5.9.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 09:49:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2017 0 None None None 2020-05-05 09:50:56 UTC

Description yalzhang@redhat.com 2019-08-29 01:07:05 UTC
Description of problem:
virt-xml-validate fail to validate network port xml

Version-Release number of selected component (if applicable):
libvirt-5.6.0-2.virtcov.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. check the network port xml:
# virsh net-port-list bridge-test
 UUID
---------------------------------------
 f3d6e7fe-a08b-4351-96c4-3a1046c32a6f

# virsh net-port-dumpxml bridge-test f3d6e7fe-a08b-4351-96c4-3a1046c32a6f
<networkport>
  <uuid>f3d6e7fe-a08b-4351-96c4-3a1046c32a6f</uuid>
  <owner>
    <name>rhel</name>
    <uuid>6fc9e4e3-980c-43df-8d62-673cd69b00e3</uuid>
  </owner>
  <mac address='52:54:00:eb:6f:8d'/>
  <plug type='bridge' bridge='br0'/>
</networkport>

2. validate the port xml by virt-xml-validate:
# virsh net-port-dumpxml bridge-test f3d6e7fe-a08b-4351-96c4-3a1046c32a6f > port.xml

# virt-xml-validate port.xml
port.xml:1: element networkport: Relax-NG validity error : Expecting element network, got networkport
port.xml fails to validate

Actual results:
virt-xml-validate fail to validate network port xml

Expected results:
the xml should pass the virt-xml-validate

Additional info:

Comment 1 Daniel Berrangé 2019-09-12 13:12:49 UTC
Patch proposed upstream

https://www.redhat.com/archives/libvir-list/2019-September/msg00482.html

Comment 2 Daniel Berrangé 2019-09-12 15:12:24 UTC
Merged upstream as:

commit 2e3e942f99f29483c328f5ddafda37782bc2d43e
Author: Daniel P. Berrangé <berrange>
Date:   Thu Sep 12 14:12:02 2019 +0100

    tools: fix XML validator detection of network port XML schema
    
    Reviewed-by: Michal Privoznik <mprivozn>
    Signed-off-by: Daniel P. Berrangé <berrange>

Comment 4 Jing Qi 2020-01-21 02:02:11 UTC
Verified with libvirt-6.0.0-1.module+el8.2.0+5453+31b2b136.x86_64
 & qemu-kvm-4.2.0-6.module+el8.2.0+5453+31b2b136.x86_64
 
# virsh net-port-list default
 UUID
---------------------------------------
 2cb1346e-c46a-42e2-a3c7-7cea06409cf4

# virsh net-port-dumpxml default 2cb1346e-c46a-42e2-a3c7-7cea06409cf4
<networkport>
  <uuid>2cb1346e-c46a-42e2-a3c7-7cea06409cf4</uuid>
  <owner>
    <name>avocado-vt-vm1</name>
    <uuid>d5bc4702-a7d9-444a-9978-d31f63d4e716</uuid>
  </owner>
  <mac address='52:54:00:58:15:eb'/>
  <plug type='network' bridge='virbr0'/>
</networkport>

# virsh net-port-dumpxml default 2cb1346e-c46a-42e2-a3c7-7cea06409cf4 > ~/port.xml
# virt-xml-validate ~/port.xml
/root/port.xml validates

Comment 5 Jing Qi 2020-01-21 02:02:33 UTC
Verified with libvirt-6.0.0-1.module+el8.2.0+5453+31b2b136.x86_64
 & qemu-kvm-4.2.0-6.module+el8.2.0+5453+31b2b136.x86_64
 
# virsh net-port-list default
 UUID
---------------------------------------
 2cb1346e-c46a-42e2-a3c7-7cea06409cf4

# virsh net-port-dumpxml default 2cb1346e-c46a-42e2-a3c7-7cea06409cf4
<networkport>
  <uuid>2cb1346e-c46a-42e2-a3c7-7cea06409cf4</uuid>
  <owner>
    <name>avocado-vt-vm1</name>
    <uuid>d5bc4702-a7d9-444a-9978-d31f63d4e716</uuid>
  </owner>
  <mac address='52:54:00:58:15:eb'/>
  <plug type='network' bridge='virbr0'/>
</networkport>

# virsh net-port-dumpxml default 2cb1346e-c46a-42e2-a3c7-7cea06409cf4 > ~/port.xml
# virt-xml-validate ~/port.xml
/root/port.xml validates

Comment 7 errata-xmlrpc 2020-05-05 09:49:40 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.

https://access.redhat.com/errata/RHBA-2020:2017


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