[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 0/3] xl: Allow PCI devices to be passthrough'd via Qemu command line


  • To: Thierry Escande <thierry.escande@xxxxxxxxxx>
  • From: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Date: Thu, 9 Apr 2026 12:16:41 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Daniel P . Berrangé <berrange@xxxxxxxxxx>
  • Delivery-date: Thu, 09 Apr 2026 10:16:56 +0000
  • Feedback-id: i1568416f:Fastmail
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 08, 2026 at 05:23:39PM +0000, Thierry Escande wrote:
> This series adds support for a new 'hotplug' option for PCI devices to be
> passthrough'd to guests.
> 
> The current mechanism for device passthrough uses QMP device_add command
> to hot-plug PCI devices to the guest Qemu instance. This is an issue for
> guests running on Q35 chipset (preliminary support posted at [1]) since the
> Q35 PCI root bus does not support hotplug. Devices could be hotplugged to
> a secondary PCI bus but Xen only support 1 PCI bus for now.
> 
> The 'hotplug' option allows to control how devices are attached to the
> guest, either by using the legacy QMP mechanism (this is the default) or by
> passing it directly to the Qemu command line using xen-pci-passthrough
> device.
> 
> Example usage in cfg file:
>  pci = [ "00:03.0,seize=1,hotplug=0" ]
> 
> Since Qemu -device option accepts parameters in json format, this
> patchset adds a new internal function libxl__device_pci_get_qmp_json() that
> generates the device json object used for both QMP hotplug and command line
> passing.
> Also, the function libxl_pci_assignable() is made available from libxl.h
> for access in libxl_dm.c. I don't know if it's ok to make it public or if
> it should stay private. Maybe it should be renamed as
> libxl_device_pci_assignable() to match the other PCI device APIs.
> 
> This has been successfully tested on Xen 4.22-dev and Qemu 10.0 running
> Debian VMs in both Bios and UEFI mode with a passthrough'd nvme disk.
> Disabling the hotplug mechanism might be made mandatory for Q35 machines
> later, once Q35 support is merged upstream.

Generally I like the approach, and it looks sensible on the first look.
But CI says it fails to build:
https://gitlab.com/xen-project/people/marmarek/xen/-/pipelines/2439831766

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

Attachment: signature.asc
Description: PGP signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.