* [Qemu-devel] [PATCH v2] trace: Fix 'char **' compilation error in simple backend
@ 2016-10-26 3:50 Fam Zheng
2016-10-26 13:18 ` Eric Blake
0 siblings, 1 reply; 3+ messages in thread
From: Fam Zheng @ 2016-10-26 3:50 UTC (permalink / raw)
To: qemu-devel; +Cc: Eric Blake, Stefan Hajnoczi
Currently, the generated function body will do "strlen(arg)" but the
argument could be 'char **' or 'char * const *'. Avoid that by excluding
such cases in is_string check.
Reported by patchew's "make docker-test-mingw@fedora".
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
v2: Fix typo in commit message and "yeah we'll be counting stars". [Eric]
---
scripts/tracetool/backend/simple.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index 9885e83..85f6102 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -21,7 +21,8 @@ PUBLIC = True
def is_string(arg):
strtype = ('const char*', 'char*', 'const char *', 'char *')
- if arg.lstrip().startswith(strtype):
+ arg_strip = arg.lstrip()
+ if arg_strip.startswith(strtype) and arg_strip.count('*') == 1:
return True
else:
return False
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] trace: Fix 'char **' compilation error in simple backend
2016-10-26 3:50 [Qemu-devel] [PATCH v2] trace: Fix 'char **' compilation error in simple backend Fam Zheng
@ 2016-10-26 13:18 ` Eric Blake
2016-10-28 8:58 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2016-10-26 13:18 UTC (permalink / raw)
To: Fam Zheng, qemu-devel; +Cc: Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 745 bytes --]
On 10/25/2016 10:50 PM, Fam Zheng wrote:
> Currently, the generated function body will do "strlen(arg)" but the
> argument could be 'char **' or 'char * const *'. Avoid that by excluding
> such cases in is_string check.
>
> Reported by patchew's "make docker-test-mingw@fedora".
>
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Fam Zheng <famz@redhat.com>
>
> ---
>
> v2: Fix typo in commit message and "yeah we'll be counting stars". [Eric]
I may have had the vague idea, but you eloquently framed it into code,
and let me learn in the process :)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] trace: Fix 'char **' compilation error in simple backend
2016-10-26 13:18 ` Eric Blake
@ 2016-10-28 8:58 ` Peter Maydell
0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-10-28 8:58 UTC (permalink / raw)
To: Eric Blake; +Cc: Fam Zheng, QEMU Developers, Stefan Hajnoczi
On 26 October 2016 at 14:18, Eric Blake <eblake@redhat.com> wrote:
> On 10/25/2016 10:50 PM, Fam Zheng wrote:
>> Currently, the generated function body will do "strlen(arg)" but the
>> argument could be 'char **' or 'char * const *'. Avoid that by excluding
>> such cases in is_string check.
>>
>> Reported by patchew's "make docker-test-mingw@fedora".
>>
>> Suggested-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Fam Zheng <famz@redhat.com>
>>
>> ---
>>
>> v2: Fix typo in commit message and "yeah we'll be counting stars". [Eric]
>
> I may have had the vague idea, but you eloquently framed it into code,
> and let me learn in the process :)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
Applied to master as a buildfix, thanks (though it looks like there
is also a trace related compile failure for the UST backend,
so this alone won't be enough to bring travis back to all-green).
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-28 8:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-26 3:50 [Qemu-devel] [PATCH v2] trace: Fix 'char **' compilation error in simple backend Fam Zheng
2016-10-26 13:18 ` Eric Blake
2016-10-28 8:58 ` Peter Maydell
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.