[libvirt] [PATCH 03/13] qemu: ignore assumptions about hotplug requirement when address is from config
Ján Tomko
jtomko at redhat.com
Wed Jun 24 09:00:05 UTC 2015
On Mon, Jun 22, 2015 at 02:44:08PM -0400, Laine Stump wrote:
> Certain PCI buses don't support hotplug, and when automatically
> assigning PCI addresses for devices, libvirt is very concervative in
conservative
> its assumptions about whether or not a device will need to be
> hotplugged/unplugged in the future. But if the user manually assigns
> an address, they likely are aware of any hotplug requirements of the
> device (or at least they should be).
>
> In short, after this patch, automatically PCI address assignment will
> assume that the device must be pluggedin ot a hot-pluggable slot, but
plugged in to
> manually assignment can place the device in any bus that is
> compatible, regardless of whether or not it supports hotplug. If the
> user makes a mistake and plugs the device into a bus that doesn't
> support hotplug, then later tries to do a hot-unplug, qemu will give
> an appropriate error.
>
> (in the future we may want to add a "hotpluggable" attribute to all
> devices, with default being "yes" for autoassign, and "no" for manual
> assign).
> ---
> src/conf/domain_addr.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
> index 93c6043..2be98c5 100644
> --- a/src/conf/domain_addr.c
> +++ b/src/conf/domain_addr.c
> @@ -50,6 +50,12 @@ virDomainPCIAddressFlagsCompatible(virDevicePCIAddressPtr addr,
> */
> if (busFlags & VIR_PCI_CONNECT_TYPES_ENDPOINT)
> busFlags |= VIR_PCI_CONNECT_TYPES_ENDPOINT;
Here, it's the bus that allows plugging both PCI and PCIe devices in.
> + /* Also allow manual specification of bus to override
> + * libvirt's assumptions about whether or not hotplug
> + * capability will be required.
> + */
> + if (devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE)
> + busFlags |= VIR_PCI_CONNECT_HOTPLUGGABLE;
But the bus might not be hotpluggable here. We just don't care
about being able to hotplug the device.
How about:
devFlags ^= VIR_PCI_CONNECT_HOTPLUGGABLE;
ACK either way
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150624/38eb6b5b/attachment-0001.sig>
More information about the libvir-list
mailing list