]> git.proxmox.com Git - qemu-server.git/commitdiff
Display volume size in log when doing a volume backup
authorEmmanuel Kasper <e.kasper@proxmox.com>
Tue, 20 Dec 2016 10:33:01 +0000 (11:33 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 22 Dec 2016 09:25:13 +0000 (10:25 +0100)
Output before this patch
INFO: include disk 'scsi0' 'file=pve4tank:vm-402-disk-1'

Output after this patch:
INFO: include disk 'scsi0' 'file=pve4tank:vm-402-disk-1' 64G

we're mainly intersted by the volume size here, it was requested in #351

PVE/VZDump/QemuServer.pm

index 6a58a79e30cafad760dc659c2e92465976b2dbed..da3ee06b291b193eba76b7c8d6802b04e41ed758 100644 (file)
@@ -12,6 +12,7 @@ use PVE::Tools;
 use PVE::Storage::Plugin;
 use PVE::Storage;
 use PVE::QemuServer;
+use PVE::JSONSchema;
 use IO::File;
 use IPC::Open3;
 
@@ -75,7 +76,12 @@ sub prepare {
        } elsif ($drive->{iothread}) {
            die "disk '$ds' '$volid' (iothread=on) can't use backup feature currently. Please set backup=no for this drive";
        } else {
-           $self->loginfo("include disk '$ds' '$volid'");
+           my $log = "include disk '$ds' '$volid'";
+          if (defined $drive->{size}) {
+               my $readable_size = PVE::JSONSchema::format_size($drive->{size});
+               $log .= " $readable_size";
+          }
+           $self->loginfo($log);
        }
 
        my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, 1);