From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 872491FF13F for ; Wed, 14 Jan 2026 16:51:15 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CFD89170DF; Wed, 14 Jan 2026 16:51:17 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Wed, 14 Jan 2026 16:50:32 +0100 Message-ID: <20260114155043.3313473-4-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260114155043.3313473-1-d.csapak@proxmox.com> References: <20260114155043.3313473-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [guest-example-hookscript.pl] Subject: [pve-devel] [PATCH docs 1/1] examples: add new hookscript phase to example hookscript X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" qemu-server has a new phase 'post-pci-prepare' that is called for vms with pci passthrough for each device prepared. add that to the example hookscript and explain when it's called and it's parameters with a comment. Signed-off-by: Dominik Csapak --- examples/guest-example-hookscript.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/examples/guest-example-hookscript.pl b/examples/guest-example-hookscript.pl index 1cce2e3..d677ab3 100755 --- a/examples/guest-example-hookscript.pl +++ b/examples/guest-example-hookscript.pl @@ -38,6 +38,27 @@ if ($phase eq 'pre-start') { print "$vmid started successfully.\n"; +} elsif ($phase eq 'post-pci-prepare') { + + # Only called for virtual machines, not containers. + # + # This phase will be called for each pci device that is passed through, + # after it was prepared by the PVE stack. In other words when either + # * the mdev/vGPU was created + # * the driver was changed to vfio-pci and the device was reset + # + # This phase has 2 additional parameters + # + # First is the 'hostpciX' index: + + my $hostpci_x = shift; + + # Second is either the mdev uuid or the pci id + + my $mdev_or_pciid = shift; + + print "Prepared PCI device for $hostpci_x with uuid/pciid: $mdev_or_pciid \n."; + } elsif ($phase eq 'pre-stop') { # Third phase 'pre-stop' will be executed before stopping the guest -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel