This enables us to pass parameters to the run_command call so the
hookscripts have a more fine-grained control over how the script should
get executed.

Signed-off-by: Stefan Hanreich <s.hanre...@proxmox.com>
---
 src/PVE/GuestHelpers.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/GuestHelpers.pm b/src/PVE/GuestHelpers.pm
index 0fe3fd6..79c02e2 100644
--- a/src/PVE/GuestHelpers.pm
+++ b/src/PVE/GuestHelpers.pm
@@ -101,7 +101,7 @@ sub check_hookscript {
 }
 
 sub exec_hookscript {
-    my ($conf, $vmid, $phase, $stop_on_error) = @_;
+    my ($conf, $vmid, $phase, $stop_on_error, $run_params) = @_;
 
     return if !$conf->{hookscript};
 
@@ -109,7 +109,7 @@ sub exec_hookscript {
        my $hookscript = check_hookscript($conf->{hookscript});
        die $@ if $@;
 
-       PVE::Tools::run_command([$hookscript, $vmid, $phase]);
+       PVE::Tools::run_command([$hookscript, $vmid, $phase], %$run_params);
     };
     if (my $err = $@) {
        my $errmsg = "hookscript error for $vmid on $phase: $err\n";
-- 
2.30.2


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to