mirror of
git://git.proxmox.com/git/qemu-server.git
synced 2025-03-08 04:58:26 +03:00
fix #2493: show QEMU errors in migration log
QEMU usually only prints warnings and errors and stays silent otherwise, so it makes sense to just log all of it's output. Prefix it with '[<target_hostname>]' to indicate that the output is coming from the remote node, so users know where to search for the error. Side effect is that the 'VM start' task created by the migration will now show the "QEMU:" prefix, but it's still very readable IMHO. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
6e0216d862
commit
8bf30c2a72
@ -625,10 +625,12 @@ sub phase2 {
|
||||
$self->{target_drive}->{$targetdrive}->{volid} = $volid;
|
||||
$self->{target_drive}->{$targetdrive}->{nbd_uri} = $nbd_uri;
|
||||
|
||||
} elsif ($line =~ m/^QEMU: (.*)$/) {
|
||||
$self->log('info', "[$self->{node}] $1\n");
|
||||
}
|
||||
}, errfunc => sub {
|
||||
my $line = shift;
|
||||
$self->log('info', $line);
|
||||
$self->log('info', "[$self->{node}] $line");
|
||||
}, noerr => 1);
|
||||
|
||||
die "remote command failed with exit code $exitcode\n" if $exitcode;
|
||||
|
@ -5411,6 +5411,18 @@ sub vm_start {
|
||||
noerr => 1,
|
||||
);
|
||||
|
||||
# when migrating, prefix QEMU output so other side can pick up any
|
||||
# errors that might occur and show the user
|
||||
if ($migratedfrom) {
|
||||
$run_params{quiet} = 1;
|
||||
$run_params{logfunc} = sub {
|
||||
my $msg = shift;
|
||||
return if !$msg;
|
||||
chomp $msg;
|
||||
print "QEMU: $msg\n";
|
||||
};
|
||||
}
|
||||
|
||||
my %properties = (
|
||||
Slice => 'qemu.slice',
|
||||
KillMode => 'none',
|
||||
|
Loading…
x
Reference in New Issue
Block a user