qubesvm: do not try to define libvirt object in offline mode
The idea is to not touch libvirt at all.
This commit is contained in:
parent
f2b9be3607
commit
dce3b609b4
@ -483,7 +483,8 @@ class VMCollection(object):
|
||||
raise qubes.exc.QubesVMNotHaltedError(vm)
|
||||
self.app.fire_event('domain-pre-delete', pre_event=True, vm=vm)
|
||||
try:
|
||||
vm.libvirt_domain.undefine()
|
||||
if vm.libvirt_domain:
|
||||
vm.libvirt_domain.undefine()
|
||||
# pylint: disable=protected-access
|
||||
vm._libvirt_domain = None
|
||||
except libvirt.libvirtError as e:
|
||||
|
@ -570,6 +570,9 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
||||
if self._libvirt_domain is not None:
|
||||
return self._libvirt_domain
|
||||
|
||||
if self.app.vmm.offline_mode:
|
||||
return None
|
||||
|
||||
# XXX _update_libvirt_domain?
|
||||
try:
|
||||
self._libvirt_domain = self.app.vmm.libvirt_conn.lookupByUUID(
|
||||
|
Loading…
Reference in New Issue
Block a user