Migration Pull request
cover Migration Pull request
It includes several fixes:
- fix qemu_fclose(denis)
- remove superfluous breaks (liao)
- fix memory leak (zheng)
Please apply
Denis V. Lunev (1):
migration/savevm: respect qemu_fclose() error code in save_snapshot()
Liao Pingfang (1):
migration/migration.c: Remove superfluous breaks
Zheng Chuan (1):
migration: fix memory leak in qmp_migrate_set_parameters
migration/migration.c | 6 ++---- migration/savevm.c | 8 ++++++-- 2 files changed, 8 insertions(+), 6 deletions(-)
Signature · 1 line
2.25.4
PATCH 2/3 migration/savevm: respect qemu_fclose() error code in save_snapshot()
From: "Denis V. Lunev" <[email protected]>
qemu_fclose() could return error, f.e. if bdrv_co_flush() will return the error.
This validation will become more important once we will start waiting of asynchronous IO operations, started from bdrv_write_vmstate(), which are coming soon.
--- migration/savevm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
migration/savevm.c +6 -2
@@ -2635,7 +2635,7 @@ int save_snapshot(const char *name, Error **errp) {BlockDriverState *bs, *bs1;QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1; -int ret =-1 ; +int ret =-1 , ret2;QEMUFile *f;int saved_vm_running;uint64_t vm_state_size;
@@ -2719,10 +2719,14 @@ int save_snapshot(const char *name, Error **errp) } ret =qemu_savevm_state (f, errp); vm_state_size =qemu_ftell (f); -qemu_fclose (f); + ret2 =qemu_fclose (f);if (ret <0 ) { goto the_end; } +if (ret2 <0 ) { + ret = ret2; + goto the_end; + }/* The bdrv_all_create_snapshot() call that follows acquires the AioContext * for itself. BDRV_POLL_WHILE() does not support nested locking because
Signature · 1 line
2.25.4
PATCH 3/3 migration/migration.c: Remove superfluous breaks
In reply to Juan QuintelaFrom: Liao Pingfang <[email protected]>
Remove superfluous breaks, as there is a "return" before them.
--- migration/migration.c | 2 -- 1 file changed, 2 deletions(-)
migration/migration.c +0 -2
@@ -986,7 +986,6 @@ static void fill_source_migration_info(MigrationInfo *info)/* no migration has happened ever */ /* do not overwrite destination migration status */ return ; -break ;case MIGRATION_STATUS_SETUP : info->has_status = true; info->has_total_time = false;
@@ -1105,7 +1104,6 @@ static void fill_destination_migration_info(MigrationInfo *info)switch (mis->state) {case MIGRATION_STATUS_NONE :return ; -break ;case MIGRATION_STATUS_SETUP :case MIGRATION_STATUS_CANCELLING :case MIGRATION_STATUS_CANCELLED :
Signature · 1 line
2.25.4
Re: [PATCH 3/3] migration/migration.c: Remove superfluous breaks
Quoted 7 lines · Juan Quintela
From: Liao Pingfang <[email protected]>
Remove superfluous breaks, as there is a "return" before them.
Signed-off-by Liao Pingfang <[email protected]>Signed-off-by Yi Wang <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>
I hadn't reviewed this patch, but now I did ¯\_(ツ)_/¯
Quoted 28 lines
Reviewed-by Juan Quintela <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Juan Quintela <[email protected]>--- migration/migration.c | 2 -- 1 file changed, 2 deletions(-)migration/migration.c +0
-2@@ -986,7 +986,6 @@ static void fill_source_migration_info(MigrationInfo *info)/* no migration has happened ever */ /* do not overwrite destination migration status */ return ; -break ;case MIGRATION_STATUS_SETUP : info->has_status = true; info->has_total_time = false;@@ -1105,7 +1104,6 @@ static void fill_destination_migration_info(MigrationInfo *info)switch (mis->state) {case MIGRATION_STATUS_NONE :return ; -break ;case MIGRATION_STATUS_SETUP :case MIGRATION_STATUS_CANCELLING :case MIGRATION_STATUS_CANCELLED :