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

Re: [libvirt] [PATCH 01/13] destroy: Define new public API virDomainDestroyWithFlags

于 2011年07月21日 19:13, Daniel P. Berrange 写道:
On Thu, Jul 21, 2011 at 11:28:28AM +0200, Michal Privoznik wrote:
This introduces new API virDomainDestroyWithFlags to allow
domain destroying with flags, as the existing API virDomainDestroy
misses flags.

The set of flags is defined in virDomainDestroyFlags enum, which is
currently commented, because it is empty.

Calling this API with no flags set (@flags == 0) is equivalent calling
  include/libvirt/libvirt.h.in |    7 +++++
  src/driver.h                 |    4 +++
  src/libvirt.c                |   52 ++++++++++++++++++++++++++++++++++++++++++
  src/libvirt_public.syms      |    1 +
  4 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 6afd591..0a06684 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -913,6 +913,11 @@ virConnectPtr           virDomainGetConnect     (virDomainPtr domain);
   * Domain creation and destruction
+ * typedef enum {
+ * } virDomainDestroyFlags;
+ */
  virDomainPtr            virDomainCreateXML      (virConnectPtr conn,
                                                   const char *xmlDesc,
                                                   unsigned int flags);
@@ -929,6 +934,8 @@ int                     virDomainShutdown       (virDomainPtr domain);
  int                     virDomainReboot         (virDomainPtr domain,
                                                   unsigned int flags);
  int                     virDomainDestroy        (virDomainPtr domain);
+int                     virDomainDestroyWithFlags(virDomainPtr domain,
+                                                  unsigned int flags);
This is not our usual naming convention. I'd expect the API to
be named  'virDomainDestroyFlags', and give the enum a different
typedef name.


For domainUndefine, the enum is named as virDomainUndefineFlagsValues,
so that we can have the API named virDomainUndefineFlags.


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