From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Laurent Vivier" <lvivier@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Pan Nengyuan" <pannengyuan@huawei.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Euler Robot" <euler.robot@huawei.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PULL 5/6] migration-test: fix some memleaks in migration-test
Date: Thu, 13 Feb 2020 14:20:29 +0100 [thread overview]
Message-ID: <20200213132030.57757-6-quintela@redhat.com> (raw)
In-Reply-To: <20200213132030.57757-1-quintela@redhat.com>
From: Pan Nengyuan <pannengyuan@huawei.com>
spotted by asan, 'check-qtest-aarch64' runs fail if sanitizers is enabled.
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
tests/qtest/migration-test.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index a78ac0c7da..ccf313f288 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -498,11 +498,13 @@ static int test_migrate_start(QTestState **from, QTestState **to,
const char *arch = qtest_get_arch();
const char *machine_opts = NULL;
const char *memory_size;
+ int ret = 0;
if (args->use_shmem) {
if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) {
g_test_skip("/dev/shm is not supported");
- return -1;
+ ret = -1;
+ goto out;
}
}
@@ -611,8 +613,9 @@ static int test_migrate_start(QTestState **from, QTestState **to,
g_free(shmem_path);
}
+out:
migrate_start_destroy(args);
- return 0;
+ return ret;
}
static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
@@ -1134,6 +1137,8 @@ static void test_validate_uuid(void)
{
MigrateStart *args = migrate_start_new();
+ g_free(args->opts_source);
+ g_free(args->opts_target);
args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
args->opts_target = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
do_test_validate_uuid(args, false);
@@ -1143,6 +1148,8 @@ static void test_validate_uuid_error(void)
{
MigrateStart *args = migrate_start_new();
+ g_free(args->opts_source);
+ g_free(args->opts_target);
args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
args->opts_target = g_strdup("-uuid 22222222-2222-2222-2222-222222222222");
args->hide_stderr = true;
@@ -1153,6 +1160,7 @@ static void test_validate_uuid_src_not_set(void)
{
MigrateStart *args = migrate_start_new();
+ g_free(args->opts_target);
args->opts_target = g_strdup("-uuid 22222222-2222-2222-2222-222222222222");
args->hide_stderr = true;
do_test_validate_uuid(args, false);
@@ -1162,6 +1170,7 @@ static void test_validate_uuid_dst_not_set(void)
{
MigrateStart *args = migrate_start_new();
+ g_free(args->opts_source);
args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
args->hide_stderr = true;
do_test_validate_uuid(args, false);
@@ -1380,6 +1389,7 @@ static void test_multifd_tcp_cancel(void)
" 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}");
qobject_unref(rsp);
+ g_free(uri);
uri = migrate_get_socket_address(to2, "socket-address");
wait_for_migration_status(from, "cancelled", NULL);
--
2.24.1
next prev parent reply other threads:[~2020-02-13 13:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 13:20 [PULL 0/6] Pull migration patches Juan Quintela
2020-02-13 13:20 ` [PULL 1/6] migration: Maybe VM is paused when migration is cancelled Juan Quintela
2020-02-13 13:20 ` [PULL 2/6] migration: Optimization about wait-unplug migration state Juan Quintela
2020-02-13 13:20 ` [PULL 3/6] migration/rdma: rdma_accept_incoming_migration fix error handling Juan Quintela
2020-02-13 13:20 ` [PULL 4/6] tests/migration: Add some slack to auto converge Juan Quintela
2020-02-13 13:20 ` Juan Quintela [this message]
2020-02-13 13:20 ` [PULL 6/6] git: Make submodule check only needed modules Juan Quintela
2020-02-14 18:36 ` [PULL 0/6] Pull migration patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200213132030.57757-6-quintela@redhat.com \
--to=quintela@redhat.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=euler.robot@huawei.com \
--cc=lvivier@redhat.com \
--cc=pannengyuan@huawei.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.