public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Michal Fox <me@dualfroz.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH guest-common] fix #7408: guest helpers: activate storage before checking hookscript
Date: Tue, 29 Sep 2026 15:48:52 +0200	[thread overview]
Message-ID: <20260929134852.2660793-1-me@dualfroz.com> (raw)

The hookscript is looked up on its storage without activating it first.
If the snippets live on a network storage like CIFS or NFS that is not
mounted yet, for example when a guest is started on boot, the check
fails with "script ... does not exist" and the guest does not start,
even though the storage would be mounted on its first regular use.

Activate the storage of the hookscript volume before checking the file,
as is done for any other volume used by a guest.

Signed-off-by: Michal Fox <me@dualfroz.com>
---
 src/PVE/GuestHelpers.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/GuestHelpers.pm b/src/PVE/GuestHelpers.pm
index f8d112b..ccd00b9 100644
--- a/src/PVE/GuestHelpers.pm
+++ b/src/PVE/GuestHelpers.pm
@@ -105,6 +105,9 @@ sub check_hookscript {
     die "'$volid' is not in the snippets directory\n"
         if $type ne 'snippets';
 
+    my ($storeid) = PVE::Storage::parse_volume_id($volid);
+    PVE::Storage::activate_storage($storecfg, $storeid);
+
     die "script '$volid' does not exist\n"
         if !-f $path;
 
-- 
2.43.0




                 reply	other threads:[~2026-09-30  7:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260929134852.2660793-1-me@dualfroz.com \
    --to=me@dualfroz.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal