[PATCH v2 01/10] conf, virsh: Add new domain shutoff reason

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

 



This new reason means the domain is shutoff because parsing of the XML
failed while daemon was starting and from user's point of view, there's
nothing else to do with it other than re-defining it.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 include/libvirt/libvirt-domain.h | 2 ++
 src/conf/domain_conf.c           | 3 ++-
 tools/virsh-domain-monitor.c     | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index a1ea6a5d0786..37aa6db85cda 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -142,6 +142,8 @@ typedef enum {
     VIR_DOMAIN_SHUTOFF_FAILED = 6,      /* domain failed to start */
     VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT = 7, /* restored from a snapshot which was
                                            * taken while domain was shutoff */
+    VIR_DOMAIN_SHUTOFF_INVALID_XML = 8, /* Domain XML failed to load for some
+                                         * reason, it needs to be re-defined */
 # ifdef VIR_ENUM_SENTINELS
     VIR_DOMAIN_SHUTOFF_LAST
 # endif
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e6102a0b4254..d21e8cbd9d11 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -706,7 +706,8 @@ VIR_ENUM_IMPL(virDomainShutoffReason, VIR_DOMAIN_SHUTOFF_LAST,
               "migrated",
               "saved",
               "failed",
-              "from snapshot")
+              "from snapshot",
+              "invalid XML")

 VIR_ENUM_IMPL(virDomainCrashedReason, VIR_DOMAIN_CRASHED_LAST,
               "unknown",
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 64ec03dfc0cb..db5bf4b2a566 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -218,7 +218,8 @@ VIR_ENUM_IMPL(virshDomainShutoffReason,
               N_("migrated"),
               N_("saved"),
               N_("failed"),
-              N_("from snapshot"))
+              N_("from snapshot"),
+              N_("invalid XML"))

 VIR_ENUM_DECL(virshDomainCrashedReason)
 VIR_ENUM_IMPL(virshDomainCrashedReason,
-- 
2.6.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]