Migration patches for rc3:

- One more memleak regression fix from Het
 -----BEGIN PGP SIGNATURE-----
 
 iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCZWoLbRIccGV0ZXJ4QHJl
 ZGhhdC5jb20ACgkQO1/MzfOr1wahYwD+OsD7CaZYjkl9KSooRfblEenD6SdfhAdC
 oZc07f2UxocA/0s1keDBZUUcZOiGYPDFV5his4Jw4F+RRD1YIpVWZg4J
 =T0/r
 -----END PGP SIGNATURE-----

Merge tag 'migration-20231201-pull-request' of https://github.com/xzpeter/qemu into staging

Migration patches for rc3:

- One more memleak regression fix from Het

# -----BEGIN PGP SIGNATURE-----
#
# iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCZWoLbRIccGV0ZXJ4QHJl
# ZGhhdC5jb20ACgkQO1/MzfOr1wahYwD+OsD7CaZYjkl9KSooRfblEenD6SdfhAdC
# oZc07f2UxocA/0s1keDBZUUcZOiGYPDFV5his4Jw4F+RRD1YIpVWZg4J
# =T0/r
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 01 Dec 2023 11:35:57 EST
# gpg:                using EDDSA key B9184DC20CC457DACF7DD1A93B5FCCCDF3ABD706
# gpg:                issuer "peterx@redhat.com"
# gpg: Good signature from "Peter Xu <xzpeter@gmail.com>" [full]
# gpg:                 aka "Peter Xu <peterx@redhat.com>" [full]
# Primary key fingerprint: B918 4DC2 0CC4 57DA CF7D  D1A9 3B5F CCCD F3AB D706

* tag 'migration-20231201-pull-request' of https://github.com/xzpeter/qemu:
  migration: Plug memory leak with migration URIs

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2023-12-04 08:01:24 -05:00
commit 019f8c19df

View File

@ -516,7 +516,7 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels,
MigrationChannelList *channels, MigrationChannelList *channels,
Error **errp) Error **errp)
{ {
MigrationChannel *channel = NULL; g_autoptr(MigrationChannel) channel = NULL;
MigrationAddress *addr = NULL; MigrationAddress *addr = NULL;
MigrationIncomingState *mis = migration_incoming_get_current(); MigrationIncomingState *mis = migration_incoming_get_current();
@ -534,18 +534,18 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels,
error_setg(errp, "Channel list has more than one entries"); error_setg(errp, "Channel list has more than one entries");
return; return;
} }
channel = channels->value; addr = channels->value->addr;
} else if (uri) { } else if (uri) {
/* caller uses the old URI syntax */ /* caller uses the old URI syntax */
if (!migrate_uri_parse(uri, &channel, errp)) { if (!migrate_uri_parse(uri, &channel, errp)) {
return; return;
} }
addr = channel->addr;
} else { } else {
error_setg(errp, "neither 'uri' or 'channels' argument are " error_setg(errp, "neither 'uri' or 'channels' argument are "
"specified in 'migrate-incoming' qmp command "); "specified in 'migrate-incoming' qmp command ");
return; return;
} }
addr = channel->addr;
/* transport mechanism not suitable for migration? */ /* transport mechanism not suitable for migration? */
if (!migration_channels_and_transport_compatible(addr, errp)) { if (!migration_channels_and_transport_compatible(addr, errp)) {
@ -1933,7 +1933,7 @@ void qmp_migrate(const char *uri, bool has_channels,
bool resume_requested; bool resume_requested;
Error *local_err = NULL; Error *local_err = NULL;
MigrationState *s = migrate_get_current(); MigrationState *s = migrate_get_current();
MigrationChannel *channel = NULL; g_autoptr(MigrationChannel) channel = NULL;
MigrationAddress *addr = NULL; MigrationAddress *addr = NULL;
/* /*
@ -1950,18 +1950,18 @@ void qmp_migrate(const char *uri, bool has_channels,
error_setg(errp, "Channel list has more than one entries"); error_setg(errp, "Channel list has more than one entries");
return; return;
} }
channel = channels->value; addr = channels->value->addr;
} else if (uri) { } else if (uri) {
/* caller uses the old URI syntax */ /* caller uses the old URI syntax */
if (!migrate_uri_parse(uri, &channel, errp)) { if (!migrate_uri_parse(uri, &channel, errp)) {
return; return;
} }
addr = channel->addr;
} else { } else {
error_setg(errp, "neither 'uri' or 'channels' argument are " error_setg(errp, "neither 'uri' or 'channels' argument are "
"specified in 'migrate' qmp command "); "specified in 'migrate' qmp command ");
return; return;
} }
addr = channel->addr;
/* transport mechanism not suitable for migration? */ /* transport mechanism not suitable for migration? */
if (!migration_channels_and_transport_compatible(addr, errp)) { if (!migration_channels_and_transport_compatible(addr, errp)) {