[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 1/3] Migration: Generate the completed event only
From: |
Christian Borntraeger |
Subject: |
Re: [Qemu-devel] [PULL 1/3] Migration: Generate the completed event only when we complete |
Date: |
Thu, 15 Oct 2015 17:07:10 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
Am 15.10.2015 um 08:27 schrieb Juan Quintela:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> The current migration-completed event is generated a bit too early,
> which means that an eager libvirt that's ready to go as soon
> as it sees the event ends up racing with the actual end of migration.
>
> This corresponds to RH bug:
> https://bugzilla.redhat.com/show_bug.cgi?id=1271145
Is that something for stable?
>
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> Reviewed-by: Juan Quintela <address@hidden>
> Reviewed-by: Amit Shah <address@hidden>
> xSigned-off-by: Juan Quintela <address@hidden>
> ---
> migration/migration.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index b7de9b7..3d40f24 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -294,12 +294,12 @@ static void process_incoming_migration_co(void *opaque)
> migrate_decompress_threads_join();
> exit(EXIT_FAILURE);
> }
> - migrate_generate_event(MIGRATION_STATUS_COMPLETED);
> qemu_announce_self();
>
> /* Make sure all file formats flush their mutable metadata */
> bdrv_invalidate_cache_all(&local_err);
> if (local_err) {
> + migrate_generate_event(MIGRATION_STATUS_FAILED);
> error_report_err(local_err);
> migrate_decompress_threads_join();
> exit(EXIT_FAILURE);
> @@ -320,6 +320,12 @@ static void process_incoming_migration_co(void *opaque)
> runstate_set(global_state_get_runstate());
> }
> migrate_decompress_threads_join();
> + /*
> + * This must happen after any state changes since as soon as an external
> + * observer sees this event they might start to prod at the VM assuming
> + * it's ready to use.
> + */
> + migrate_generate_event(MIGRATION_STATUS_COMPLETED);
> }
>
> void process_incoming_migration(QEMUFile *f)
>