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

Re: [libvirt] [PATCH 2/8] UndefineFlags: Define the public API



On 07/13/2011 04:19 AM, Osier Yang wrote:
> Only support to remove domain managed state file when undefining

s/to remove/removing/

> the domain currently.
> ---
>  include/libvirt/libvirt.h.in |   10 ++++++++++
>  python/generator.py          |    1 +
>  src/libvirt_public.syms      |    5 +++++
>  3 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> index d5a7105..98f1454 100644
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -1200,6 +1200,16 @@ int                     virDomainMemoryPeek (virDomainPtr dom,
>  virDomainPtr            virDomainDefineXML      (virConnectPtr conn,
>                                                   const char *xml);
>  int                     virDomainUndefine       (virDomainPtr domain);
> +
> +/* Domain undefine flags */
> +typedef enum {
> +    VIR_DOMAIN_UNDEFINE_MANAGED_STATE = 1,
> +
> +    /* Future undefine control flags should come here */
> +} virDomainUndefineFlags;
> +
> +int                     virDomainUndefineWithFlags  (virDomainPtr domain,
> +                                                     unsigned int flags);

I'm not sure I like the "WithFlags" name.  We _had_ to use it on
virDomainCreateWithFlags, because the public name virDomainCreateFlags
was already in existence.  But here, you could just as easily go with:

typedef enum { ...
} virDomainUndefineFlagValues;

int virDomainUndefineFlags(virDomainPtr domain, unsigned int flags);

and avoid the extra "With".

> +++ b/python/generator.py
> @@ -366,6 +366,7 @@ skip_impl = (
>      'virDomainSendKey',
>      'virNodeGetCPUStats',
>      'virNodeGetMemoryStats',
> +    'virDomainUndefineWithFlags',

Why does this have to be skipped?  virDomainUndefine is not skipped, and
it seems like having python bindings for this new function would be
worthwhile.

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

Attachment: signature.asc
Description: OpenPGP digital signature


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