[libvirt] [PATCH] esx: Extend esx_vi_generator.py to cover methods too

Daniel Veillard veillard at redhat.com
Wed Apr 14 09:14:20 UTC 2010


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 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

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list