]> git.proxmox.com Git - qemu-server.git/commitdiff
vm start: factor out silencing systemd stop-scope command
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jun 2023 07:12:54 +0000 (09:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jun 2023 07:13:04 +0000 (09:13 +0200)
will be reused in the next commit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index 0fa43a74c71d737b8a0e1ff84fb134212e584eb0..02a2d528c81871d91fd2da463c17e0e438d2f029 100644 (file)
@@ -5871,9 +5871,9 @@ sub vm_start_nolock {
 
     PVE::Storage::activate_volumes($storecfg, $vollist);
 
-    eval {
-       run_command(['/bin/systemctl', 'stop', "$vmid.scope"], outfunc => sub{}, errfunc => sub{});
-    };
+
+    my %silence_std_outs = (outfunc => sub {}, errfunc => sub {});
+    eval { run_command(['/bin/systemctl', 'stop', "$vmid.scope"], %silence_std_outs) };
     # Issues with the above 'stop' not being fully completed are extremely rare, a very low
     # timeout should be more than enough here...
     PVE::Systemd::wait_for_unit_removed("$vmid.scope", 20);