From nobody Tue May 5 10:07:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1776955867; cv=none; d=zohomail.com; s=zohoarc; b=GxV+Y/aUXn44NbOEap+kMDvWMja/h8mD2rMs/MsWV7PapCz9/beJtmT6k1vVop+W70z65T5A5utuVo7cXRG2JyD/jW7ro8m2tp+mrcnYGmrr9jCtOsUzn2aqaKwskjE91dybvcrSfCDy+/9RL5Y7PmIzB5dr44uNYesqsYd7lNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776955867; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KBWl2590AHjYullwyX+MHp2jMCGp9Bq1kRreRVpo7Hg=; b=lel6AEKO9ipIt7Vbq2COyqZtj47XMFTcE97FkRYV6WmzQM/oG+duUatWZLPMUU8XDCRR9RCc7+3uagv7lHSOSduElUtReU4ZfUXuakSfz2meGYJMqR5jRfeo6jRaM+JGmGTlWGQMB3Ld4rE618Vr/BvjUGVmskfVthERG27GwJY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776955867844132.49660230192012; Thu, 23 Apr 2026 07:51:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292209.1570733 (Exim 4.92) (envelope-from ) id 1wFvOC-0005dF-7D; Thu, 23 Apr 2026 14:50:48 +0000 Received: by outflank-mailman (output) from mailman id 1292209.1570733; Thu, 23 Apr 2026 14:50:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOC-0005d8-4F; Thu, 23 Apr 2026 14:50:48 +0000 Received: by outflank-mailman (input) for mailman id 1292209; Thu, 23 Apr 2026 14:50:47 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOB-0005d2-2q for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 14:50:47 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFvOA-00BEO4-FK for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:50:46 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea31ab-e002-0a2a0a5209dd-0a2a4509b0ec-30 for ; Thu, 23 Apr 2026 16:50:46 +0200 Received: from [185.255.28.34] (helo=prod-mta-13.swg-srv.net) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea31c6-2497-0a2a45090019-b9ff1c22a40f-3 for ; Thu, 23 Apr 2026 16:50:46 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19dbad2669e000f373.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 23 Apr 2026 14:50:44 +0000 Received: from xps13-debian.gpn.vates.fr (lfbn-mon-1-1130-120.w90-48.abo.wanadoo.fr [90.48.233.120]) (Authenticated sender: thierry.escande) by mail2.vates.fr (Postfix) with ESMTPSA id B8753860B1; Thu, 23 Apr 2026 16:50:43 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=KBWl2590AHjYullwyX+MHp2jMCGp9Bq1kRreRVpo7Hg=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=WV6T6gNn1hnYPsrUiEqoyfOcYYLe4YLq9YH7IiQ0T3gUFOA8uCYDlOzTXzvgPECDmejRAyAjQ 5DVIE++Bg24jVUcdgY/GTjIBOTRMy5mYYvc/XfQoSUhqE4ldCggb1IqHLfX6TmLu3nZLALamwxy DAAMcnuNrxZnWY46LWnYgsU3/KJLDGBeQ1lPdJO41mv1mbsEBlEB8wYJA1iEzgnPmCTIzV6UUvK vqE+Ci8hgKLgyYEUiV4vcMf5p0K8qUd+B7lQA4ybQwHYdVKEAPo8Svs1Wc9n6QAHzOvHyOKgZ+x 5oMk9gCnu4k5VKPf+lJ3OjdodLXhpO2nHGJRuidfrRfw== X-Zone-Loop: 5d4489ed720da88da7d6f913bcc746860a10914d2ca1 x-campaign-type: default x-transaction-id: 948046c6-d1f6-40fb-8274-2ede3dbe1a5e x-swg-uid: 01-d4d72bf3-db56-47c3-ba66-fc4655f3a1ae X-Mailer: Sweego Message-ID: <1776955844.8631fc262581453bbf619ec5b2062170.19dbad2669e000f373@vates.tech> x-swg-bid: 1776955844.8631fc262581453bbf619ec5b2062170.19dbad2669e000f373 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Thierry Escande To: xen-devel@lists.xenproject.org Cc: Thierry Escande , Anthony PERARD , Juergen Gross , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [RFC PATCH v4 1/6] xl: Add an hotplug option for PCI device passthrough Date: Thu, 23 Apr 2026 16:50:26 +0200 In-Reply-To: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> References: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> MIME-Version: 1.0 Content-Transfert-Encoding: 8bit X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.273d.964768495393517d.19dbad26532.9289b73646f62651=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1776955843890 X-purgate-ID: tlsNG-bad1c0/1776955846-416B0A53-F48FF569/0/0 X-purgate-type: clean X-purgate-size: 3610 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1776955869395154100 ---=Part.273d.964768495393517d.19dbad26532.9289b73646f62651=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch adds a boolean option to the PCI device configuration table named hotplug. This will allow to control how devices are attached to the guest, either by using the legacy QMP mechanism (this will be the default) or by passing them directly to the Qemu command line using xen-pci-passthrough device. Sample use in xl.cfg file: pci =3D [ "00:03.0,seize=3D1,hotplug=3D0" ] If not specified, the default behavior is to use hotplug via QMP. This will be needed for Q35 support in guests since the Q35 PCI root bus doesn't support hotplugging and Xen only support 1 PCI bus for now. Signed-off-by: Thierry Escande --- v2: no change v3: no change v4: - Reword commit message --- 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_type= s.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 =3D Struct("device_pci", [ ("seize", bool), ("rdm_policy", libxl_rdm_reserve_policy), ("name", string), + ("hotplug", bool), ]) =20 libxl_device_rdm =3D 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_de= vice_pci *pci, name_present =3D true; pci->name =3D strdup(val); if (!pci->name) ret =3D ERROR_NOMEM; + } else if (!strcmp(key, "hotplug")) { + pci->hotplug =3D atoi(val); } else { XLU__PCI_ERR(cfg, "Unknown PCI_SPEC_STRING option: %s", key); ret =3D 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 =3D 0; int pci_permissive =3D 0; int pci_seize =3D 0; + int pci_hotplug =3D 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 =3D l; =20 + if (!xlu_cfg_get_long (config, "pci_hotplug", &l, 0)) + pci_hotplug =3D 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 =3D pci_power_mgmt; pci->permissive =3D pci_permissive; pci->seize =3D pci_seize; + pci->hotplug =3D pci_hotplug; /* * Like other pci option, the per-device policy always follows * the global policy by default. --=20 2.53.0 --=20 Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.273d.964768495393517d.19dbad26532.9289b73646f62651=--- From nobody Tue May 5 10:07:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1776955874; cv=none; d=zohomail.com; s=zohoarc; b=hvngBCs1K+1ibvypUhnnK6EeX7iZiklYoPjWEb0NapetWa9uBbDrj6jsEGBh5ngUgXYUgJmrRNQAOiuqAdSGdmZGPDD22Ubbe7YNzmSwpMWWGJLK5HdFi5EMM6G/Mc1agkiWMBP0aazB72SwZ9+XX90nw9gGbI9YON6HEDDNXw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776955874; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=M4JVSGAFCQr9BGBfFiKi3POaf5wdzET+5BsITsVx5po=; b=OAoZ05covroZSUKeKma4ZbFtqFxoMuJBgEPebJFy6uzDQcCtrjt9cksnxeLtYYOxLEK1nbdUfX3dfujjgwrIA6gqGqkc94WMSdUp1b7XfPBocY/nyYkzL9Bsakatf1cOPD8x4O0FuMlKc4qJi11NTHn5FtbG9vqtK2NT85SrFT0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 177695587480222.37438335203433; Thu, 23 Apr 2026 07:51:14 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292210.1570742 (Exim 4.92) (envelope-from ) id 1wFvOI-0005rz-F9; Thu, 23 Apr 2026 14:50:54 +0000 Received: by outflank-mailman (output) from mailman id 1292210.1570742; Thu, 23 Apr 2026 14:50:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOI-0005rq-BY; Thu, 23 Apr 2026 14:50:54 +0000 Received: by outflank-mailman (input) for mailman id 1292210; Thu, 23 Apr 2026 14:50:52 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOG-0005r9-Kf for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 14:50:52 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFvOG-00Bbvl-1M for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:50:52 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea31cb-bab6-0a2a0a5309dd-0a2a450bc17a-4 for ; Thu, 23 Apr 2026 16:50:52 +0200 Received: from [185.255.28.34] (helo=prod-mta-13.swg-srv.net) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea31cb-212f-0a2a450b0019-b9ff1c229aa9-3 for ; Thu, 23 Apr 2026 16:50:51 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19dbad2753f000f373.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 23 Apr 2026 14:50:48 +0000 Received: from xps13-debian.gpn.vates.fr (lfbn-mon-1-1130-120.w90-48.abo.wanadoo.fr [90.48.233.120]) (Authenticated sender: thierry.escande) by mail2.vates.fr (Postfix) with ESMTPSA id 80BBC86015; Thu, 23 Apr 2026 16:50:47 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=M4JVSGAFCQr9BGBfFiKi3POaf5wdzET+5BsITsVx5po=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=JqaJMKPNH1YviJrycRVKp5fNbXqNKJjiwyZNJbjd2b8LCfhQJhFwPKaL3cLCsMg/EyhK2JxRF j7zY26MvTbPeCm68d5UEolMWCx8XLdKOX/hOPn64HXivTX5kHVj56AIkVdzo2GF0QaWg9RLdsp4 F2YgRUSLFrUHgUS4zVAclHTZhGi8dULf29EHWn5JhImjd60FDEKpnOse3LRAncVJ8r8FwkpxdLZ 5TAvaN9oCNEkO78Z4y2kEs9vmYltYq0qSCoGivPl4PrDlgxGjJ0sRc/MAz95NRlWWKKz2z5HoAo j/F0kOk2gHsT5ItNzrXcW7RZ4M3VqP7jXsxqdF+9U9Nw== X-Zone-Loop: aaaeb6fda2177d8d3162e1ec5b3b614a674890ebc939 x-campaign-type: default x-transaction-id: fbf8b3c8-c264-4d38-bb08-a34e8c008020 x-swg-uid: 01-1d701107-8de0-4714-af1e-fe5806389a5c X-Mailer: Sweego Message-ID: <1776955848.8631fc262581453bbf619ec5b2062170.19dbad2753f000f373@vates.tech> x-swg-bid: 1776955848.8631fc262581453bbf619ec5b2062170.19dbad2753f000f373 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Thierry Escande To: xen-devel@lists.xenproject.org Cc: Thierry Escande , Anthony PERARD , Juergen Gross , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [RFC PATCH v4 2/6] libxl: Refactor some PCI device handling functions Date: Thu, 23 Apr 2026 16:50:27 +0200 In-Reply-To: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> References: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> MIME-Version: 1.0 Content-Transfert-Encoding: 8bit X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.273e.6a96a3d650ac5123.19dbad273e8.28185d46eb971784=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1776955847657 X-purgate-ID: tlsNG-42698a/1776955852-0415DF3B-4715CB71/0/0 X-purgate-type: clean X-purgate-size: 5517 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1776955877012158500 ---=Part.273e.6a96a3d650ac5123.19dbad273e8.28185d46eb971784=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In order to support the new hotplug=3D0 option for PCI device passthrough, 3 functions used to manage the assignable PCI device list need to be made available from outside of libxl_pci.c. This patch renames the function pciback_dev_is_assigned() as libxl__pciback_dev_is_assigned() and make it available internally. libxl__device_pci_assignable_add() is also exported internally. Finaly, libxl_pci_assignable() is renamed as libxl_device_pci_assignable() to match with other libxl_device_pci_*() APIs and exported in libxl.h. Signed-off-by: Thierry Escande --- v4: new patch --- tools/include/libxl.h | 1 + tools/libs/light/libxl_internal.h | 5 +++++ tools/libs/light/libxl_pci.c | 18 +++++++++--------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tools/include/libxl.h b/tools/include/libxl.h index 7c098edab6..efd2664a90 100644 --- a/tools/include/libxl.h +++ b/tools/include/libxl.h @@ -2666,6 +2666,7 @@ int libxl_device_pci_assignable_add(libxl_ctx *ctx, l= ibxl_device_pci *pci, int r int libxl_device_pci_assignable_remove(libxl_ctx *ctx, libxl_device_pci *p= ci, int rebind); libxl_device_pci *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *nu= m); void libxl_device_pci_assignable_list_free(libxl_device_pci *list, int num= ); +bool libxl_device_pci_assignable(libxl_ctx *ctx, libxl_device_pci *pci); =20 /* CPUID handling */ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* s= tr); diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_int= ernal.h index b65e0064b9..e87500bf55 100644 --- a/tools/libs/light/libxl_internal.h +++ b/tools/libs/light/libxl_internal.h @@ -1729,6 +1729,11 @@ _hidden int libxl__device_pci_setdefault(libxl__gc *= gc, uint32_t domid, libxl_device_pci *pci, bool hotpl= ug); _hidden bool libxl__is_igd_vga_passthru(libxl__gc *gc, const libxl_domain_config *d_confi= g); +_hidden int libxl__pciback_dev_is_assigned(libxl__gc *gc, + libxl_device_pci *pci); +_hidden int libxl__device_pci_assignable_add(libxl__gc *gc, + libxl_device_pci *pci, + int rebind); =20 /* from libxl_dtdev */ =20 diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c index 49d272d0de..5551abe0a2 100644 --- a/tools/libs/light/libxl_pci.c +++ b/tools/libs/light/libxl_pci.c @@ -686,7 +686,7 @@ out: return rc; } =20 -static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pci) +int libxl__pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pci) { char * spath; int rc; @@ -755,9 +755,9 @@ static int pciback_dev_unassign(libxl__gc *gc, libxl_de= vice_pci *pci) return 0; } =20 -static int libxl__device_pci_assignable_add(libxl__gc *gc, - libxl_device_pci *pci, - int rebind) +int libxl__device_pci_assignable_add(libxl__gc *gc, + libxl_device_pci *pci, + int rebind) { libxl_ctx *ctx =3D libxl__gc_owner(gc); unsigned dom, bus, dev, func; @@ -798,7 +798,7 @@ static int libxl__device_pci_assignable_add(libxl__gc *= gc, } =20 /* Check to see if it's already assigned to pciback */ - rc =3D pciback_dev_is_assigned(gc, pci); + rc =3D libxl__pciback_dev_is_assigned(gc, pci); if ( rc < 0 ) { return ERROR_FAIL; } @@ -913,7 +913,7 @@ static int libxl__device_pci_assignable_remove(libxl__g= c *gc, } =20 /* Unbind from pciback */ - if ( (rc =3D pciback_dev_is_assigned(gc, pci)) < 0 ) { + if ( (rc =3D libxl__pciback_dev_is_assigned(gc, pci)) < 0 ) { return ERROR_FAIL; } else if ( rc ) { pciback_dev_unassign(gc, pci); @@ -1509,7 +1509,7 @@ int libxl_device_pci_add(libxl_ctx *ctx, uint32_t dom= id, return AO_INPROGRESS; } =20 -static bool libxl_pci_assignable(libxl_ctx *ctx, libxl_device_pci *pci) +bool libxl_device_pci_assignable(libxl_ctx *ctx, libxl_device_pci *pci) { libxl_device_pci *pcis; int num; @@ -1572,13 +1572,13 @@ void libxl__device_pci_add(libxl__egc *egc, uint32_= t domid, rc =3D libxl__device_pci_setdefault(gc, domid, pci, !starting); if (rc) goto out; =20 - if (pci->seize && !pciback_dev_is_assigned(gc, pci)) { + if (pci->seize && !libxl__pciback_dev_is_assigned(gc, pci)) { rc =3D libxl__device_pci_assignable_add(gc, pci, 1); if ( rc ) goto out; } =20 - if (!libxl_pci_assignable(ctx, pci)) { + if (!libxl_device_pci_assignable(ctx, pci)) { LOGD(ERROR, domid, "PCI device %x:%x:%x.%x is not assignable", pci->domain, pci->bus, pci->dev, pci->func); rc =3D ERROR_FAIL; --=20 2.53.0 --=20 Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.273e.6a96a3d650ac5123.19dbad273e8.28185d46eb971784=--- From nobody Tue May 5 10:07:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1776955879; cv=none; d=zohomail.com; s=zohoarc; b=b9XXpwH1DdKpmZ+qiZ7MwWR5bMHj0WuJL2kOiHfGMt+iFFpYbhwobsjPFrCtpm/7YTkmMc5mZ91IJ8nHnrVQ3zDyD4Q35l4vNOz+qC9PvUy7I8gbcxcXChWow8HGJTkv6NEOcflkZ1ZeiJoCmq9o2ts1JH2iMLr4e9dmpuLGnUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776955879; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KwW4d6fYi0KChvPkn7IffskRpGMBiOLh4S1NpTCLRGk=; b=VLTByPuWbcxy/RxBjZcqTgZiwwFUCvR51wm3v1G/5Hos34crJo/L2O+a4Lmkd9tayG8pOwW73XERcnGBTmEWP/ZXmK0N21ynLA7FQYAEl997A1JuhoXQKAtJOMt80hxicoLmsSTGuHmYIMY20OrszsnXJ0kCbHKI+DFDSHomfbM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776955878967415.2254421623146; Thu, 23 Apr 2026 07:51:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292211.1570750 (Exim 4.92) (envelope-from ) id 1wFvON-00069G-Lz; Thu, 23 Apr 2026 14:50:59 +0000 Received: by outflank-mailman (output) from mailman id 1292211.1570750; Thu, 23 Apr 2026 14:50:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvON-000697-JC; Thu, 23 Apr 2026 14:50:59 +0000 Received: by outflank-mailman (input) for mailman id 1292211; Thu, 23 Apr 2026 14:50:58 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOM-00068A-DI for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 14:50:58 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFvOL-00F6TN-QG for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:50:57 +0200 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea31c9-5cb7-0a2a0a5109dd-0a2a450ab676-14 for ; Thu, 23 Apr 2026 16:50:57 +0200 Received: from [185.255.28.34] (helo=prod-mta-13.swg-srv.net) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea31d1-56b3-0a2a450a0019-b9ff1c2297ab-3 for ; Thu, 23 Apr 2026 16:50:57 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19dbad285c5000f373.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 23 Apr 2026 14:50:52 +0000 Received: from xps13-debian.gpn.vates.fr (lfbn-mon-1-1130-120.w90-48.abo.wanadoo.fr [90.48.233.120]) (Authenticated sender: thierry.escande) by mail2.vates.fr (Postfix) with ESMTPSA id B477A860B1; Thu, 23 Apr 2026 16:50:51 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=KwW4d6fYi0KChvPkn7IffskRpGMBiOLh4S1NpTCLRGk=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=HE2coy3cU39TschWJRYdYq8wFbpLpp7h7EjePCUoWR0rV4oUOEoTjHY1F1hLx3ZX0I+TrptgP XA0G66L6CEBkO+Q1+Y0G6Ong8tZjL4GIBC97sd2Lrg8J0rPC/LXZtgBl0S8n9YDK9IMU3VEwPO9 IG38nZWhW7OPBEwspGaKDcvTvj4PN02VOoNzMTq63ftvcs33D3u2MdAzAIGJOVY1lU8hSre4PAd TrziJSI8psId/HM8NyUYBY9Zw1smMaGAxuwFDED7Q4fHh0ua9FeAm58JkoFn+N/btW7BZb4wXfx yYkAqQ9X/JrZB53lB7GYo1k5x5CTgm+g7p1xsa89I/RQ== X-Zone-Loop: 0eb424bdcabf1d73c22e5a825d30e8e81a2beb9141bf x-campaign-type: default x-transaction-id: ad9a1c9a-cb6a-4453-b392-fd440a969e31 x-swg-uid: 01-527627f9-4b39-4f05-b98a-58bfae657f9f X-Mailer: Sweego Message-ID: <1776955852.8631fc262581453bbf619ec5b2062170.19dbad285c5000f373@vates.tech> x-swg-bid: 1776955852.8631fc262581453bbf619ec5b2062170.19dbad285c5000f373 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Thierry Escande To: xen-devel@lists.xenproject.org Cc: Thierry Escande , Anthony PERARD , Juergen Gross , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [RFC PATCH v4 3/6] libxl: Add libxl__device_pci_get_qapi_json() internal API Date: Thu, 23 Apr 2026 16:50:28 +0200 In-Reply-To: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> References: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> MIME-Version: 1.0 Content-Transfert-Encoding: 8bit X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.273f.2e8038414fb5c485.19dbad2845c.4007b31644528610=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1776955851868 X-purgate-ID: tlsNG-4011c0/1776955857-8127B8B7-A442E7B6/0/0 X-purgate-type: clean X-purgate-size: 3366 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1776955880889158500 ---=Part.273f.2e8038414fb5c485.19dbad2845c.4007b31644528610=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This function generates the qapi json object for a PCI device to be passthrough'd to a guest. With the new option hotplug=3D0 for PCI passthrough, device parameters will be passed using Qemu -device command line option. Since -device accepts qapi json string, this new function will be used to do so. The code that generates the json object comes from pci_add_qmp_device_add() which now also uses this new function. Signed-off-by: Thierry Escande --- v4: new patch --- tools/libs/light/libxl_internal.h | 2 ++ tools/libs/light/libxl_pci.c | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_int= ernal.h index e87500bf55..b6d764ad00 100644 --- a/tools/libs/light/libxl_internal.h +++ b/tools/libs/light/libxl_internal.h @@ -1734,6 +1734,8 @@ _hidden int libxl__pciback_dev_is_assigned(libxl__gc = *gc, _hidden int libxl__device_pci_assignable_add(libxl__gc *gc, libxl_device_pci *pci, int rebind); +_hidden libxl__json_object *libxl__device_pci_get_qapi_json(libxl__gc *gc, + libxl_device_pci = *pci); =20 /* from libxl_dtdev */ =20 diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c index 5551abe0a2..5004ca47d9 100644 --- a/tools/libs/light/libxl_pci.c +++ b/tools/libs/light/libxl_pci.c @@ -1098,16 +1098,10 @@ out: pci_add_dm_done(egc, pas, rc); /* must be last */ } =20 -static void pci_add_qmp_device_add(libxl__egc *egc, pci_add_state *pas) +libxl__json_object *libxl__device_pci_get_qapi_json(libxl__gc *gc, + libxl_device_pci *pci) { - STATE_AO_GC(pas->aodev->ao); libxl__json_object *args =3D NULL; - int rc; - - /* Convenience aliases */ - libxl_domid domid =3D pas->domid; - libxl_device_pci *pci =3D &pas->pci; - libxl__ev_qmp *const qmp =3D &pas->qmp; =20 libxl__qmp_param_add_string(gc, &args, "driver", "xen-pci-passthrough"); @@ -1134,6 +1128,22 @@ static void pci_add_qmp_device_add(libxl__egc *egc, = pci_add_state *pas) if (pci->permissive) libxl__qmp_param_add_bool(gc, &args, "permissive", true); =20 + return args; +} + +static void pci_add_qmp_device_add(libxl__egc *egc, pci_add_state *pas) +{ + STATE_AO_GC(pas->aodev->ao); + libxl__json_object *args =3D NULL; + int rc =3D 0; + + /* Convenience aliases */ + libxl_domid domid =3D pas->domid; + libxl_device_pci *pci =3D &pas->pci; + libxl__ev_qmp *const qmp =3D &pas->qmp; + + args =3D libxl__device_pci_get_qapi_json(gc, pci); + qmp->ao =3D pas->aodev->ao; qmp->domid =3D domid; qmp->payload_fd =3D -1; --=20 2.53.0 --=20 Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.273f.2e8038414fb5c485.19dbad2845c.4007b31644528610=--- From nobody Tue May 5 10:07:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1776955880; cv=none; d=zohomail.com; s=zohoarc; b=HhwlNsMvxi5mPhLj4lsz8sRmnWAecDooVIyE84uMli6PPco6E3ao3sRXQTOihut5eRK1r9qBXZuvB/q6/bmQpat8+4xPWMcqkKNWR7lIfnTDbaJSHXslvcu1a6vv8Hj1/RDSEOrZ5p+j8n6zhDChHLzxwKQ1O8UpKiQ98lc0fuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776955880; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2WxqC/7NDyEsVp5x99Nl9oXXPdTNIp1S8YTZI5ZJbF8=; b=UFMp6sXf1jr3iRLHtyEABM5o6JSM6zIzfZZnNCaanJ5AMBLSADsUak/2QTs8jAI7L9MTEZShp22ssKqokLncVE/Nd5m5gqGiNjB5abiTcjOn9zcvKsMye6R2vONp1Sm9mq1TqLg+nAXKu5uMOHeGCVETyAf6DQcf5mmJLy25AFE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776955880781450.7841323829359; Thu, 23 Apr 2026 07:51:20 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292212.1570757 (Exim 4.92) (envelope-from ) id 1wFvOO-0006C1-3C; Thu, 23 Apr 2026 14:51:00 +0000 Received: by outflank-mailman (output) from mailman id 1292212.1570757; Thu, 23 Apr 2026 14:51:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvON-0006B6-Qi; Thu, 23 Apr 2026 14:50:59 +0000 Received: by outflank-mailman (input) for mailman id 1292212; Thu, 23 Apr 2026 14:50:58 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOM-00068B-Hv for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 14:50:58 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFvOL-00F6TN-Uw for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:50:57 +0200 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea31c9-5cb7-0a2a0a5109dd-0a2a450ab676-16 for ; Thu, 23 Apr 2026 16:50:57 +0200 Received: from [185.255.28.34] (helo=prod-mta-13.swg-srv.net) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea31d1-56b3-0a2a450a0019-b9ff1c2297ab-4 for ; Thu, 23 Apr 2026 16:50:57 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19dbad29220000f373.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 23 Apr 2026 14:50:55 +0000 Received: from xps13-debian.gpn.vates.fr (lfbn-mon-1-1130-120.w90-48.abo.wanadoo.fr [90.48.233.120]) (Authenticated sender: thierry.escande) by mail2.vates.fr (Postfix) with ESMTPSA id E0F3F860B1; Thu, 23 Apr 2026 16:50:54 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=2WxqC/7NDyEsVp5x99Nl9oXXPdTNIp1S8YTZI5ZJbF8=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=D3uTwvshadj9pwDd0Op//RUzAJcG+WoCNd+Sit8erp2UzsFQgxFdHHfThbm577EH4kPTbYYX4 wMx/7MWUvZjK0wcb2ZWmM4y2EDp4HYnBXS9vDd0P3qq7Lrlqt5dpLdtbTGyCAYMRSPiuOmh9wF+ JpsvJZHHqkXhfKnGWvCFCWL2krhzjTbFnbjDGgvP7VTxw/wyu7LoQjq585J18LW7Qdpup/NBZgH RkQFWjHADnEapKUATTb0EtfpjgNNNTedUG/KZxRmvIJUheflsnypFJbN7n836quWNiVqlACaY94 eFxxR3B5lRNJBfpTAJkSvphRlw+AY82UjYMuEYJAaooA== X-Zone-Loop: c7871ee5573226db0411b0d5c46a7216be9db6eec7aa x-campaign-type: default x-transaction-id: 38361317-4f1f-42b1-9ee4-7288d10deb3c x-swg-uid: 01-523f3e71-0f87-4311-ad55-fa29c2f674b1 X-Mailer: Sweego Message-ID: <1776955855.8631fc262581453bbf619ec5b2062170.19dbad29220000f373@vates.tech> x-swg-bid: 1776955855.8631fc262581453bbf619ec5b2062170.19dbad29220000f373 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Thierry Escande To: xen-devel@lists.xenproject.org Cc: Thierry Escande , Anthony PERARD , Juergen Gross , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [RFC PATCH v4 4/6] libxl: Extend libxl__json_object_to_json() prototype Date: Thu, 23 Apr 2026 16:50:29 +0200 In-Reply-To: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> References: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> MIME-Version: 1.0 Content-Transfert-Encoding: 8bit X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.2740.c5deada9ef7a8812.19dbad290c4.414c53236d9cbe01=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1776955855045 X-purgate-ID: tlsNG-4011c0/1776955857-46D708B7-FA9CBAE9/0/0 X-purgate-type: clean X-purgate-size: 3323 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1776955883258154100 ---=Part.2740.c5deada9ef7a8812.19dbad290c4.414c53236d9cbe01=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The function libxl__json_object_to_json() returns a json object as string in a pretty format. With support for the new PCI device passthrough option hotplug=3D0, the function will be used to generate the json string passed to qemu -device command line parameter, but the string needs to be in plain format, i.e. without carriage return or tab characters. This patch adds a 'pretty' parameter to the function to control the output string format. Signed-off-by: Thierry Escande --- v4: new patch --- tools/libs/light/libxl_internal.h | 5 +++-- tools/libs/light/libxl_json.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_int= ernal.h index b6d764ad00..b87959e44a 100644 --- a/tools/libs/light/libxl_internal.h +++ b/tools/libs/light/libxl_internal.h @@ -2270,10 +2270,11 @@ _hidden libxl__json_object *libxl__json_parse(libxl= __gc *gc_opt, const char *s); =20 /* `args` may be NULL */ _hidden char *libxl__json_object_to_json(libxl__gc *gc, - const libxl__json_object *args); + const libxl__json_object *args, + bool pretty); /* Always return a valid string, but invalid json on error. */ #define JSON(o) \ - (libxl__json_object_to_json(gc, (o)) ? : "") + (libxl__json_object_to_json(gc, (o), true) ? : "") =20 /* Based on /local/domain/$domid/dm-version xenstore key */ _hidden int libxl__device_model_version_running(libxl__gc *gc, uint32_t do= mid); diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c index 68f36901c2..c566ec83ff 100644 --- a/tools/libs/light/libxl_json.c +++ b/tools/libs/light/libxl_json.c @@ -1527,7 +1527,8 @@ out: #endif =20 char *libxl__json_object_to_json(libxl__gc *gc, - const libxl__json_object *args) + const libxl__json_object *args, + bool pretty) { #ifdef HAVE_LIBJSONC const char *buf; @@ -1542,7 +1543,9 @@ char *libxl__json_object_to_json(libxl__gc *gc, if (rc) goto out; =20 - buf =3D json_object_to_json_string_ext(root, JSON_C_TO_STRING_PRETTY); + buf =3D json_object_to_json_string_ext(root, pretty ? + JSON_C_TO_STRING_PRETTY : + JSON_C_TO_STRING_PLAIN); if (!buf) goto out; =20 @@ -1566,6 +1569,10 @@ out: if (!hand) return NULL; =20 +#if HAVE_YAJL_V2 + yajl_gen_config(hand, yajl_gen_beautify, pretty); +#endif + rc =3D libxl__json_object_to_yajl_gen(gc, hand, args); if (rc) goto out; --=20 2.53.0 --=20 Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.2740.c5deada9ef7a8812.19dbad290c4.414c53236d9cbe01=--- From nobody Tue May 5 10:07:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1776955883; cv=none; d=zohomail.com; s=zohoarc; b=Lbxv2dNPRbB0iHuzERKb9iIcc9oqMrkZe9RCBuMilSO3LjBVGTVxMfROkQS42pjibJTv0U6/Za6Xvh96Bzw8EimcS/s7/pEEl9tvDpmbZSCLycZOiGJsjDoVQmDptuk+YBMgmaxONExz0uvgdU2YupIQbqbuRDaHNJsWIGdiVgg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776955883; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z1+eytwSMTKXppL/bkeDgKPsP7+rKwCxiKHDiZ0OLRs=; b=LzaN//LFI/7cGg/aN+bBhmK6rA5e5cOxbbyKaUCIKUAx+9mOSrpcRaIEV8c/bQFZVjK8NsP/OUehMNUCYArHeK1r1l72dK1px9FIaHJeMMj+mMYiwEaKkG4GHmSIoCY2qEOoJI8OOOiIgTcwY0X8Pxzr8ztG8wk3wMMNPC4/SqY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776955883213243.33518981262466; Thu, 23 Apr 2026 07:51:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292216.1570769 (Exim 4.92) (envelope-from ) id 1wFvOT-0006ie-Cq; Thu, 23 Apr 2026 14:51:05 +0000 Received: by outflank-mailman (output) from mailman id 1292216.1570769; Thu, 23 Apr 2026 14:51:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOT-0006iX-8H; Thu, 23 Apr 2026 14:51:05 +0000 Received: by outflank-mailman (input) for mailman id 1292216; Thu, 23 Apr 2026 14:51:04 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOS-0006gd-K9 for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 14:51:04 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFvOS-00F6TN-0q for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:51:04 +0200 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea31cb-5cb7-0a2a0a5109dd-0a2a4507892a-38 for ; Thu, 23 Apr 2026 16:51:04 +0200 Received: from [185.255.28.34] (helo=prod-mta-13.swg-srv.net) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea31d7-229c-0a2a45070019-b9ff1c2288dd-3 for ; Thu, 23 Apr 2026 16:51:03 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19dbad2a232000f373.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 23 Apr 2026 14:50:59 +0000 Received: from xps13-debian.gpn.vates.fr (lfbn-mon-1-1130-120.w90-48.abo.wanadoo.fr [90.48.233.120]) (Authenticated sender: thierry.escande) by mail2.vates.fr (Postfix) with ESMTPSA id 049C786015; Thu, 23 Apr 2026 16:50:59 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=Z1+eytwSMTKXppL/bkeDgKPsP7+rKwCxiKHDiZ0OLRs=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=alK7gqYGRD+HqkxLviBMDg+XTAToMGJ0ZzJFEK03pnOlIpiM5UyHAYHjDYW4SXKwBvTN9Yodn uGnH11u28ynt9a4jAwuuD5cYd0gxwkwjoeyYvJ+ybEeUyPJcEFqOtcVvBZ0wa3GH6RhBul/6dMR CkHF0y0tj/9HTvvsgNzALNXc0UFYIaZ+tIWpVUXPnDCcLnvr4qsLE89V4n8iEiWAWVpRuDECOab YzZOXYiBVFIvBsa4DfoAy94d+0nvssebwUoupPDPt/Yh2Rs8X81+X4J6G8LEDtcB01P780VLw0Q zROQ3+Od2J3hCHe0CYci2M5p3qxI6dQAacq7PvtgZCMg== X-Zone-Loop: 6538666f2d8b81dc348812ba600f25a9bba8957c5f5e x-campaign-type: default x-transaction-id: f53b331b-f1f9-4a35-91a8-33d1289c8542 x-swg-uid: 01-c33a206f-094b-4b05-a72d-b019a2809139 X-Mailer: Sweego Message-ID: <1776955859.8631fc262581453bbf619ec5b2062170.19dbad2a232000f373@vates.tech> x-swg-bid: 1776955859.8631fc262581453bbf619ec5b2062170.19dbad2a232000f373 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Thierry Escande To: xen-devel@lists.xenproject.org Cc: Thierry Escande , Anthony PERARD , Juergen Gross , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [RFC PATCH v4 5/6] libxl: Allow PCI device passthrough using -device Qemu command line Date: Thu, 23 Apr 2026 16:50:30 +0200 In-Reply-To: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> References: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> MIME-Version: 1.0 Content-Transfert-Encoding: 8bit X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.2741.19abcf34cab5d289.19dbad2a0c7.3e37f28d3be2e66=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1776955859143 X-purgate-ID: tlsNG-ef75cf/1776955863-AE36CC48-15548791/0/0 X-purgate-type: clean X-purgate-size: 5173 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1776955884818158500 ---=Part.2741.19abcf34cab5d289.19dbad2a0c7.3e37f28d3be2e66=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This change makes use of the new option 'hotplug' for host PCI devices passthrough'd to the guest. If hotplug=3D0 is used in the pci device configuration table, the device will be attached to the guest using the Qemu command line as '-device xen-pci-passthrough,hostaddr=3D...' The host device configuration is passed to the -device option as a json array, just like it's done for hotplug using QMP. The json array is created by using libxl__device_pci_get_qapi_json() introduced by the previous patch. Then, instead of sending the 'device_add' command, the device_add callback is called to perform the 'query-pci' check to make sure the passthrough'd device is present. In the same way at shutdown, the device is not removed using QMP and only the pci_remove_done() function is called. As with QMP, the use of the 'hotplug=3D0' option honors the 'seize' option by adding the PCI device to the assignable list if needed. This mimics what is done in libxl__device_pci_add() with regards to seize option and the assignable PCI device list. This allows to display a proper error message if the device is not assignable before Qemu starts. Signed-off-by: Thierry Escande --- Changes in v2: - Add support for YAJL json parser Changes in v3: - Move code block for device command line parameters creation to a correct place. - Better handling of PCI device assignation check to display the correct error message if the device is not assignable. Changes in v4: - Move function refactoring parts into their own patches - Use libxl__json_object_to_json() that can now return plain json strings --- tools/libs/light/libxl_dm.c | 33 +++++++++++++++++++++++++++++++++ tools/libs/light/libxl_pci.c | 13 ++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index 511ec76a65..fb0aeea640 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -1798,6 +1798,39 @@ static int libxl__build_device_model_args_new(libxl_= _gc *gc, break; } =20 + if (guest_config->num_pcidevs) { + libxl_device_pci *pci; + libxl__json_object *qmp_json; + char *json_str; + + for (i =3D 0; i < guest_config->num_pcidevs; i++) { + pci =3D &guest_config->pcidevs[i]; + + if (pci->hotplug) + continue; + + if (pci->seize && !libxl__pciback_dev_is_assigned(gc, pci)= ) { + rc =3D libxl__device_pci_assignable_add(gc, pci, 1); + if (rc) + return rc; + } + + if (!libxl_device_pci_assignable(libxl__gc_owner(gc), pci)= ) { + LOGD(ERROR, guest_domid, "PCI device %x:%x:%x.%x is no= t assignable", + pci->domain, pci->bus, pci->dev, pci->func); + return ERROR_FAIL; + } + + qmp_json =3D libxl__device_pci_get_qapi_json(gc, pci); + + json_str =3D libxl__json_object_to_json(gc, qmp_json, fals= e); + if (!json_str) + return ERROR_NOMEM; + + flexarray_vappend(dm_args, "-device", json_str, NULL); + } + } + if (state->dm_runas) { if (qemu_opts->have_runwith_user) { flexarray_append_pair(dm_args, "-run-with", diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c index 5004ca47d9..f5216f6b33 100644 --- a/tools/libs/light/libxl_pci.c +++ b/tools/libs/light/libxl_pci.c @@ -1148,7 +1148,10 @@ static void pci_add_qmp_device_add(libxl__egc *egc, = pci_add_state *pas) qmp->domid =3D domid; qmp->payload_fd =3D -1; qmp->callback =3D pci_add_qmp_device_add_cb; - rc =3D libxl__ev_qmp_send(egc, qmp, "device_add", args); + if (pci->hotplug) + rc =3D libxl__ev_qmp_send(egc, qmp, "device_add", args); + else + pci_add_qmp_device_add_cb(egc, qmp, NULL, 0); if (rc) goto out; return; =20 @@ -1830,6 +1833,14 @@ static void do_pci_remove(libxl__egc *egc, pci_remov= e_state *prs) libxl_domain_type type =3D libxl__domain_type(gc, domid); libxl_device_pci *pci =3D &prs->pci; int rc, num; + + /* Passthrough'd device has been passed to Qemu command line so there = is + * no need to remove it via QMP */ + if (!pci->hotplug) { + pci_remove_done(egc, prs, 0); + return; + } + pcis =3D libxl_device_pci_list(ctx, domid, &num); if (!pcis) { rc =3D ERROR_FAIL; --=20 2.53.0 --=20 Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.2741.19abcf34cab5d289.19dbad2a0c7.3e37f28d3be2e66=--- From nobody Tue May 5 10:07:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1776955891; cv=none; d=zohomail.com; s=zohoarc; b=ju16ddI3cPrHDGa6KXQydNbewvyZwuV0Ni4c0m6zLwjYvEM7JyMyhhA2FcfBKlW7TNAuxwfeRvWuX9QtoCPDkkU25rNH0hI6dt+IeY6ffoUb/oCGvfxBnHaiyDXH+TbYS5KINRELATcABNOVw6gufpdJ0IlzX/GIMV46hOHhAgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1776955891; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ekNR1/eBd9VQKAzJYZOyOmAkA2MA78ZmCGizisZKN0M=; b=l+N1nV4zoQfbugUo9+5XsXy9me5SuzIbHH5b87+TVMYIur/Wzohk9KUYD4FKM/+hmLjSgvMkDtnI0aiMj2tLfmJV2lVJCgkiKaUW1fnkLscavYhcUQ6buk6Qivbh0pdq8JlrI7UQuBYWBLXu7FrjJ+dWojakPlpNnUGpQOshTNs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1776955891598228.64483286500786; Thu, 23 Apr 2026 07:51:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1292217.1570774 (Exim 4.92) (envelope-from ) id 1wFvOT-0006mY-PS; Thu, 23 Apr 2026 14:51:05 +0000 Received: by outflank-mailman (output) from mailman id 1292217.1570774; Thu, 23 Apr 2026 14:51:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOT-0006m0-JN; Thu, 23 Apr 2026 14:51:05 +0000 Received: by outflank-mailman (input) for mailman id 1292217; Thu, 23 Apr 2026 14:51:04 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wFvOS-0006hX-Rn for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 14:51:04 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wFvOS-00F6TN-8O for xen-devel@lists.xenproject.org; Thu, 23 Apr 2026 16:51:04 +0200 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ea31cb-5cb7-0a2a0a5109dd-0a2a4507892a-40 for ; Thu, 23 Apr 2026 16:51:04 +0200 Received: from [185.255.28.34] (helo=prod-mta-13.swg-srv.net) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 69ea31d7-229c-0a2a45070019-b9ff1c2288dd-4 for ; Thu, 23 Apr 2026 16:51:04 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19dbad2afcd000f373.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 23 Apr 2026 14:51:02 +0000 Received: from xps13-debian.gpn.vates.fr (lfbn-mon-1-1130-120.w90-48.abo.wanadoo.fr [90.48.233.120]) (Authenticated sender: thierry.escande) by mail2.vates.fr (Postfix) with ESMTPSA id 7FAD287363; Thu, 23 Apr 2026 16:51:02 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=ekNR1/eBd9VQKAzJYZOyOmAkA2MA78ZmCGizisZKN0M=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=C3PVivYSKPbRBKJNckmf7OY89A4QHKYhJKt8lwoqIB0Ut8UDzwOR2MYKSjCMx4Uz5C7vJ48NG RNfewvskrxW+RavVx0H7fBBIRiXzhL/JApXOk8rSWUGrCrB7FnMnbCADFfU1QkKrAl4sP8hszA/ 0BVQD1ZIZwTKit5DtsAIZH6bvpsoDyjSA6kDJEg5+WopJqDbIqUtGYxMbOT8QFZbD1WG+ZOG0Gy tJxMTSlOfPss5N7XcpQqkscmsY7ZU4EweXK6/0z48mM4Memu5gjXuRQDZ+QIOyhcghtbucLtzQ4 4jKOj9BK7EfJbQ+BgPUzh+NrXmM1S0by22zR9HwXYmyw== X-Zone-Loop: da510dc4bdea08aa68329b8112877095630cd5904ffc x-campaign-type: default x-transaction-id: 2fcc7fec-678c-437b-9538-7259920244f3 x-swg-uid: 01-82fc978a-d581-44e4-9ea4-7620336eb78e X-Mailer: Sweego Message-ID: <1776955863.8631fc262581453bbf619ec5b2062170.19dbad2afcd000f373@vates.tech> x-swg-bid: 1776955863.8631fc262581453bbf619ec5b2062170.19dbad2afcd000f373 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Thierry Escande To: xen-devel@lists.xenproject.org Cc: Thierry Escande , Anthony PERARD , Juergen Gross , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [RFC PATCH v4 6/6] docs: provide description for pci hotplug option Date: Thu, 23 Apr 2026 16:50:31 +0200 In-Reply-To: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> References: <1776955586.8631fc262581453bbf619ec5b2062170.19dbace7684000f373@vates.tech> MIME-Version: 1.0 Content-Transfert-Encoding: 8bit X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.2742.424e6f0f84fb42ae.19dbad2ae7d.85e0adc7420a1022=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1776955862653 X-purgate-ID: tlsNG-ef75cf/1776955864-AD165C48-992AB3EE/0/0 X-purgate-type: clean X-purgate-size: 2304 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1776955893414154100 ---=Part.2742.424e6f0f84fb42ae.19dbad2ae7d.85e0adc7420a1022=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch adds description for the 'hotplug' PCI option, allowing devices to be attached to the guest using the legacy QMP hotplug mechanism or by passing them to the Qemu command line using '-device'. Signed-off-by: Thierry Escande --- v2: no change v3: no change v4: no change --- docs/man/xl-pci-configuration.5.pod | 17 +++++++++++++++++ docs/man/xl.cfg.5.pod.in | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/docs/man/xl-pci-configuration.5.pod b/docs/man/xl-pci-configur= ation.5.pod index 0691f06ad3..8b664173cb 100644 --- a/docs/man/xl-pci-configuration.5.pod +++ b/docs/man/xl-pci-configuration.5.pod @@ -166,6 +166,23 @@ dom0 without confirmation. Please use with care. =20 =3Dback =20 +=3Ditem B=3DI + +=3Dover 4 + +=3Ditem Description + +Tells L to use QMP hotplug mechanism to attach assignable device to +the guest, or to pass it via Qemu command line using +'B<-device xen-pci-passthrough,...>'. The default is to use the legacy QMP +mechanism. + +=3Ditem Default Value + +1 + +=3Dback + =3Ditem B=3DI =20 =3Dover 4 diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index 2f77016ecf..09f59f9b9c 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -1236,6 +1236,12 @@ B<(HVM only)> Changes the default value of B for all PCI devices passed through to this VM. See B above. =20 +=3Ditem B + +B<(HVM only)> Changes the default value of B for all PCI +devices passed through to this VM. See L for +more details. + =3Ditem B =20 Enable graphics device PCI passthrough. This option makes an assigned --=20 2.53.0 --=20 Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.2742.424e6f0f84fb42ae.19dbad2ae7d.85e0adc7420a1022=---