Bug 1004596

Summary: need give more suitable error info when changing pci-bridge address function to '0x8'
Product: Red Hat Enterprise Linux 7 Reporter: EricLee <bili>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: dyuan, honzhang, jsuchane, juzhang, laine, mzhan, rbalakri, shyu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.2.17-5.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 05:43:44 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:
Bug Depends On:    
Bug Blocks: 1207751, 1340726    

Description EricLee 2013-09-05 02:31:00 UTC
Description of problem:
need give more suitable error info when changing pci-bridge address function to '0x8' 

Version-Release number of selected component (if applicable):
qemu-kvm-1.5.3-2.el7.x86_64
libvirt-1.1.1-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. define a guest will machine='q35'.
2. edit guest xml:
from:
"    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
"
to
"    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x8'/>
    </controller>
"

and save.

Actual results:
# virsh edit test1
error: internal error: Insufficient specification for PCI address
Failed. Try again? [y,n,f,?]:

Expected results:
# virsh edit test1
error: internal error: Invalid PCI address 0000:01:01.8. function must be <= 7
Failed. Try again? [y,n,f,?]:

Additional info:

Comment 6 hongming 2015-07-14 06:24:12 UTC
hi Jaroslav

The bug has had rhel-7.2.0+ flag, so it will be fixed with a new build in rhel7.2 , right? thanks.

Comment 7 Laine Stump 2015-07-22 16:06:02 UTC
Fix posted upstream:

  https://www.redhat.com/archives/libvir-list/2015-July/msg00894.html

It turns out that just getting rid of the code that outputs the useless error message allows existing code to log the proper error.

Comment 8 Laine Stump 2015-07-25 19:27:23 UTC
V1 had a problem, so I posted V2:

https://www.redhat.com/archives/libvir-list/2015-July/msg00894.html

Comment 10 Laine Stump 2015-08-08 22:47:38 UTC
The fix has been pushed upstream:

commit f8fe8f03455783afcd62d79db7ce4120f514c629
Author: Laine Stump <laine>
Date:   Wed Jul 22 11:59:00 2015 -0400

    conf: more useful error message when pci function is out of range

Comment 13 Shanzhi Yu 2015-08-20 10:55:13 UTC
Verify this bug with libvirt-1.2.17-5.el7.x86_64

1. Try to define a guest with pci-bridge in xml 

....
    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x8'/>
    </controller>
...

# virsh define r7.xml 
error: Failed to define domain from r7.xml
error: XML error: Invalid PCI address function=0x8, must be <= 7

# virt-xml-validate r7.xml 
Relax-NG validity error : Extra element devices in interleave
r7.xml:24: element devices: Relax-NG validity error : Element domain failed to validate content
r7.xml fails to validate

Comment 15 errata-xmlrpc 2015-11-19 05:43:44 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://rhn.redhat.com/errata/RHBA-2015-2202.html