From: Fabian Grünbichler Date: Wed, 27 Nov 2019 12:48:58 +0000 (+0100) Subject: pvesm import: improve handling of interrupted export X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f105c1766e06d5aed120c293496e4e861f7bb7f6;p=pve-storage.git pvesm import: improve handling of interrupted export since 'pvesm export' and 'pvesm import' are connected via a pipe and SSH, a fatal error in the former can lead to no valid header being written to the pipe. handle this more gracefully by printing an easier to understand error message, instead of uninitialized warnings with no context. Signed-off-by: Fabian Grünbichler --- diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 283eafc..963c391 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -1115,6 +1115,7 @@ sub read_common_header($) { my ($fh) = @_; sysread($fh, my $size, 8); $size = unpack('Q<', $size); + die "import: no size found in export header, aborting.\n" if !defined($size); die "got a bad size (not a multiple of 1K)\n" if ($size&1023); # Size is in bytes! return $size;