Re: [Qemu-devel] [PATCH v5 5/9] qemu-log: support simple pid substitution in logfile

2016-02-05 Thread Alex Bennée
Eric Blake writes: > On 02/04/2016 03:26 PM, Richard Henderson wrote: >> On 02/05/2016 01:56 AM, Alex Bennée wrote: >>> +if (g_strrstr(filename, "%d")) { >>> +/* if we are going to format this we'd better validate first */ >>> +if (g_regex_match_simple("^[^%]+%d[^%]+$", filen

Re: [Qemu-devel] [PATCH v5 5/9] qemu-log: support simple pid substitution in logfile

2016-02-04 Thread Eric Blake
On 02/04/2016 03:26 PM, Richard Henderson wrote: > On 02/05/2016 01:56 AM, Alex Bennée wrote: >> +if (g_strrstr(filename, "%d")) { >> +/* if we are going to format this we'd better validate first */ >> +if (g_regex_match_simple("^[^%]+%d[^%]+$", filename, 0, 0)) { > > Why g_str

Re: [Qemu-devel] [PATCH v5 5/9] qemu-log: support simple pid substitution in logfile

2016-02-04 Thread Richard Henderson
On 02/05/2016 01:56 AM, Alex Bennée wrote: +if (g_strrstr(filename, "%d")) { +/* if we are going to format this we'd better validate first */ +if (g_regex_match_simple("^[^%]+%d[^%]+$", filename, 0, 0)) { Why g_strrstr instead of strstr? There should be only one, so why loo

[Qemu-devel] [PATCH v5 5/9] qemu-log: support simple pid substitution in logfile

2016-02-04 Thread Alex Bennée
When debugging stuff that occurs over several forks it would be useful not to keep overwriting the one logfile you've set-up. This allows a simple %d to be included once in the logfile parameter which is substituted with getpid(). Signed-off-by: Alex Bennée Reviewed-by: Leandro Dorileo Reviewed-