From: Fiona Ebner <f.ebner@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH docs v3 1/1] examples: add new hookscript phase to example hookscript
Date: Mon, 24 Aug 2026 16:38:23 +0200 [thread overview]
Message-ID: <1b0627e5-58c0-4783-9ad2-e8680a74d8db@proxmox.com> (raw)
In-Reply-To: <20260227120728.2152303-5-d.csapak@proxmox.com>
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 <d.csapak@proxmox.com>
> ---
> 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
next prev parent reply other threads:[~2026-08-24 14:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 12:06 [PATCH docs/guest-common/qemu-server v3 0/4] add new pci passthrough specific hookscript phase Dominik Csapak
2026-02-27 12:06 ` [PATCH guest-common v3 1/1] helpers: exec hookscript: add optional parameters Dominik Csapak
2026-08-24 14:38 ` Fiona Ebner
2026-02-27 12:06 ` [PATCH qemu-server v3 1/2] pci: factor 'prepare_pci_devices' out to PVE::QemuServer::PCI module Dominik Csapak
2026-08-24 14:38 ` Fiona Ebner
2026-02-27 12:06 ` [PATCH qemu-server v3 2/2] pci: call hookscript for each prepared pci device Dominik Csapak
2026-08-24 14:38 ` Fiona Ebner
2026-02-27 12:06 ` [PATCH docs v3 1/1] examples: add new hookscript phase to example hookscript Dominik Csapak
2026-08-24 14:38 ` Fiona Ebner [this message]
2026-08-25 14:10 ` superseded: [PATCH docs/guest-common/qemu-server v3 0/4] add new pci passthrough specific hookscript phase Dominik Csapak
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=1b0627e5-58c0-4783-9ad2-e8680a74d8db@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox