All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: QEMU <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 33/37] tests: add qtest_add_data_func_full
Date: Fri, 29 Jul 2016 12:48:27 +0400	[thread overview]
Message-ID: <CAJ+F1CKevUBxf+AUnSUAX8MSc_ScDHea1-VDZsz6=fHm7NXRNA@mail.gmail.com> (raw)
In-Reply-To: <579A8427.1060306@redhat.com>

Hi

On Fri, Jul 29, 2016 at 2:16 AM, Eric Blake <eblake@redhat.com> wrote:
> On 07/28/2016 08:38 AM, marcandre.lureau@redhat.com wrote:
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Allows to specify a destroy function for the test data.
>
> "Allows to" is not idiomatic English. Alternatives that sound better are
> "Allows $who to specify" (most simply, "Allows one to"), or "Allows
> specifying"
>
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>  tests/libqtest.c | 15 ++++++++++++++-
>>  tests/libqtest.h |  7 ++++++-
>>  2 files changed, 20 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/libqtest.c b/tests/libqtest.c
>> index eb00f13..6ec56a6 100644
>> --- a/tests/libqtest.c
>> +++ b/tests/libqtest.c
>> @@ -758,8 +758,21 @@ void qtest_add_func(const char *str, void (*fn)(void))
>>      g_free(path);
>>  }
>>
>> +void qtest_add_data_func_full(const char *str, void *data,
>> +                              void (*fn)(const void *),
>> +                              GDestroyNotify data_free_func)
>> +{
>> +#if GLIB_CHECK_VERSION(2, 34, 0)
>> +    gchar *path = g_strdup_printf("/%s/%s", qtest_get_arch(), str);
>> +    g_test_add_data_func_full(path, data, fn, data_free_func);
>> +    g_free(path);
>> +#else
>> +    qtest_add_data_func(str, data, fn);
>> +#endif
>
> The commit message doesn't mention that the code is dependent on glib
> versions, nor that you are still leaking the data (data_free_func
> remains uncalled) on older glib.  If it is intentional (under the
> argument that "anyone running on older glib can't care too much about
> memory leaks encountered only by the testsuite, and the leaks don't
> affect main qemu"), then stating that in the commit message would let me
> feel more comfortable giving an R-b.

ok

> Is there anything we can do even in older glib to unconditionally invoke
> the cleanup function in the right places?

Yes, calling the undocumented g_test_add_vtable(), with some casts. Is
that acceptable?

-- 
Marc-André Lureau

  reply	other threads:[~2016-07-29  8:48 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 14:37 [Qemu-devel] [PATCH v2 00/37] Various memory leak fixes marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 01/37] build-sys: use an override for CFLAGS filter marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 02/37] tests: fix test-qga leaks marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 03/37] qga: free the whole blacklist marcandre.lureau
2016-07-28 21:18   ` Eric Blake
2016-07-28 21:36     ` Marc-André Lureau
2016-07-28 21:39       ` Eric Blake
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 04/37] qga: free remaining leaking state marcandre.lureau
2016-07-28 21:22   ` Eric Blake
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 05/37] tests: fix test-cutils leaks marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 06/37] tests: fix test-vmstate leaks marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 07/37] tests: fix test-iov leaks marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 08/37] qdist: fix entries memory leak marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 09/37] tests: fix check-qom-interface leaks marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 10/37] tests: fix check-qom-proplist leaks marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 11/37] tests: fix small leak in test-io-channel-command marcandre.lureau
2016-07-28 21:44   ` Eric Blake
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 12/37] tests: fix leak in test-string-input-visitor marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 13/37] portio: keep references on portio marcandre.lureau
2016-08-01 12:42   ` Paolo Bonzini
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 14/37] numa: do not leak NumaOptions marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 15/37] pc: simplify passing qemu_irq marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 16/37] pc: don't leak a20_line marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 17/37] machine: use class base init generated name marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 18/37] acpi-build: fix array leak marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 19/37] char: disconnect peer when qemu_chr_free() marcandre.lureau
2016-07-28 21:49   ` Eric Blake
2016-08-01 12:48   ` Paolo Bonzini
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 20/37] char: free MuxDriver when closing marcandre.lureau
2016-07-28 22:02   ` Eric Blake
2016-08-01 12:50   ` Paolo Bonzini
2016-08-01 12:52     ` Paolo Bonzini
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 21/37] tests: fix qom-test leaks marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 22/37] pc: free i8259 marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 23/37] pc: keep gsi reference marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 24/37] ahci: free irqs array marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 25/37] sd: free timer marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 26/37] qjson: free str marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 27/37] virtio-input: free config list marcandre.lureau
2016-07-28 14:37 ` [Qemu-devel] [PATCH v2 28/37] ipmi: free extern timer marcandre.lureau
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 29/37] usb: free USBDevice.strings marcandre.lureau
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 30/37] tests: free a bunch of qmp responses marcandre.lureau
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 31/37] usb: free leaking path marcandre.lureau
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 32/37] bus: simplify name handling marcandre.lureau
2016-07-28 22:05   ` Eric Blake
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 33/37] tests: add qtest_add_data_func_full marcandre.lureau
2016-07-28 22:16   ` Eric Blake
2016-07-29  8:48     ` Marc-André Lureau [this message]
2016-08-01 12:53       ` Eric Blake
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 34/37] tests: pc-cpu-test leaks fixes marcandre.lureau
2016-07-28 22:17   ` Eric Blake
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 35/37] tests: fix rsp leak in postcopy-test marcandre.lureau
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 36/37] ahci: fix sglist leak on retry marcandre.lureau
2016-07-28 14:38 ` [Qemu-devel] [PATCH v2 37/37] tests: fix postcopy-test leaks marcandre.lureau
2016-07-28 22:18   ` Eric Blake
2016-07-28 21:49 ` [Qemu-devel] [PATCH v2 00/37] Various memory leak fixes Eric Blake

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='CAJ+F1CKevUBxf+AUnSUAX8MSc_ScDHea1-VDZsz6=fHm7NXRNA@mail.gmail.com' \
    --to=marcandre.lureau@gmail.com \
    --cc=eblake@redhat.com \
    --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 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.