xid: ensure vm is not running
This commit is contained in:
parent
820500a367
commit
3f4ee9f8d9
@ -690,7 +690,10 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
||||
if self.libvirt_domain is None:
|
||||
return -1
|
||||
try:
|
||||
return self.libvirt_domain.ID()
|
||||
if self.is_running():
|
||||
return self.libvirt_domain.ID()
|
||||
else:
|
||||
return -1
|
||||
except libvirt.libvirtError as e:
|
||||
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
|
||||
return -1
|
||||
|
Loading…
Reference in New Issue
Block a user