于 2011年07月14日 01:43, Eric Blake 写道:
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".
Yes, I didn't get a better idea of how to name the enum and the
function, virDomainUndefineFlagValue seems a good idea.
> +++ 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.
Ok, this will be added in v2.
Osier