domain: treat VIR_DOMAIN_CRASHED not as runnable but rather as stoppable

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@gmail.com>
This commit is contained in:
Chen Hanxiao 2017-04-28 16:07:48 +08:00 committed by Cole Robinson
parent 7866cfec1b
commit 645edb176d
1 changed files with 2 additions and 1 deletions

View File

@ -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):