From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Igor Mammedov" <imammedo@redhat.com>,
qemu-devel@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PULL 1/2] numa-test: fix query-cpus leaks
Date: Tue, 30 May 2017 16:11:20 -0300 [thread overview]
Message-ID: <20170530191121.1920-2-ehabkost@redhat.com> (raw)
In-Reply-To: <20170530191121.1920-1-ehabkost@redhat.com>
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Fix test leaks introduced in commit 2941020a476.
(and small extra space removed)
Spotted by ASAN.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20170526110456.32004-1-marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
tests/numa-test.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tests/numa-test.c b/tests/numa-test.c
index c3475d6d5e..3f636840b1 100644
--- a/tests/numa-test.c
+++ b/tests/numa-test.c
@@ -92,7 +92,7 @@ static QList *get_cpus(QDict **resp)
*resp = qmp("{ 'execute': 'query-cpus' }");
g_assert(*resp);
g_assert(qdict_haskey(*resp, "return"));
- return qdict_get_qlist(*resp, "return");
+ return qdict_get_qlist(*resp, "return");
}
static void test_query_cpus(const void *data)
@@ -100,7 +100,7 @@ static void test_query_cpus(const void *data)
char *cli;
QDict *resp;
QList *cpus;
- const QObject *e;
+ QObject *e;
cli = make_cli(data, "-smp 8 -numa node,cpus=0-3 -numa node,cpus=4-7");
qtest_start(cli);
@@ -124,6 +124,7 @@ static void test_query_cpus(const void *data)
} else {
g_assert_cmpint(node, ==, 1);
}
+ qobject_decref(e);
}
QDECREF(resp);
@@ -136,7 +137,7 @@ static void pc_numa_cpu(const void *data)
char *cli;
QDict *resp;
QList *cpus;
- const QObject *e;
+ QObject *e;
cli = make_cli(data, "-cpu pentium -smp 8,sockets=2,cores=2,threads=2 "
"-numa node,nodeid=0 -numa node,nodeid=1 "
@@ -176,6 +177,7 @@ static void pc_numa_cpu(const void *data)
} else {
g_assert(false);
}
+ qobject_decref(e);
}
QDECREF(resp);
@@ -188,7 +190,7 @@ static void spapr_numa_cpu(const void *data)
char *cli;
QDict *resp;
QList *cpus;
- const QObject *e;
+ QObject *e;
cli = make_cli(data, "-smp 4,cores=4 "
"-numa node,nodeid=0 -numa node,nodeid=1 "
@@ -220,6 +222,7 @@ static void spapr_numa_cpu(const void *data)
} else {
g_assert(false);
}
+ qobject_decref(e);
}
QDECREF(resp);
@@ -232,7 +235,7 @@ static void aarch64_numa_cpu(const void *data)
char *cli;
QDict *resp;
QList *cpus;
- const QObject *e;
+ QObject *e;
cli = make_cli(data, "-smp 2 "
"-numa node,nodeid=0 -numa node,nodeid=1 "
@@ -262,6 +265,7 @@ static void aarch64_numa_cpu(const void *data)
} else {
g_assert(false);
}
+ qobject_decref(e);
}
QDECREF(resp);
--
2.11.0.259.g40922b1
next prev parent reply other threads:[~2017-05-30 19:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-30 19:11 [Qemu-devel] [PULL 0/2] NUMA fixes, 2017-05-30 Eduardo Habkost
2017-05-30 19:11 ` Eduardo Habkost [this message]
2017-05-30 19:11 ` [Qemu-devel] [PULL 2/2] numa: Fix format string for "Invalid node" message Eduardo Habkost
2017-06-01 11:06 ` [Qemu-devel] [PULL 0/2] NUMA fixes, 2017-05-30 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=20170530191121.1920-2-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).