Re: [PATCH v1 7/9] plugins: add API to return a name for a IO device

2020-06-09 Thread Emilio G. Cota
On Tue, Jun 09, 2020 at 12:09:54 +0100, Alex Bennée wrote: > How about a g_intern_string() as a non-freeable const char that can also > be treated as canonical? I like it. Didn't know about g_intern_string (I see it's implemented as an append-only hash table protected by a lock). Cheers,

Re: [PATCH v1 7/9] plugins: add API to return a name for a IO device

2020-06-09 Thread Alex Bennée
Emilio G. Cota writes: > On Mon, Jun 08, 2020 at 09:06:17 +0100, Alex Bennée wrote: >> Emilio G. Cota writes: >> > I'd rather use asprintf(3) and strdup(3) here, so that plugins don't >> > have to worry about glib, and on the QEMU side we don't have to worry >> > about plugins calling free() i

Re: [PATCH v1 7/9] plugins: add API to return a name for a IO device

2020-06-08 Thread Emilio G. Cota
On Mon, Jun 08, 2020 at 09:06:17 +0100, Alex Bennée wrote: > Emilio G. Cota writes: > > I'd rather use asprintf(3) and strdup(3) here, so that plugins don't > > have to worry about glib, and on the QEMU side we don't have to worry > > about plugins calling free() instead of g_free(). > > AFAIK yo

Re: [PATCH v1 7/9] plugins: add API to return a name for a IO device

2020-06-08 Thread Alex Bennée
Emilio G. Cota writes: > On Tue, Jun 02, 2020 at 16:46:22 +0100, Alex Bennée wrote: >> This may well end up being anonymous but it should always be unique. >> >> Signed-off-by: Alex Bennée >> --- >> include/qemu/qemu-plugin.h | 5 + >> plugins/api.c | 18 ++

Re: [PATCH v1 7/9] plugins: add API to return a name for a IO device

2020-06-07 Thread Philippe Mathieu-Daudé
On 6/8/20 5:45 AM, Emilio G. Cota wrote: > On Tue, Jun 02, 2020 at 16:46:22 +0100, Alex Bennée wrote: >> This may well end up being anonymous but it should always be unique. >> >> Signed-off-by: Alex Bennée >> --- >> include/qemu/qemu-plugin.h | 5 + >> plugins/api.c | 18

Re: [PATCH v1 7/9] plugins: add API to return a name for a IO device

2020-06-07 Thread Emilio G. Cota
On Tue, Jun 02, 2020 at 16:46:22 +0100, Alex Bennée wrote: > This may well end up being anonymous but it should always be unique. > > Signed-off-by: Alex Bennée > --- > include/qemu/qemu-plugin.h | 5 + > plugins/api.c | 18 ++ > 2 files changed, 23 insertions(+

Re: [PATCH v1 7/9] plugins: add API to return a name for a IO device

2020-06-02 Thread Clement Deschamps
On 6/2/20 5:46 PM, Alex Bennée wrote: This may well end up being anonymous but it should always be unique. Signed-off-by: Alex Bennée --- include/qemu/qemu-plugin.h | 5 + plugins/api.c | 18 ++ 2 files changed, 23 insertions(+) diff --git a/include/qem

[PATCH v1 7/9] plugins: add API to return a name for a IO device

2020-06-02 Thread Alex Bennée
This may well end up being anonymous but it should always be unique. Signed-off-by: Alex Bennée --- include/qemu/qemu-plugin.h | 5 + plugins/api.c | 18 ++ 2 files changed, 23 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h i