All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] numa-test: fix query-cpus leaks
@ 2017-05-26 11:04 Marc-André Lureau
  2017-05-26 13:34 ` Eric Blake
  2017-05-26 18:56 ` Eduardo Habkost
  0 siblings, 2 replies; 3+ messages in thread
From: Marc-André Lureau @ 2017-05-26 11:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: imammedo, ehabkost, Marc-André Lureau

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>
---
 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.13.0.rc1.16.gd80b50c3f

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] numa-test: fix query-cpus leaks
  2017-05-26 11:04 [Qemu-devel] [PATCH] numa-test: fix query-cpus leaks Marc-André Lureau
@ 2017-05-26 13:34 ` Eric Blake
  2017-05-26 18:56 ` Eduardo Habkost
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2017-05-26 13:34 UTC (permalink / raw)
  To: Marc-André Lureau, qemu-devel; +Cc: imammedo, ehabkost

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

On 05/26/2017 06:04 AM, Marc-André Lureau wrote:
> 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>
> ---
>  tests/numa-test.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] numa-test: fix query-cpus leaks
  2017-05-26 11:04 [Qemu-devel] [PATCH] numa-test: fix query-cpus leaks Marc-André Lureau
  2017-05-26 13:34 ` Eric Blake
@ 2017-05-26 18:56 ` Eduardo Habkost
  1 sibling, 0 replies; 3+ messages in thread
From: Eduardo Habkost @ 2017-05-26 18:56 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel, imammedo

On Fri, May 26, 2017 at 03:04:55PM +0400, Marc-André Lureau wrote:
> 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>

Queued on numa-next. Thanks!

-- 
Eduardo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-26 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 11:04 [Qemu-devel] [PATCH] numa-test: fix query-cpus leaks Marc-André Lureau
2017-05-26 13:34 ` Eric Blake
2017-05-26 18:56 ` Eduardo Habkost

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.