public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server 1/2] vma restore: improve timeout error messages
@ 2024-06-18  7:52 Fiona Ebner
  2024-06-18  7:52 ` [pve-devel] [PATCH qemu-server 2/2] vma restore: bump timeout for reading header Fiona Ebner
  2024-06-20  7:37 ` [pve-devel] applied-series: [PATCH qemu-server 1/2] vma restore: improve timeout error messages Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2024-06-18  7:52 UTC (permalink / raw)
  To: pve-devel

The generic "got timeout" message cannot be associated to a certain
code path and also isn't very user-friendly. Use dedicated messages
for each stage and also suggest why the timeout for reading the header
might have happened, i.e. because it was corrupted.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 7815b608..85e8d74b 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -7537,15 +7537,17 @@ sub restore_vma_archive {
     my $oldtimeout;
 
     eval {
+	my $timeout_message = "got timeout preparing VMA restore\n";
 	# enable interrupts
 	local $SIG{INT} =
 	    local $SIG{TERM} =
 	    local $SIG{QUIT} =
 	    local $SIG{HUP} =
 	    local $SIG{PIPE} = sub { die "interrupted by signal\n"; };
-	local $SIG{ALRM} = sub { die "got timeout\n"; };
+	local $SIG{ALRM} = sub { die $timeout_message; };
 
 	$oldtimeout = alarm(5); # for reading the VMA header - might hang with a corrupted one
+	$timeout_message = "got timeout reading VMA header - corrupted?\n";
 
 	my $parser = sub {
 	    my $line = shift;
@@ -7556,6 +7558,7 @@ sub restore_vma_archive {
 		my ($dev_id, $size, $devname) = ($1, $2, $3);
 		$devinfo->{$devname} = { size => $size, dev_id => $dev_id };
 	    } elsif ($line =~ m/^CTIME: /) {
+		$timeout_message = "got timeout during VMA restore\n";
 		# we correctly received the vma config, so we can disable
 		# the timeout now for disk allocation
 		alarm($oldtimeout || 0);
-- 
2.39.2



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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-20  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-18  7:52 [pve-devel] [PATCH qemu-server 1/2] vma restore: improve timeout error messages Fiona Ebner
2024-06-18  7:52 ` [pve-devel] [PATCH qemu-server 2/2] vma restore: bump timeout for reading header Fiona Ebner
2024-06-20  7:37 ` [pve-devel] applied-series: [PATCH qemu-server 1/2] vma restore: improve timeout error messages Thomas Lamprecht

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