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,6 +483,7 @@ class VMCollection(object):
|
|||||||
raise qubes.exc.QubesVMNotHaltedError(vm)
|
raise qubes.exc.QubesVMNotHaltedError(vm)
|
||||||
self.app.fire_event('domain-pre-delete', pre_event=True, vm=vm)
|
self.app.fire_event('domain-pre-delete', pre_event=True, vm=vm)
|
||||||
try:
|
try:
|
||||||
|
if vm.libvirt_domain:
|
||||||
vm.libvirt_domain.undefine()
|
vm.libvirt_domain.undefine()
|
||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
vm._libvirt_domain = None
|
vm._libvirt_domain = None
|
||||||
|
@ -570,6 +570,9 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
if self._libvirt_domain is not None:
|
if self._libvirt_domain is not None:
|
||||||
return self._libvirt_domain
|
return self._libvirt_domain
|
||||||
|
|
||||||
|
if self.app.vmm.offline_mode:
|
||||||
|
return None
|
||||||
|
|
||||||
# XXX _update_libvirt_domain?
|
# XXX _update_libvirt_domain?
|
||||||
try:
|
try:
|
||||||
self._libvirt_domain = self.app.vmm.libvirt_conn.lookupByUUID(
|
self._libvirt_domain = self.app.vmm.libvirt_conn.lookupByUUID(
|
||||||
|
Loading…
Reference in New Issue
Block a user