Bug 1460602

Summary: Error info for PIIX3 USB controller at index is 0 with incorrect PCI address should be clearer
Product: Red Hat Enterprise Linux 7 Reporter: jiyan <jiyan>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: jiyan <jiyan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.5CC: dyuan, jiyan, jtomko, lmen, rbalakri, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-3.9.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 10:48:37 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 jiyan 2017-06-12 07:24:57 UTC
Description of problem:
The restriction  that "PIIX3 USB controller must have PCI address 0:0:1.2" is only valid for controller with index 0, so the error info: "error: internal error: PIIX3 USB controller must have PCI address 0:0:1.2" ,shoule be more clearer when editing the dumpxml with address is not 0:0:1:2 while index of PIIX3 USB controller is 0.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.9.0-9.el7.x86_64
libvirt-3.2.0-9.el7.x86_64
kernel-3.10.0-679.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Edit the vm's dumpxml with the value of 'index' is 0, and the address is 1:1:1:2,just as follows; then check the dumpxml and start the vm  
# virsh edit generic
...
    <controller type='usb' index='0' model='piix3-uhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
...
Domain generic XML configuration edited.

# virsh dumpxml generic |grep usb -A 3
    <controller type='usb' index='0' model='piix3-uhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>

# virsh start generic
Domain generic started


2.Edit the vm's dumpxml with the value of 'index' is 0,while the address is not 1:1:1:2,just as follows; then check the dumpxml and start the vm 
# virsh edit generic
...
    <controller type='usb' index='0' model='piix3-uhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
...
error: internal error: PIIX3 USB controller must have PCI address 0:0:1.2
Failed. Try again? [y,n,i,f,?]: 

3.Edit the vm's dumpxml with two usb controllers, the value of 'index' in piix3-uhci controller is 1 and the address is not 1:1:1:2,just as follows; then check the dumpxml and start the vm 
# virsh edit generic
...
    <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='usb' index='1' model='piix3-uhci'>
      <alias name='usb1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
...
Domain generic XML configuration edited.

# virsh dumpxml generic |grep usb -A 3
    <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='usb' index='1' model='piix3-uhci'>
      <alias name='usb1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>

# virsh start generic
Domain generic started


Actual results:
As step 2.

Expected results:
The error info in step 2 should like this: "error: internal error: PIIX3 USB controller must have PCI address 0:0:1.2 for controller with index 0"

Additional info:

Comment 2 Ján Tomko 2017-09-26 11:06:16 UTC
Upstream patch:
https://www.redhat.com/archives/libvir-list/2017-September/msg00916.html

Comment 3 Ján Tomko 2017-10-11 07:42:46 UTC
Pushed upstream as:
commit f9267297cf43a4b2e686e9ab7b23ac8dfe383907
Author:     Ján Tomko <jtomko>
CommitDate: 2017-10-11 09:39:23 +0200

    qemu: clarify error message for index 0 PIIX3 USB controller
    
    The address is restricted to 0:0:1.2 only for the piix3-uhci controller
    at index 0.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1460602

git describe: v3.8.0-70-gf9267297c

Comment 5 jiyan 2017-11-06 02:26:24 UTC
Test env components:
qemu-kvm-rhev-2.10.0-4.el7.x86_64
kernel-3.10.0-768.el7.x86_64
libvirt-3.9.0-1.el7.x86_64

Test steps:
1. Prepare a vm named 'qcow2' without 'piix3-uhci' USB controller
# virsh list --all |grep qcow2
 -     qcow2                          shut off

# virsh dumpxml qcow2 |grep piix3 -A2
    <controller type='usb' index='0' model='piix3-uhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>

2. Edit the vm by changing the address of 'piix3-uhci' USB controller as '0:0:1.3'
# virsh edit qcow2
...
    <controller type='usb' index='0' model='piix3-uhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
    </controller>
...
error: internal error: PIIX3 USB controller at index 0 must have PCI address 0:0:1.2
Failed. Try again? [y,n,i,f,?]:

All the results are as expected, move this bug to be verified.

Comment 9 errata-xmlrpc 2018-04-10 10:48:37 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/RHEA-2018:0704