]> git.proxmox.com Git - qemu-server.git/commitdiff
rescan update_disksize: be more verbose
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 11 Jul 2018 06:40:06 +0000 (08:40 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Jul 2018 07:35:43 +0000 (09:35 +0200)
Else an user has no idea what, or if something happened.

Gets printed to tty when using qm rescan or to tasklog for the case
where we do a rescan after restoring a backup.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index 5829e4c72654c5abbb4e33ec077adce4cd1e9e5c..e997049a4c13e0a920f249a605d2d89d53911658 100644 (file)
@@ -5538,6 +5538,7 @@ sub update_disksize {
     my ($vmid, $conf, $volid_hash) = @_;
 
     my $changes;
+    my $prefix = "VM $vmid:";
 
     # used and unused disks
     my $referenced = {};
@@ -5569,6 +5570,7 @@ sub update_disksize {
            if ($new ne $conf->{$opt}) {
                $changes = 1;
                $conf->{$opt} = $new;
+               print "$prefix update disk '$opt' information.\n";
            }
        }
     }
@@ -5579,6 +5581,7 @@ sub update_disksize {
        my $volid = $conf->{$opt};
        my $path = $volid_hash->{$volid}->{path} if $volid_hash->{$volid};
        if ($referenced->{$volid} || ($path && $referencedpath->{$path})) {
+           print "$prefix remove entry '$opt', its volume '$volid' is in use.\n";
            $changes = 1;
            delete $conf->{$opt};
        }
@@ -5594,7 +5597,8 @@ sub update_disksize {
        next if !$path; # just to be sure
        next if $referencedpath->{$path};
        $changes = 1;
-       PVE::QemuConfig->add_unused_volume($conf, $volid);
+       my $key = PVE::QemuConfig->add_unused_volume($conf, $volid);
+       print "$prefix add unreferenced volume '$volid' as '$key' to config.\n";
        $referencedpath->{$path} = 1; # avoid to add more than once (aliases)
     }
 
@@ -5612,6 +5616,7 @@ sub rescan {
        delete($cfg->{ids}->{$stor}) if ! $cfg->{ids}->{$stor}->{content}->{images};
     }
 
+    print "rescan volumes...\n";
     my $volid_hash = scan_volids($cfg, $vmid);
 
     my $updatefn =  sub {