]> git.proxmox.com Git - qemu-server.git/commitdiff
restore vma: inline one timeout variable and move other closer to usage
authorFiona Ebner <f.ebner@proxmox.com>
Tue, 12 Sep 2023 09:16:17 +0000 (11:16 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 15 Sep 2023 14:27:44 +0000 (16:27 +0200)
No functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/QemuServer.pm

index f7ee7686eb5ab5e53b395bdc560fb4c665f8357a..b52dfbf453bce06ea38b4989fba7f596ec6ecb24 100644 (file)
@@ -7366,9 +7366,6 @@ sub restore_vma_archive {
 
     $add_pipe->(['vma', 'extract', '-v', '-r', $mapfifo, $readfrom, $tmpdir]);
 
-    my $oldtimeout;
-    my $timeout = 5; # for reading the VMA header - might hang with a corrupted one
-
     my $devinfo = {}; # info about drives included in backup
     my $virtdev_hash = {}; # info about allocated drives
 
@@ -7462,6 +7459,8 @@ sub restore_vma_archive {
        $fh->close();
     };
 
+    my $oldtimeout;
+
     eval {
        # enable interrupts
        local $SIG{INT} =
@@ -7471,7 +7470,7 @@ sub restore_vma_archive {
            local $SIG{PIPE} = sub { die "interrupted by signal\n"; };
        local $SIG{ALRM} = sub { die "got timeout\n"; };
 
-       $oldtimeout = alarm($timeout);
+       $oldtimeout = alarm(5); # for reading the VMA header - might hang with a corrupted one
 
        my $parser = sub {
            my $line = shift;