Re: [Qemu-devel] [PATCH v3 03/12] qga: move string split in separate function

2015-08-26 Thread Denis V. Lunev
On 08/26/2015 09:07 PM, Marc-André Lureau wrote: Hi On Wed, Aug 26, 2015 at 7:55 PM, Denis V. Lunev den-li...@parallels.com wrote: it would be much better to declare this helper as split_list(const gchar *str, ... and make temporary copy of parameter inside. Without this the function as NASTY

Re: [Qemu-devel] [PATCH v3 03/12] qga: move string split in separate function

2015-08-26 Thread Marc-André Lureau
Hi On Wed, Aug 26, 2015 at 8:30 PM, Marc-André Lureau marcandre.lur...@gmail.com wrote: the list must then be g_list_free_full() Actually, the ga_command_blacklist_init() doesn't dup the string, so it will have to do it too..tbh, I don't mind either way. -- Marc-André Lureau

Re: [Qemu-devel] [PATCH v3 03/12] qga: move string split in separate function

2015-08-26 Thread Denis V. Lunev
On 08/26/2015 09:30 PM, Marc-André Lureau wrote: Hi On Wed, Aug 26, 2015 at 8:23 PM, Denis V. Lunev den-li...@parallels.com wrote: I think that this side effect is visible if the code remains in place and becomes invisible since you move it to the function. This could create problem if

Re: [Qemu-devel] [PATCH v3 03/12] qga: move string split in separate function

2015-08-26 Thread Marc-André Lureau
Hi On Wed, Aug 26, 2015 at 8:23 PM, Denis V. Lunev den-li...@parallels.com wrote: I think that this side effect is visible if the code remains in place and becomes invisible since you move it to the function. This could create problem if somebody will reuse this call. what about replacing it

Re: [Qemu-devel] [PATCH v3 03/12] qga: move string split in separate function

2015-08-26 Thread Marc-André Lureau
Hi On Wed, Aug 26, 2015 at 7:55 PM, Denis V. Lunev den-li...@parallels.com wrote: it would be much better to declare this helper as split_list(const gchar *str, ... and make temporary copy of parameter inside. Without this the function as NASTY side-effect and trashes the string passed in.

Re: [Qemu-devel] [PATCH v3 03/12] qga: move string split in separate function

2015-08-26 Thread Denis V. Lunev
On 08/26/2015 01:05 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau marcandre.lur...@redhat.com The function is going to be reused in a later patch. Signed-off-by: Marc-André Lureau marcandre.lur...@redhat.com Reviewed-by: Michael Roth mdr...@linux.vnet.ibm.com --- qga/main.c

[Qemu-devel] [PATCH v3 03/12] qga: move string split in separate function

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau marcandre.lur...@redhat.com The function is going to be reused in a later patch. Signed-off-by: Marc-André Lureau marcandre.lur...@redhat.com Reviewed-by: Michael Roth mdr...@linux.vnet.ibm.com --- qga/main.c | 33 ++--- 1 file changed, 22