qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v2 28/47] qapi-commands: Convert to QAPISche


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH RFC v2 28/47] qapi-commands: Convert to QAPISchemaVisitor
Date: Mon, 27 Jul 2015 20:08:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 07/01/2015 02:22 PM, Markus Armbruster wrote:
>> Output unchanged except for white-space.
>
> Indeed, and the diffstat shows it was only one blank line:
>
>  qga-qmp-marshal.c |    1 +
>  1 file changed, 1 insertion(+)
>
> MUCH friendlier to review :)
>
>> 
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>>  scripts/qapi-commands.py | 157
>> ++++++++++++++++++++++++++---------------------
>>  scripts/qapi.py          |   2 +-
>>  2 files changed, 87 insertions(+), 72 deletions(-)
>> 
>
> Here, I can confidently say:
>
> Reviewed-by: Eric Blake <address@hidden>

Thanks!

>> +++ b/scripts/qapi.py
>> @@ -1366,7 +1366,7 @@ def c_type(value, is_param=False):
>>          return c_name(value) + pointer_suffix
>>  
>>  def is_c_ptr(value):
>> -    return c_type(value).endswith(pointer_suffix)
>> +    return value.endswith(pointer_suffix)
>
> Perhaps this cleanup could be floated earlier in the series?

Before this patch, is_c_ptr() is called with an argument suitable for
c_type().  It returns true when c_type() returns a string ending with
pointer_suffix.

This patch replaces uses of function c_type() by QAPISchemaType method
c_type().

Two ways to do that for the is_c_ptr() calls:

1. Change the argument to a QAPISchemaType object, and make is_c_ptr()
call its .c_type().

2. Change the argument to a string, and make the caller compute it by
calling the appropriate object's .c_type().

I picked 2.  It hardly matters, because is_c_ptr() will go away in the
next patch.

I could do a part of 2. in an earlier patch, namely lifting the c_type()
call into the callers.  But I can't do the conversion from function to
method any earlier, because the objects become available only in this
patch.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]