mirror of https://github.com/xemu-project/xemu.git
migration: Add migration events on target side
We reuse the migration events from the source side, sending them on the appropiate place. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
b05dc72342
commit
7cf1fe6d68
|
@ -230,6 +230,7 @@ void qemu_start_incoming_migration(const char *uri, Error **errp)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
|
|
||||||
|
qapi_event_send_migration(MIGRATION_STATUS_SETUP, &error_abort);
|
||||||
if (!strcmp(uri, "defer")) {
|
if (!strcmp(uri, "defer")) {
|
||||||
deferred_incoming_migration(errp);
|
deferred_incoming_migration(errp);
|
||||||
} else if (strstart(uri, "tcp:", &p)) {
|
} else if (strstart(uri, "tcp:", &p)) {
|
||||||
|
@ -258,7 +259,7 @@ static void process_incoming_migration_co(void *opaque)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
migration_incoming_state_new(f);
|
migration_incoming_state_new(f);
|
||||||
|
migrate_generate_event(MIGRATION_STATUS_ACTIVE);
|
||||||
ret = qemu_loadvm_state(f);
|
ret = qemu_loadvm_state(f);
|
||||||
|
|
||||||
qemu_fclose(f);
|
qemu_fclose(f);
|
||||||
|
@ -266,10 +267,12 @@ static void process_incoming_migration_co(void *opaque)
|
||||||
migration_incoming_state_destroy();
|
migration_incoming_state_destroy();
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
migrate_generate_event(MIGRATION_STATUS_FAILED);
|
||||||
error_report("load of migration failed: %s", strerror(-ret));
|
error_report("load of migration failed: %s", strerror(-ret));
|
||||||
migrate_decompress_threads_join();
|
migrate_decompress_threads_join();
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
migrate_generate_event(MIGRATION_STATUS_COMPLETED);
|
||||||
qemu_announce_self();
|
qemu_announce_self();
|
||||||
|
|
||||||
/* Make sure all file formats flush their mutable metadata */
|
/* Make sure all file formats flush their mutable metadata */
|
||||||
|
|
Loading…
Reference in New Issue