public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 3/3] restore vma: inline one timeout variable and move other closer to usage
Date: Tue, 12 Sep 2023 11:16:17 +0200	[thread overview]
Message-ID: <20230912091617.26590-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20230912091617.26590-1-f.ebner@proxmox.com>

No functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index f7ee7686..b52dfbf4 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -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;
-- 
2.39.2





  parent reply	other threads:[~2023-09-12  9:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12  9:16 [pve-devel] [PATCH qemu-server 1/3] fix #2816: restore: remove timeout when allocating disks Fiona Ebner
2023-09-12  9:16 ` [pve-devel] [PATCH qemu-server 2/3] restore vma: add comment describing timeout Fiona Ebner
2023-09-12  9:16 ` Fiona Ebner [this message]
2023-09-20 11:23 ` [pve-devel] [PATCH qemu-server 1/3] fix #2816: restore: remove timeout when allocating disks Dominik Csapak
2023-09-20 11:28   ` Dominik Csapak
2023-09-25  8:46   ` Fiona Ebner
2023-09-25  8:57     ` Dominik Csapak
2023-09-25 10:30       ` Fiona Ebner
2023-09-25 11:25         ` Dominik Csapak
2023-11-17  8:49 ` [pve-devel] applied-series: " Thomas Lamprecht

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=20230912091617.26590-3-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.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