Bug 1142382 - libvirt is overly restrictive with bus type and hotplug requirements on q35 QEMU machine
Summary: libvirt is overly restrictive with bus type and hotplug requirements on q35 Q...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Laine Stump
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-16 16:38 UTC by Alex Williamson
Modified: 2015-07-01 15:52 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1238338 (view as bug list)
Environment:
Last Closed: 2015-07-01 15:52:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alex Williamson 2014-09-16 16:38:09 UTC
Description of problem:

For the majority of device types, libvirt assumes that the device is conventional PCI and requires hotplug, which currently makes is so they can only be attached behind a pci-to-pci bridge in a q35 machine.  The user should be able to override this and attach endpoint devices nearly wherever they please.  If the user specifies an address which is not hotplug capable, let them do so.  If they want to attach a conventional PCI device to a PCIe bus, do it.  libvirt should only be so restrictive when it is in charge of assigning devices to buses.


Version-Release number of selected component (if applicable):
1.2.8

How reproducible:
100%

Steps to Reproduce:
1. Attempt to assign a hostdev device to either the root complex (bus=0x0) or even directly behind the dmi bridge (bus=0x1)
2.
3.

Actual results:

libvirt enforces that a PCI device cannot be attached to a PCIe bus (even though my hostdev device very well might be PCIe) and requires the bus support hotplug (even though I've made no such requirement).

Expected results:

Let me do it

Additional info:

Comment 1 Laine Stump 2014-09-16 17:58:36 UTC
Yep, this is the feedback I've been waiting for. I purposefully made the rules about plugging PCI devices into PCIe slots (and vice versa) and assigning to slots that aren't hot-pluggable restrictive to 1) avoid future problems in case qemu decided to start requiring that pci devices only be plugged into pci slots, and 2) avoid surprises when someon was unable to unplug a device.

I had *thought* that I already allowed manual assignment to a non-hotpluggable slot, but it sounds like not.

Comment 2 Jaroslav Reznik 2015-03-03 17:03:58 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 3 Laine Stump 2015-07-01 15:52:31 UTC
Patches have been pushed upstream (and will be in libvirt 1.2.17) to loosen the restrictions. libvirt will still attempt to auto-assign an address that is on a hotpluggable PCI bus, but youo can manually configure any address you want and libvirt will allow PCI<->PCIe as well as ignoring hotpluggability. (Unfortunately I forgot to reference this BZ in the commit log :-( ):

commit 1e15be1bbcbb0b43348aaabfb41b7a3a0fb51c43
Author: Laine Stump <laine>
Date:   Tue Jun 9 13:33:36 2015 -0400

    qemu: always permit PCI devices to be manually assigned to a PCIe bus

commit 9a12b6cd8c09df8328eac03c089a4f7302a71f11
Author: Laine Stump <laine>
Date:   Wed Jun 10 14:15:25 2015 -0400

    qemu: ignore assumptions about hotplug requirement when address is from config


I haven't pulled these patches back to the 1.2.13-maint branch just in case they were to cause some strange regression with auto-assign behaviour (I don't think they will, I'm just being extra cautious), but I have checked and both patches backport with a simple cherry-pick, so it could be done if requested.


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