]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage.pm
PVE/Storage/PBSPlugin.pm: start new proxmox backup server plugin
[pve-storage.git] / PVE / Storage.pm
index 0bd103e914c1512e318c6a14e77c070673ecdaea..17196a862be3512e759bdfd4a53b7c9c475c147a 100755 (executable)
@@ -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()