From b7bbeff3f9b49fa2f1678e83f34659145be77e3d Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Mon, 23 Oct 2023 10:59:08 +0200 Subject: [PATCH] vzdump: assemble: improve error messages by including the errno. Might make it clearer what the issue is in cases like: https://forum.proxmox.com/threads/135261/ Also add the missing newlines, the missing "to" in the second message, switch to the more common "or die" and avoid line bloat while at it. Signed-off-by: Fiona Ebner --- PVE/VZDump/QemuServer.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index f811cbf2..be7d8e1e 100644 --- a/PVE/VZDump/QemuServer.pm +++ b/PVE/VZDump/QemuServer.pm @@ -222,10 +222,8 @@ sub assemble { my $firewall_src = "/etc/pve/firewall/$vmid.fw"; my $firewall_dest = "$task->{tmpdir}/qemu-server.fw"; - my $outfd = IO::File->new (">$outfile") || - die "unable to open '$outfile'"; - my $conffd = IO::File->new ($conffile, 'r') || - die "unable open '$conffile'"; + my $outfd = IO::File->new(">$outfile") or die "unable to open '$outfile' - $!\n"; + my $conffd = IO::File->new($conffile, 'r') or die "unable to open '$conffile' - $!\n"; my $found_snapshot; my $found_pending;