[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] libqtest: escape strings in QMP commands, fix l
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] libqtest: escape strings in QMP commands, fix leak |
Date: |
Wed, 18 Jun 2014 12:06:53 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Jun 13, 2014 at 10:15:00AM +0200, Paolo Bonzini wrote:
> libqtest is using g_strdup_printf to format QMP commands, but
> this does not work if the argument strings need to be escaped.
> Instead, use the fancy %-formatting functionality of QObject.
> The only change required in tests is that strings have to be
> formatted as %s, not '%s' or \"%s\". Luckily this usage of
> parameterized QMP commands is not that frequent.
>
> The leak is in socket_sendf. Since we are extracting the send
> loop to a new function, fix it now.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> tests/fdc-test.c | 2 +-
> tests/libqtest.c | 47 +++++++++++++++++++++++++++++++++++++----------
> tests/qom-test.c | 6 +++---
> tests/tmp105-test.c | 4 ++--
> 4 files changed, 43 insertions(+), 16 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
pgpPe3QBRlpAZ.pgp
Description: PGP signature