qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.12 7/8] tests: introduce qtest_init_with_q


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH for-2.12 7/8] tests: introduce qtest_init_with_qmp_format()
Date: Mon, 26 Mar 2018 16:48:57 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/26/2018 01:39 AM, Peter Xu wrote:
It is abstracted from qtest_init_without_qmp_handshake(). It works just
like qtest_init_without_qmp_handshake() but further it would allow the
caller to specify the QMP parameter.

Signed-off-by: Peter Xu <address@hidden>
---
  tests/libqtest.c | 14 +++++++++++---
  tests/libqtest.h | 14 ++++++++++++++
  2 files changed, 25 insertions(+), 3 deletions(-)


+    gchar *qmp_params;
      const char *qemu_binary = qtest_qemu_binary();
s = g_new(QTestState, 1); socket_path = g_strdup_printf("/tmp/qtest-%d.sock", getpid());
      qmp_socket_path = g_strdup_printf("/tmp/qtest-%d.qmp", getpid());
+    qmp_params = g_strdup_printf(qmp_format, qmp_socket_path);

Memory leak of qmp_params. Avoided in my rewrite to use bool instead of a format string.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]