[libvirt] [libvirt 2/2] remote generator: Legacy support for hyper to long mappings

Eric Blake eblake at redhat.com
Tue May 31 17:08:31 UTC 2011


On 05/30/2011 07:03 AM, Matthias Bolte wrote:
> From 3bb05f7543f86e3b47772f0fabecbda4f167b3bc Mon Sep 17 00:00:00 2001
> From: Matthias Bolte <matthias.bolte at googlemail.com>
> Date: Mon, 30 May 2011 14:36:41 +0200
> Subject: [PATCH] apibuild: Restrict long usage to existing functions and struct
> 
> New APIs have to use long long instead of long.
> 
> Also make apibuild errors fatal.
> ---
>  docs/Makefile.am |    2 +-
>  docs/apibuild.py |   74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 75 insertions(+), 1 deletions(-)

Now reviewing patch 2, assuming that you go with 1B.

> 
> diff --git a/docs/Makefile.am b/docs/Makefile.am
> index 59ae685..a98f08d 100644
> --- a/docs/Makefile.am
> +++ b/docs/Makefile.am
> @@ -179,7 +179,7 @@ $(python_generated_files): $(srcdir)/apibuild.py \
>  		$(srcdir)/../include/libvirt/*.h \
>  		$(srcdir)/../src/libvirt.c \
>  		$(srcdir)/../src/util/virterror.c
> -	-srcdir=$(srcdir) $(srcdir)/apibuild.py
> +	srcdir=$(srcdir) $(srcdir)/apibuild.py

While you're touching this line, how about we also modify it to use
$(AM_V_GEN)

> +++ b/docs/apibuild.py
> @@ -1480,6 +1480,77 @@ class CParser:
>          self.signature = signature
>          return token
>  
> +    # this dict contains the functions that are allowed to use [unsigend]
> +    # long for legacy reasons in their signature and return type. this list is
> +    # fixed. new procedures and public APIs have to use [unsigend] long long

s/unsigend/unsigned/ twice (copy and paste from the last patch? :)

> +    long_legacy_functions = \
> +      { "virGetVersion"                  : (False, ("libVer", "typeVer")),
> +        "virConnectGetLibVersion"        : (False, ("libVer")),
> +        "virConnectGetVersion"           : (False, ("hvVer")),
> +        "virDomainGetMaxMemory"          : (True,  ()),
> +        "virDomainMigrate"               : (False, ("flags", "bandwidth")),
> +        "virDomainMigrate2"              : (False, ("flags", "bandwidth")),
> +        "virDomainMigrateBegin3"         : (False, ("flags", "bandwidth")),

Same query to danpb about whether new migration v3 APIs should avoid
'long', and same independent patch to fix that issue.

> +
> +    # this dict contains the structs that are allowed to use [unsigend]
> +    # long for legacy reasons. this list is fixed. new structs have to use
> +    # [unsigend] long long

s/unsigend/unsigned/ twice

ACK with the spelling nits fixed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110531/d095d58a/attachment-0001.sig>


More information about the libvir-list mailing list