RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1483816 - Schema for the 'target' field in <controller model='pci-bridge'> should not accept 'chassis' and 'port' parameters for 'q35' machine type
Summary: Schema for the 'target' field in <controller model='pci-bridge'> should not a...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Andrea Bolognani
QA Contact: Meina Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-22 03:21 UTC by jiyan
Modified: 2019-02-13 16:48 UTC (History)
9 users (show)

Fixed In Version: libvirt-4.3.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:49:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 0 None None None 2018-10-30 09:52:27 UTC

Description jiyan 2017-08-22 03:21:39 UTC
Description of problem:
Schema for the 'target' field in <controller model='pci-bridge'> should not accept 'chassis' and 'port' parameters for 'q35' machine type

Version-Release number of selected component (if applicable):
libvirt-3.2.0-14.el7_4.2.x86_64
qemu-kvm-rhev-2.9.0-16.el7_4.4.x86_64
kernel-3.10.0-693.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a shutdown 'q35' VM with the following info:
# virsh dumpxml q35 --inactive
    <type arch='x86_64' machine='pc-q35-rhel7.4.0'>hvm</type>
    ...
    <controller type='pci' index='3' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='3' chassis='4' port='0x10'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>

2. Start the VM
# virsh start q35
Domain q35 started

3. Check the 'target' field in <controller model='pci-bridge'> in dumpxml file of VM
# virsh dumpxml q35 |grep "<controller type='pci' index='3' model='pci-bridge'>" -A 4
     <controller type='pci' index='3' model='pci-bridge'>
       <model name='pci-bridge'/>
       <target chassisNr='3' chassis='4' port='0x10'/>   
       <alias name='pci.3'/>
       <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>

4. Check the qemu cmd line
# ps -ef |grep q35 |grep pci-bridge |sed "s/-device/\n-device/g"
...
 -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 
 -device pci-bridge,chassis_nr=3,id=pci.3,bus=pci.1,addr=0x1
...

Actual results:
Schema for the 'target' field in <controller model='pci-bridge'> accepts 'chassis' and 'port' parameters and VM starts successfully, while qemu cmd line skips these two parameters.


Expected results:
Schema for the 'target' field in <controller model='pci-bridge'> should not accept 'chassis' and 'port' parameters for 'q35' machine type

Additional info:

Comment 2 Andrea Bolognani 2017-12-06 10:17:22 UTC
Patches posted upstream.

  https://www.redhat.com/archives/libvir-list/2017-December/msg00154.html

Comment 3 Andrea Bolognani 2018-02-21 14:16:17 UTC
v3 patches posted upstream.

  https://www.redhat.com/archives/libvir-list/2018-February/msg00996.html

Comment 4 Andrea Bolognani 2018-03-09 16:12:41 UTC
Fixes merged upstream.

commit 97727e060cdfffa5abc8dca32b50cfd26d0c2ca1
Author: Andrea Bolognani <abologna>
Date:   Tue Feb 20 15:24:29 2018 +0100

    qemu: Validate PCI controller options (chassis and port)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1483816
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Laine Stump <laine>

commit 6fef5bf301b414e9b7a824311fec63fabb50dfac
Author: Andrea Bolognani <abologna>
Date:   Tue Feb 20 15:21:11 2018 +0100

    qemu: Validate PCI controller options (chassisNr)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1483816
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Laine Stump <laine>

commit c651cdbce64022a0d6858e57bbbe671078a7b626
Author: Andrea Bolognani <abologna>
Date:   Wed Feb 21 10:17:56 2018 +0100

    qemu: Validate PCI controller options (numaNode)
    
    This change catches an invalid use of the option in our
    test suite.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1483816
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Laine Stump <laine>

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

    qemu: Validate PCI controller options (busNr)
    
    This change catches an invalid use of the option in our
    test suite.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1483816
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Laine Stump <laine>

commit 932b6e1afc242d909193eb54f05a2e10bd6e78d7
Author: Andrea Bolognani <abologna>
Date:   Tue Feb 20 15:07:15 2018 +0100

    qemu: Validate PCI controller options (pcihole64)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1483816
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Laine Stump <laine>

commit dd8a8f1df3b5dc7c877ef454d9f93206cdc2cec0
Author: Andrea Bolognani <abologna>
Date:   Tue Feb 20 15:01:05 2018 +0100

    qemu: Validate PCI controller options (targetIndex)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1483816
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Laine Stump <laine>

commit 68b1491e89452f8bc1b696e478ff0165ffa6d114
Author: Andrea Bolognani <abologna>
Date:   Tue Feb 20 14:38:19 2018 +0100

    qemu: Validate PCI controller options (index)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1483816
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Laine Stump <laine>

commit 5a8b8b3f000537e0b119fe4168dd708a66c79408
Author: Andrea Bolognani <abologna>
Date:   Tue Feb 20 14:47:55 2018 +0100

    qemu: Validate PCI controller options (modelName)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1483816
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Laine Stump <laine>

Comment 6 Meina Li 2018-07-12 06:01:28 UTC
Verified on libvirt-4.5.0-2.el7.x86_64

Test steps:
1. chassis - edit <target chassis='4' port='0x48'/> in pci controller of guest xml
1) error: unsupported configuration: Option 'chassis' is not valid for PCI controller with index '1', model 'dmi-to-pci-bridge' and modelName 'i82801b11-bridge'
Failed. Try again? [y,n,i,f,?]: 
2)The same expected results with model 'pci-bridge''pcie-expander-bus''pcie-switch-upstream-port'
3)The same expected results with port attribute.
4)Only valid for model 'pcie-root-port' and 'pcie-switch-downstream-port'

2. chassisNr  - edit <target chassisNr='2'/> in pci controller of guest xml
1)Option 'chassisNr' is not valid for PCI controller ... model 'pcie-expander-bus''pcie-root-port''pcie-switch-upstream-port''pcie-switch-downstream-port'.
2)Only valid for model 'pci-bridge'.

3. numaNode - edit <target> <node>0</node> </target> in pci controller of guest xml
1) Option 'numaNode' is not valid for PCI controller ... model 'dmi-to-pci-bridge' and modelName 'i82801b11-bridge''pci-bridge''pcie-root-port''pcie-switch-upstream-port''pcie-switch-downstream-port'.
2)Only valid for model 'pcie-expander-bus'.

4. busNr  - edit <target busNr='254'/> in pci controller of guest xml
1)Option 'busNr' is not valid for PCI controller ... model 'dmi-to-pci-bridge''pci-bridge''pcie-root-port''pcie-switch-upstream-port''pcie-switch-downstream-port'.
2)Only valid for model 'pcie-expander-bus'.

5. pcihole64  - edit <pcihole64 unit='KiB'>2</pcihole64> in pci controller of guest xml
1) pcihole64 element missing in guest xml.
2) Only valid for model 'pcie-root'.

6. index - edit index of other pci controller except pcie-root to '0'
error: XML error: The PCI controller with index='0' must be model='pcie-root' for this machine type / XML error: Multiple 'pci' controllers with index '0'

7. modelName
As above test, modelName have been set automatically. 
For example: Option 'busNr' is not valid for PCI controller with index '2', model 'pci-bridge' and modelName 'pci-bridge'

Comment 7 Meina Li 2018-07-12 06:17:30 UTC
Additional info:
Also test on pcie-to-pci-bridge controller, the behavior of both above options is expected.
# virsh edit rhel7
error: unsupported configuration: Option 'chassis' is not valid for PCI controller with index '7', model 'pcie-to-pci-bridge' and modelName 'pcie-pci-bridge'
Failed. Try again? [y,n,i,f,?]: 
error: unsupported configuration: Option 'numaNode' is not valid for PCI controller with index '7', model 'pcie-to-pci-bridge' and modelName 'pcie-pci-bridge'
Failed. Try again? [y,n,i,f,?]: 
error: unsupported configuration: Option 'busNr' is not valid for PCI controller with index '7', model 'pcie-to-pci-bridge' and modelName 'pcie-pci-bridge'
Failed. Try again? [y,n,i,f,?]: 
......

Comment 9 errata-xmlrpc 2018-10-30 09:49:58 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

Comment 10 gaojianan 2019-01-18 06:42:55 UTC
Excuse me , i found a similar problem that may be associated with this bug.
Can you help me check if it is the same problem if you have time.
Step to reproduce:
1.Prepare the pcie-root-port xml:
<controller type='pci' index='9' model='pcie-root-port'/>

2.Cold plug a pcie-root-port controller to a q35 guest:
# virsh attach-device q35 /tmp/pcie-root-port.xml --config
Then will get the error like :
:internal error: Required option 'modelName' is not set for PCI controller with index '9', 
model 'pcie-root-port' and modelName 'none'

3.But when i edit it in the guest xml like:
 <controller type='pci' index='8' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='8' port='0x15'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
    </controller>
<controller type='pci' index='9' model='pcie-root-port'/>

Then i can start the guest successfully.
So i want to confirm that are there any problem when i cold-plug the controller ?

Comment 11 Andrea Bolognani 2019-02-13 16:48:37 UTC
(In reply to gaojianan from comment #10)
> Excuse me , i found a similar problem that may be associated with this bug.
> Can you help me check if it is the same problem if you have time.

Sorry for taking so long to reply! It totally got buried in my inbox
until just now :(

> Step to reproduce:
> 1.Prepare the pcie-root-port xml:
> <controller type='pci' index='9' model='pcie-root-port'/>
> 
> 2.Cold plug a pcie-root-port controller to a q35 guest:
> # virsh attach-device q35 /tmp/pcie-root-port.xml --config
> Then will get the error like :
> :internal error: Required option 'modelName' is not set for PCI controller
> with index '9', 
> model 'pcie-root-port' and modelName 'none'
> 
> 3.But when i edit it in the guest xml like:
>  <controller type='pci' index='8' model='pcie-root-port'>
>       <model name='pcie-root-port'/>
>       <target chassis='8' port='0x15'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
> function='0x5'/>
>     </controller>
> <controller type='pci' index='9' model='pcie-root-port'/>
> 
> Then i can start the guest successfully.
> So i want to confirm that are there any problem when i cold-plug the
> controller ?

The issue you're hitting is unrelated to the bug report at hand, but
it's a bug indeed: what you're trying to do should be possible.

It looks like we're failing to fill in reasonable values when 'virsh
attach-device' is used, even though the same XML will work for 'virsh
define' or 'virsh edit'.

Can you please file a separate bug for this issue?


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