X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FStorage.pm;h=17196a862be3512e759bdfd4a53b7c9c475c147a;hb=271fe394601b7f1733e866c73f92b009c7277b28;hp=0bd103e914c1512e318c6a14e77c070673ecdaea;hpb=481f6177a58022da3128b687f022abcae38261b2;p=pve-storage.git diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 0bd103e..17196a8 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -36,6 +36,7 @@ use PVE::Storage::GlusterfsPlugin; use PVE::Storage::ZFSPoolPlugin; use PVE::Storage::ZFSPlugin; use PVE::Storage::DRBDPlugin; +use PVE::Storage::PBSPlugin; # Storage API version. Icrement it on changes in storage API interface. use constant APIVER => 3; @@ -58,6 +59,7 @@ PVE::Storage::GlusterfsPlugin->register(); PVE::Storage::ZFSPoolPlugin->register(); PVE::Storage::ZFSPlugin->register(); PVE::Storage::DRBDPlugin->register(); +PVE::Storage::PBSPlugin->register(); # load third-party plugins if ( -d '/usr/share/perl5/PVE/Storage/Custom' ) { @@ -573,7 +575,6 @@ sub storage_migrate { my $target_volid = "${target_storeid}:${target_volname}"; my $target_ip = $target_sshinfo->{ip}; - my $errstr = "unable to migrate '$volid' to '${target_volid}' on host '$target_sshinfo->{name}'"; my $ssh = PVE::SSHInfo::ssh_info_to_command($target_sshinfo); my $ssh_base = PVE::SSHInfo::ssh_info_to_command_base($target_sshinfo); @@ -627,11 +628,21 @@ sub storage_migrate { or die "failed to connect to tunnel at $ip:$port\n"; # we won't be reading from the socket shutdown($socket, 0); - run_command([$send, @cstream], output => '>&'.fileno($socket)); + run_command([$send, @cstream], output => '>&'.fileno($socket), errfunc => $logfunc); # don't close the connection entirely otherwise the receiving end # might not get all buffered data (and fails with 'connection reset by peer') shutdown($socket, 1); - 1 while <$info>; # wait for the remote process to finish + + # wait for the remote process to finish + if ($logfunc) { + while (my $line = <$info>) { + chomp($line); + $logfunc->("[$target_sshinfo->{name}] $line"); + } + } else { + 1 while <$info>; + } + # now close the socket close($socket); if (!close($info)) { # does waitpid()