Bug 1367238

Summary: libvirt allow set busNr and numa node for a pci-bridge but won't use it
Product: Red Hat Enterprise Linux 7 Reporter: Luyao Huang <lhuang>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED ERRATA QA Contact: Meina Li <meili>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: dyuan, jdenemar, lmen, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-4.3.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 09:49:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Luyao Huang 2016-08-16 02:26:36 UTC
Description of problem:
libvirt allow set busNr and numa node for a pci-bridge but won't use it

Version-Release number of selected component (if applicable):
libvirt-2.0.0-5.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare a guest have a xml like this:

    <controller type='pci' index='1' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='1' busNr='254'>
        <node>1</node>
      </target>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='ide' index='0'>

2. start guest:

# virsh start r7-lhuang
Domain r7-lhuang started

3. check qemu cmdline:

# ps aux|grep qemu

-device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 

4. check active xml:

# virsh dumpxml r7-lhuang
...
    <controller type='pci' index='1' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='1' busNr='254'>
        <node>1</node>
      </target>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
...


Actual results:
Libvirt still show the numa node and busNr in active guest xml but didn't use it to build qemu cmd line for pci-bridge (this is a negative test case since pci-bridge won't use these element).

Expected results:
maybe report error during start guest ?

Additional info:

Comment 3 Laine Stump 2018-03-09 20:16:27 UTC
I just realized this was fixed in commit 5bd876, which will be in libvirt-4.2.0

commit 5bd8764ee087f8fe417db8d80d51e2d4cd57dc6e
Author: Andrea Bolognani <abologna>
Date:   Tue Feb 20 15:12:37 2018 +0100

    qemu: Validate PCI controller options (busNr)

Comment 5 Meina Li 2018-07-12 06:53:51 UTC
Verified on bug 1483816.

Comment 7 errata-xmlrpc 2018-10-30 09:49:43 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/RHSA-2018:3113