log: fix parsing of multiple trace:PATTERN log args
commit89d0a64f496fb4248885ebf75216c49337951540
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 6 Sep 2016 18:25:43 +0000 (6 19:25 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 14 Sep 2016 20:52:44 +0000 (14 22:52 +0200)
tree8d133c9c26cc6c8a0dc5d720e841c2c6996b8d32
parent71200fb9664c2967a1cdd22b68b0da3a8b2b3eb7
log: fix parsing of multiple trace:PATTERN log args

If giving QEMU a log arg which asks to enable multiple
different trace event patterns such as

  $QEMU -d trace:qio*,trace:qcrypto*

the parser will then invoke

  trace_enable_events("qio*,trace:qcrypto*")
  trace_enable_events("qcrypto*")

as when finding a 'trace:' prefix, it is not clever
enough to strip anything after the next comma. As
a result only the last 'trace:' match ever works.

Rather than trying to be more clever with parsing the
command line arg in place, simplify the code by
using g_strsplit to break it into individual strings
on ','. These resulting pieces can be directly used
without worrying about trailing data from the next
option.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1473186343-16704-1-git-send-email-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
util/log.c