]> git.proxmox.com Git - qemu-server.git/commitdiff
swtmp: die early in startup check
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 18 Oct 2021 07:42:36 +0000 (09:42 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 18 Oct 2021 07:43:46 +0000 (09:43 +0200)
no point in waiting another 50 ms if we know that we'd die already
anyway..

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

index 84c48e033474de1deb0782153723899e07b46a38..dce16c1cecb1492c6fd00291ec536d73c4c4f074 100644 (file)
@@ -3060,9 +3060,8 @@ sub start_swtpm {
 
     my $tries = 100; # swtpm may take a bit to start before daemonizing, wait up to 5s for pid
     while (! -e $paths->{pid}) {
+       die "failed to start swtpm: pid file '$paths->{pid}' wasn't created.\n" if --$tries == 0;
        usleep(50_000);
-       die "failed to start swtpm: pid file '$paths->{pid}' wasn't created.\n"
-           if --$tries == 0;
     }
 
     # return untainted PID of swtpm daemon so it can be killed on error