From: "Thierry Escande" <thierry.escande@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: "Thierry Escande" <thierry.escande@vates.tech>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Juergen Gross" <jgross@suse.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Subject: [RFC PATCH v2 1/3] xl: Add pci device hotplug option
Date: Thu, 09 Apr 2026 16:21:03 +0000 [thread overview]
Message-ID: <20260409162000.1102680-2-thierry.escande@vates.tech> (raw)
In-Reply-To: <20260409162000.1102680-1-thierry.escande@vates.tech>
This option is used to passthrough PCI devices using the Qemu command
line (-device driver,...) instead of the QMP hot-plug mechanism.
This is needed for Q35 support since its PCI root bus doesn't support
hotplugging.
If not specified, the default behavior is to use hotplug via QMP.
Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
---
v2: no change
---
tools/libs/light/libxl_types.idl | 1 +
tools/libs/util/libxlu_pci.c | 2 ++
tools/xl/xl_parse.c | 5 +++++
3 files changed, 8 insertions(+)
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index a7893460f0..aca0e93793 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -922,6 +922,7 @@ libxl_device_pci = Struct("device_pci", [
("seize", bool),
("rdm_policy", libxl_rdm_reserve_policy),
("name", string),
+ ("hotplug", bool),
])
libxl_device_rdm = Struct("device_rdm", [
diff --git a/tools/libs/util/libxlu_pci.c b/tools/libs/util/libxlu_pci.c
index 294482c6d7..f6440c878b 100644
--- a/tools/libs/util/libxlu_pci.c
+++ b/tools/libs/util/libxlu_pci.c
@@ -192,6 +192,8 @@ int xlu_pci_parse_spec_string(XLU_Config *cfg, libxl_device_pci *pci,
name_present = true;
pci->name = strdup(val);
if (!pci->name) ret = ERROR_NOMEM;
+ } else if (!strcmp(key, "hotplug")) {
+ pci->hotplug = atoi(val);
} else {
XLU__PCI_ERR(cfg, "Unknown PCI_SPEC_STRING option: %s", key);
ret = ERROR_INVAL;
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 48c72dce9c..7ea2a76662 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -1361,6 +1361,7 @@ void parse_config_data(const char *config_source,
int pci_msitranslate = 0;
int pci_permissive = 0;
int pci_seize = 0;
+ int pci_hotplug = 1;
int i, e;
int num_llc_colors;
int num_xs_quota;
@@ -1699,6 +1700,9 @@ void parse_config_data(const char *config_source,
if (!xlu_cfg_get_long (config, "pci_seize", &l, 0))
pci_seize = l;
+ if (!xlu_cfg_get_long (config, "pci_hotplug", &l, 0))
+ pci_hotplug = l;
+
if (!xlu_cfg_get_string(config, "rdm", &buf, 0)) {
libxl_rdm_reserve rdm;
if (!xlu_rdm_parse(config, &rdm, buf)) {
@@ -1720,6 +1724,7 @@ void parse_config_data(const char *config_source,
pci->power_mgmt = pci_power_mgmt;
pci->permissive = pci_permissive;
pci->seize = pci_seize;
+ pci->hotplug = pci_hotplug;
/*
* Like other pci option, the per-device policy always follows
* the global policy by default.
--
2.53.0
--
Thierry Escande | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
next prev parent reply other threads:[~2026-04-09 16:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 16:20 [RFC PATCH v2 0/3] xl: Allow PCI devices to be passthrough'd via Qemu command line Thierry Escande
2026-04-09 16:21 ` Thierry Escande [this message]
2026-04-09 16:21 ` [RFC PATCH v2 2/3] libxl: Allow PCI device passthrough using -device " Thierry Escande
2026-04-09 16:21 ` [RFC PATCH v2 3/3] docs: provide description for pci hotplug option Thierry Escande
2026-04-10 0:55 ` [RFC PATCH v2 0/3] xl: Allow PCI devices to be passthrough'd via Qemu command line Marek Marczykowski-Górecki
2026-04-10 8:16 ` Thierry Escande
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260409162000.1102680-2-thierry.escande@vates.tech \
--to=thierry.escande@vates.tech \
--cc=anthony.perard@vates.tech \
--cc=berrange@redhat.com \
--cc=jgross@suse.com \
--cc=marmarek@invisiblethingslab.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.