[Qemu-devel] [PATCH 0/2] migration: Fix early failure crash

Dr. David Alan Gilbert (git) posted 2 patches 6 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180212160340.15333-1-dgilbert@redhat.com
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test docker-quick@centos6 passed
Test ppcbe passed
Test ppcle passed
Test s390x passed
migration/ram.c        | 12 ++++++----
tests/migration-test.c | 65 ++++++++++++++++++++++++++++++++++++++------------
2 files changed, 57 insertions(+), 20 deletions(-)
[Qemu-devel] [PATCH 0/2] migration: Fix early failure crash
Posted by Dr. David Alan Gilbert (git) 6 years, 2 months ago
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

This fixes a crash for the case where a migration exits with an error
very early, this is probably due to my recent error handling change.

I also add a test to make sure this doesn't fail again, the test does
output one line of junk, suggestions for how to clean it up are welcome:

[dgilbert@dgilbert-t530 try]$ tests/migration-test 
/x86_64/migration/deprecated: OK
/x86_64/migration/bad_dest: qemu-system-x86_64: Failed to connect socket: Connection refused
OK
/x86_64/migration/postcopy/unix: OK

Dave

Dr. David Alan Gilbert (2):
  migration: Fix early failure cleanup
  tests/migration: Add test for migration to bad destination

 migration/ram.c        | 12 ++++++----
 tests/migration-test.c | 65 ++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 57 insertions(+), 20 deletions(-)

-- 
2.14.3


Re: [Qemu-devel] [PATCH 0/2] migration: Fix early failure crash
Posted by Peter Xu 6 years, 2 months ago
On Mon, Feb 12, 2018 at 04:03:38PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> This fixes a crash for the case where a migration exits with an error
> very early, this is probably due to my recent error handling change.
> 
> I also add a test to make sure this doesn't fail again, the test does
> output one line of junk, suggestions for how to clean it up are welcome:
> 
> [dgilbert@dgilbert-t530 try]$ tests/migration-test 
> /x86_64/migration/deprecated: OK
> /x86_64/migration/bad_dest: qemu-system-x86_64: Failed to connect socket: Connection refused
> OK
> /x86_64/migration/postcopy/unix: OK

So we have more than one way to log things (error_report routes things
directly to stderr while we also have the qemu log stuff).

A stupid but fast way I can think of is just don't dump this in
migrate_fd_cleanup, since after all it's only for HMP and people
should also see that when query migration status.  But it'll be a bit
inconvenient for HMP users encountering failures.

Or maybe we can hack around fd 2 specifically in that test?  It's at
least ugly though...

Anyway, the patches look good to me.

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu