]> git.proxmox.com Git - pve-container.git/commitdiff
Log storage_migrate output
authorFabian Ebner <f.ebner@proxmox.com>
Wed, 29 Jul 2020 09:44:17 +0000 (11:44 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 4 Aug 2020 11:56:54 +0000 (13:56 +0200)
and make it more clear where an error within storage_migrate came from.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
src/PVE/LXC/Migrate.pm

index e48265760fc2a5503de1dcb198ac943af39f07d6..90d74b4384f6800e34a88f0f2edd09b85d27ecdf 100644 (file)
@@ -292,7 +292,14 @@ sub phase1 {
            'with_snapshots' => $volhash->{$volid}->{snapshots},
        };
 
-       PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid, $storage_migrate_opts);
+       my $logfunc = sub { $self->log('info', $_[0]); };
+       eval {
+           PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info},
+                                         $sid, $storage_migrate_opts, $logfunc);
+       };
+       if (my $err = $@) {
+           die "storage migration for '$volid' to storage '$sid' failed - $err\n";
+       }
     }
 
     my $conffile = PVE::LXC::Config->config_file($vmid);