[virt-tools-list] [virt-manager PATCH] domain: treat VIR_DOMAIN_CRASHED not as runnable but rather as stoppable

Chen Hanxiao chen_han_xiao at 126.com
Fri Apr 28 08:07:48 UTC 2017


From: Chen Hanxiao <chenhanxiao at gmail.com>

If we set on_crash as `preserve`, we'll get a crashed
VM state.
At this time, it's impossible to start this VM.

Signed-off-by: Chen Hanxiao <chenhanxiao at gmail.com>
---
 virtManager/domain.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/virtManager/domain.py b/virtManager/domain.py
index fc5f54a..3830d22 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -1734,12 +1734,13 @@ class vmmDomain(vmmLibvirtObject):
     def is_stoppable(self):
         return self.status() in [libvirt.VIR_DOMAIN_RUNNING,
                                  libvirt.VIR_DOMAIN_PAUSED,
+                                 libvirt.VIR_DOMAIN_CRASHED,
                                  libvirt.VIR_DOMAIN_PMSUSPENDED]
     def is_destroyable(self):
         return (self.is_stoppable() or
                 self.status() in [libvirt.VIR_DOMAIN_CRASHED])
     def is_runable(self):
-        return self.is_shutoff() or self.is_crashed()
+        return self.is_shutoff()
     def is_pauseable(self):
         return self.status() in [libvirt.VIR_DOMAIN_RUNNING]
     def is_unpauseable(self):
-- 
2.7.4





More information about the virt-tools-list mailing list