[libvirt] [PATCH] nwfilter: drop unused flag argument

Stefan Berger stefanb at linux.vnet.ibm.com
Thu May 12 00:16:12 UTC 2011


On 05/11/2011 06:32 PM, Eric Blake wrote:
> The public API has no flags argument, so neither should the internal
> callback API.  This simplifies the RPC generator.
>
> * src/driver.h (virDrvNWFilterDefineXML): Drop argument that does
> not match public API.
> * src/nwfilter/nwfilter_driver.c (nwfilterDefine): Likewise.
> * src/libvirt.c (virNWFilterDefineXML): Likewise.
> * daemon/remote_generator.pl: Drop special case.
> ---
>
> The comment in the generator was a bit off - the public API had
> no flags argument, just the internal callback API.
>
>   daemon/remote_generator.pl     |    6 ------
>   src/driver.h                   |    3 +--
>   src/libvirt.c                  |    2 +-
>   src/nwfilter/nwfilter_driver.c |    6 +++---
>   4 files changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl
> index bce6261..c53ebc8 100755
> --- a/daemon/remote_generator.pl
> +++ b/daemon/remote_generator.pl
> @@ -879,12 +879,6 @@ elsif ($opt_k) {
>               push(@args_list, "virConnectPtr conn");
>           }
>
> -        if ($call->{ProcName} eq "NWFilterDefineXML") {
> -            # SPECIAL: virNWFilterDefineXML has a flags parameter in the
> -            #          public API that is missing in the XDR protocol
> -            push(@args_list, "unsigned int flags ATTRIBUTE_UNUSED");
> -        }
> -
>           # fix priv_name for the NumOf* functions
>           if ($priv_name eq "privateData" and
>               !($call->{ProcName} =~ m/(Domains|DomainSnapshot)/) and
> diff --git a/src/driver.h b/src/driver.h
> index 5cd0cea..ea80701 100644
> --- a/src/driver.h
> +++ b/src/driver.h
> @@ -1181,8 +1181,7 @@ typedef virNWFilterPtr
>                                                  const unsigned char *uuid);
>   typedef virNWFilterPtr
>       (*virDrvNWFilterDefineXML)                (virConnectPtr conn,
> -                                               const char *xmlDesc,
> -                                               unsigned int flags);
> +                                               const char *xmlDesc);
>   typedef int
>       (*virDrvNWFilterUndefine)                 (virNWFilterPtr nwfilter);
>
> diff --git a/src/libvirt.c b/src/libvirt.c
> index 0726df4..7564db0 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -12253,7 +12253,7 @@ virNWFilterDefineXML(virConnectPtr conn, const char *xmlDesc)
>
>       if (conn->nwfilterDriver&&  conn->nwfilterDriver->defineXML) {
>           virNWFilterPtr ret;
> -        ret = conn->nwfilterDriver->defineXML (conn, xmlDesc, 0);
> +        ret = conn->nwfilterDriver->defineXML (conn, xmlDesc);
>           if (!ret)
>               goto error;
>           return ret;
> diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
> index 17af7a6..18ea752 100644
> --- a/src/nwfilter/nwfilter_driver.c
> +++ b/src/nwfilter/nwfilter_driver.c
> @@ -2,7 +2,7 @@
>    * nwfilter_driver.c: core driver for network filter APIs
>    *                    (based on storage_driver.c)
>    *
> - * Copyright (C) 2006-2010 Red Hat, Inc.
> + * Copyright (C) 2006-2011 Red Hat, Inc.
>    * Copyright (C) 2006-2008 Daniel P. Berrange
>    * Copyright (C) 2010 IBM Corporation
>    * Copyright (C) 2010 Stefan Berger
> @@ -327,8 +327,8 @@ nwfilterListNWFilters(virConnectPtr conn,
>
>   static virNWFilterPtr
>   nwfilterDefine(virConnectPtr conn,
> -               const char *xml,
> -               unsigned int flags ATTRIBUTE_UNUSED) {
> +               const char *xml)
> +{
>       virNWFilterDriverStatePtr driver = conn->nwfilterPrivateData;
>       virNWFilterDefPtr def;
>       virNWFilterObjPtr nwfilter = NULL;
I assume this causes not interoperability problems between libvirt 
versions. I initially introduced the flag because other define functions 
had it also and thought I'd leave the option of having flags open.

  ACK

   Stefan




More information about the libvir-list mailing list