[libvirt] [RFC PATCH 1/4] libvirt: add VIR_DOMAIN_START_PERSISTENT flag

Doug Goldstein cardoe at cardoe.com
Fri Feb 22 17:40:32 UTC 2013


Added a VIR_DOMAIN_START_PERSISTENT flag for virDomainCreateXML() so
that the guest remains defined after it is destroyed. The result of
using this flag is equivilent to calling virDomainDefineXML() followed
by virDomainCreate() or virDomainCreateWithFlags().
---

Not sure if this is the correct place to add "Since 1.0.3 (likely 1.0.4)"

---
 include/libvirt/libvirt.h.in | 1 +
 src/libvirt.c                | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index ad30cd0..e119215 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -336,6 +336,7 @@ typedef enum {
     VIR_DOMAIN_START_AUTODESTROY  = 1 << 1, /* Automatically kill guest when virConnectPtr is closed */
     VIR_DOMAIN_START_BYPASS_CACHE = 1 << 2, /* Avoid file system cache pollution */
     VIR_DOMAIN_START_FORCE_BOOT   = 1 << 3, /* Boot, discarding any managed save */
+    VIR_DOMAIN_START_PERSISTENT   = 1 << 4, /* Define guest to exist after it is destroyed */
 } virDomainCreateFlags;
 
 
diff --git a/src/libvirt.c b/src/libvirt.c
index 1e78500..abe59cd 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1951,6 +1951,10 @@ virDomainGetConnect(virDomainPtr dom)
  * is destroyed, or if the host is restarted (see virDomainDefineXML() to
  * define persistent domains).
  *
+ * If the VIR_DOMAIN_START_PERSISTENT flag is set, the guest domain
+ * will remain defined even after the guest is destroyed. This is
+ * similar to if you had called virDomainDefineXML() and virDomainCreate().
+ *
  * If the VIR_DOMAIN_START_PAUSED flag is set, the guest domain
  * will be started, but its CPUs will remain paused. The CPUs
  * can later be manually started using virDomainResume.
-- 
1.7.12.4




More information about the libvir-list mailing list