Bug 1012829

Summary: libvirt should choose the available vf for assignment automatically if the fore vfs are unavaliable
Product: Red Hat Enterprise Linux 6 Reporter: Xuesong Zhang <xuzhang>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: acathrow, dyuan, honzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1012820 Environment:
Last Closed: 2014-04-04 20:56:50 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:
Bug Depends On: 1012820    
Bug Blocks:    

Description Xuesong Zhang 2013-09-27 08:43:22 UTC
+++ This bug was initially created as a clone of Bug #1012820 +++

Description
While the fore VF in the VFpool is not available for assignment, libvirt should choose the next available vf for assignment automatically.

Version:
libvirt-1.1.1-5.el7.x86_64
qemu-kvm-1.5.3-3.el7.x86_64
kernel-3.10.0-23.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare one hostdev network like the following one:
# virsh net-dumpxml hostnet
<network>
  <name>hostnet</name>
  <uuid>c1fb4ead-21b8-4d69-8ad9-669c55b3dfc7</uuid>
  <forward mode='hostdev' managed='yes'>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x1'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x0'/>
  </forward>
</network>

2. prepare one VF xml, the VF is the 1st VF in the vfpool.
# cat vf-hostdev-1.xml
<hostdev mode='subsystem' type='pci' managed='yes'>
  <source>
    <address bus='0x03' slot='0x10' function='0x1'/>
  </source>
</hostdev>

3. hot-plug the vf to the running guest.
# virsh attach-device a vf-hostdev-1.xml 
Device attached successfully

4. prepare one xml like following. 
# cat vf-vfpool.xml 
<interface type='network'>
 <source network='hostnet'/>
</interface>

5. hot-plug the vf in vfpool to guest.
# virsh attach-device a vf-vfpool.xml 
error: Failed to attach device from vf-vfpool.xml
error: Requested operation is not valid: PCI device 0000:03:10.1 is in use by domain a

# virsh attach-device a vf-vfpool.xml 
error: Failed to attach device from vf-vfpool.xml
error: Requested operation is not valid: PCI device 0000:03:10.1 is in use by domain a


Actual results:
in step5, libvirt can't hot-plug other available vf to the guest.


Expected results:
in step5, while the fore vf of the vfpool is not available for hot-plug, libvirt should choose other available vf from the vfpool automatically.


Additional info:

Comment 5 RHEL Program Management 2014-04-04 20:56:50 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.