[pve-devel] [PATCH common 2/2] log actual error when remote migration ip fails

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Nov 3 14:22:56 CET 2016


Else we only output that the command failed with 'exit code 255'.
Instead log and die with the actual error from the remote comand:
`pvecm mtunnel -get_migration_ip`

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/AbstractMigrate.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PVE/AbstractMigrate.pm b/src/PVE/AbstractMigrate.pm
index 140b479..8dd1d04 100644
--- a/src/PVE/AbstractMigrate.pm
+++ b/src/PVE/AbstractMigrate.pm
@@ -98,6 +98,11 @@ sub get_remote_migration_ip {
 	if ($line =~ m/^ip: '($PVE::Tools::IPRE)'$/) {
 	   $ip = $1;
 	}
+    },
+    errfunc => sub {
+	my $line = shift;
+	$self->log('err', $line);
+	die "$line\n";
     });
 
     return $ip;
-- 
2.1.4





More information about the pve-devel mailing list