From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id BED001FF0B2 for ; Mon, 24 Aug 2026 16:38:42 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4868021643; Mon, 24 Aug 2026 16:38:39 +0200 (CEST) Message-ID: <1b0627e5-58c0-4783-9ad2-e8680a74d8db@proxmox.com> Date: Mon, 24 Aug 2026 16:38:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH docs v3 1/1] examples: add new hookscript phase to example hookscript To: Dominik Csapak , pve-devel@lists.proxmox.com References: <20260227120728.2152303-1-d.csapak@proxmox.com> <20260227120728.2152303-5-d.csapak@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260227120728.2152303-5-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787582273503 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.830 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZLHNSA3PIO24TBBMCNDYZU3X7PTFJDJ7 X-Message-ID-Hash: ZLHNSA3PIO24TBBMCNDYZU3X7PTFJDJ7 X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 27.02.26 um 1:07 PM schrieb Dominik Csapak: > 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 The second "it's" should be "its" > parameters with a comment. > > Signed-off-by: Dominik Csapak > --- > examples/guest-example-hookscript.pl | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/examples/guest-example-hookscript.pl b/examples/guest-example-hookscript.pl > index 1cce2e3..da14fd1 100755 > --- a/examples/guest-example-hookscript.pl > +++ b/examples/guest-example-hookscript.pl > @@ -38,6 +38,31 @@ 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 Nit: please use "Proxmox VE" rather than "PVE" for user-facing text > + # * the mdev/vGPU was created > + # * the driver was changed to vfio-pci and the device was reset > + # > + # This phase has 3 additional parameters given via the environment > + > + # the id from the config, e.g. 'hostpci0' > + my $hostpci_x = $ENV{PVE_HOOK_ID}; > + > + # the pciid of the passed through device or the underlying device in case of an mdev/vGPU > + # e.g. '0000:01:00.0' > + my $pciid = $ENV{PVE_HOOK_PCIID}; > + > + # the uuid of the mediated device if it was one, > + # e.g. '00000001-0000-0000-0000-000000008006' > + my $mdev_uuid = $ENV{PVE_HOOK_MDEV_UUID}; > + > + print "Prepared PCI device for $hostpci_x with pciid: $pciid.\n"; > + print "It is a mediated device with UUID: $mdev_uuid\n" if $mdev_uuid; Nit: maybe mention one of the actual use cases in a comment? > + > } elsif ($phase eq 'pre-stop') { > > # Third phase 'pre-stop' will be executed before stopping the guest