[libvirt] [PATCH] esx: Extend esx_vi_generator.py to cover methods too
Matthias Bolte
matthias.bolte at googlemail.com
Wed Apr 14 10:06:13 UTC 2010
2010/4/14 Daniel Veillard <veillard at redhat.com>:
> On Tue, Apr 13, 2010 at 05:33:02PM +0200, Matthias Bolte wrote:
>> Generate almost all SOAP method mapping code.
>>
>> Update the driver code to use the complete paramater list of some methods
>> that had parameters skipped before.
>>
>> Improve the ESX_VI__METHOD marco to do automatic output deserialization
>> based on output occurrence. Also incorporate automatic _this binding and
>> output pointer check.
>> ---
>> src/esx/esx_driver.c | 26 +-
>> src/esx/esx_vi.c | 7 +-
>> src/esx/esx_vi_generator.input | 191 +++++++++-
>> src/esx/esx_vi_generator.py | 489 ++++++++++++++++++------
>> src/esx/esx_vi_methods.c | 854 ++++++----------------------------------
>> src/esx/esx_vi_methods.h | 132 +------
>> 6 files changed, 723 insertions(+), 976 deletions(-)
>>
> [...]
>> diff --git a/src/esx/esx_vi_generator.input b/src/esx/esx_vi_generator.input
>> index 9c545eb..a016c63 100644
>> --- a/src/esx/esx_vi_generator.input
>> +++ b/src/esx/esx_vi_generator.input
>> @@ -28,7 +28,22 @@
>> # - ol for an optional list
>> # - i for an ignored item or list
>> #
>> -# Object member sequence has to match the WSDL sequence
>> +# Object member sequence has to match the WSDL sequence.
>> +#
>> +#
>> +# Method definition:
>> +#
>> +# method <name> [returns <type> <occurrence>]
>> +# <type> <name> <occurrence>
>> +# ...
>> +# end
>> +#
>> +# The _this paramater can have a type attached to it:
>> +#
>> +# _this:<type>
>> +#
>> +# The <type> refers to one of the ServiceContent members. This make the
>> +# generator auto-bind _this to the corresponding ServiceContent member.
> [...]
>> +method CreateFilter returns ManagedObjectReference r
>> + ManagedObjectReference _this:PropertyCollector r
>> + PropertyFilterSpec spec r
>> + Boolean partialUpdates r
>> +end
>
> Once again I really like the clarity of the generator input :-)
The complexity of a method definition in WSDL had deterred me.
I wanted to have something that's simple to write and simple to parse.
> The generator code is of course always a bit hairy, but that's normal.
>
> This makes for a nice cleanup, I also notice a lot of formatting
> changes too,
>
> ACK,
>
> Daniel
>
I just noticed a paramAter vs paramEter typo in this patch and fixed it.
Thanks, pushed.
Matthias
More information about the libvir-list
mailing list