undefine: Define the new API

This introduces a new API virDomainUndefineFlags to control the
domain undefine process, as the existing API virDomainUndefine
doesn't support flags.

Currently only flag VIR_DOMAIN_UNDEFINE_MANAGED_SAVE is supported.
If the domain has a managed save image, including
VIR_DOMAIN_UNDEFINE_MANAGED_SAVE in @flags will also remove that
file, and omitting the flag will cause undefine process to fail.

This patch also changes the behavior of virDomainUndefine, if the
domain has a managed save image, the undefine will be refused.
This commit is contained in:
Osier Yang
2011-07-20 10:59:54 +08:00
parent f81f63cd04
commit b26a9fa9c2
4 changed files with 78 additions and 1 deletions
+10
View File
@@ -1200,6 +1200,16 @@ int virDomainMemoryPeek (virDomainPtr dom,
virDomainPtr virDomainDefineXML (virConnectPtr conn,
const char *xml);
int virDomainUndefine (virDomainPtr domain);
typedef enum {
VIR_DOMAIN_UNDEFINE_MANAGED_SAVE = (1 << 0),
/* Future undefine control flags should come here. */
} virDomainUndefineFlagsValues;
int virDomainUndefineFlags (virDomainPtr domain,
unsigned int flags);
int virConnectNumOfDefinedDomains (virConnectPtr conn);
int virConnectListDefinedDomains (virConnectPtr conn,
char **const names,