mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-10 12:58:27 +03:00
We can't clone a VM in some scenarios,
such as a VM is active. This patch will disable 'Clone' label in VMActionMenu if we can't clone a VM, as same as we did for 'Clone' button in clone ui page. Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
This commit is contained in:
parent
561f5cd3e6
commit
b7eb3e57ea
@ -1655,6 +1655,10 @@ class vmmDomain(vmmLibvirtObject):
|
||||
return self.status() in [libvirt.VIR_DOMAIN_PAUSED]
|
||||
def is_paused(self):
|
||||
return self.status() in [libvirt.VIR_DOMAIN_PAUSED]
|
||||
def is_clonable(self):
|
||||
return self.status() in [libvirt.VIR_DOMAIN_SHUTOFF,
|
||||
libvirt.VIR_DOMAIN_PAUSED,
|
||||
libvirt.VIR_DOMAIN_PMSUSPENDED]
|
||||
|
||||
def run_status(self):
|
||||
return self.pretty_run_status(self.status(), self.has_managed_save())
|
||||
|
@ -128,7 +128,7 @@ class VMActionMenu(_VMMenu):
|
||||
"suspend": bool(vm and vm.is_stoppable()),
|
||||
"resume": bool(vm and vm.is_paused()),
|
||||
"migrate": bool(vm and vm.is_stoppable()),
|
||||
"clone": True,
|
||||
"clone": bool(vm and vm.is_clonable()),
|
||||
}
|
||||
vismap = {
|
||||
"suspend": bool(vm and not vm.is_paused()),
|
||||
|
Loading…
x
Reference in New Issue
Block a user