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:
parent
7866cfec1b
commit
645edb176d
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue