Migration Pull request

It includes several fixes:
 
 - fix qemu_fclose(denis)
 - remove superfluous breaks (liao)
 - fix memory leak (zheng)
 
 Please apply
 
 [v1 & v2]
 
 There was one error on the huawei address of the 1st patch and mail
 was bouncing.  Fixed.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAl8MnyYACgkQ9IfvGFhy
 1yO3PA/8Cd+79UpLfyTLnkHhiVWv5d6soqZiqrN9hpLvQaCkSLRvFKKs43rgtYHd
 qOmaDK6UFKYABdoFaiYqmILay08AQX0m/dlc0Qfv944TUpvY2K7zYRmRdN+Z1tg0
 pOUnIXU/4oE0T4qqZ7I4y6l17lzI7yvReOFXxTRX/eW+b+W1AWAb13kXRFPmLzbJ
 beC5O8uz3mkEs4qNwhYVxf86LKkR3fTGId7dEFCrg/6uVmUS+6Ad8nqcxPtGteXS
 jieJcTXPvHEpTryYTVspEsedCv8+sLkRZW3cq2W+PaVi+lrIab86d66MkbYJ1n7I
 MwVJMqZJqNKiE20PTJ6S20HcHx+r9IS4h3yUNG8q5KfcCoesyMd0solYIKBe/290
 Gd5blw+KPmFWyxN+u0CQ0vaPg6JDzlJ/QD0XWbA8K5v5salvD5nfIZDkaT7BsZYB
 J1UxJ1uMwElZCCtN/oMWjzF/FMzdQipTxRbGELMf66+pkInVrfcwaOKu+NxVRaoQ
 htUOwzZdEoTVQrlNrrlFNp4hE9AFXP25pZn40rmc2BVLU2eN3CZ2dllsZDEfom+0
 DHhlJxPPXpwv1oCAix8XHH6f63bbviMpjwdlSCwZ4G0aLK6I8+vaBPM1esicX8Eb
 8mgYvIZTZv/k36gjhwraZuSI3oLBgF9FOV3KyYVQ87KJhFWXsak=
 =/Tzx
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/juanquintela/tags/migration-pull-request' into staging

Migration Pull request

It includes several fixes:

- fix qemu_fclose(denis)
- remove superfluous breaks (liao)
- fix memory leak (zheng)

Please apply

[v1 & v2]

There was one error on the huawei address of the 1st patch and mail
was bouncing.  Fixed.

# gpg: Signature made Mon 13 Jul 2020 18:51:34 BST
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* remotes/juanquintela/tags/migration-pull-request:
  migration/migration.c: Remove superfluous breaks
  migration/savevm: respect qemu_fclose() error code in save_snapshot()
  migration: fix memory leak in qmp_migrate_set_parameters

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-07-14 16:33:23 +01:00
commit beff47a2f6
2 changed files with 8 additions and 6 deletions

View File

@ -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:
@ -1343,12 +1341,12 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
if (params->has_tls_creds) {
assert(params->tls_creds->type == QTYPE_QSTRING);
dest->tls_creds = g_strdup(params->tls_creds->u.s);
dest->tls_creds = params->tls_creds->u.s;
}
if (params->has_tls_hostname) {
assert(params->tls_hostname->type == QTYPE_QSTRING);
dest->tls_hostname = g_strdup(params->tls_hostname->u.s);
dest->tls_hostname = params->tls_hostname->u.s;
}
if (params->has_max_bandwidth) {

View File

@ -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