]> git.proxmox.com Git - qemu-server.git/commitdiff
vzdump: assemble: improve error messages
authorFiona Ebner <f.ebner@proxmox.com>
Mon, 23 Oct 2023 08:59:08 +0000 (10:59 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 23 Oct 2023 15:09:41 +0000 (17:09 +0200)
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 <f.ebner@proxmox.com>
PVE/VZDump/QemuServer.pm

index f811cbf22fd673134bc5f5c6e289d29d092ce3b6..be7d8e1eed2d8ed319b77b093ece13f9da58c18f 100644 (file)
@@ -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;