Avoid libvirt access in qubes.vm.qubesvm.QubesVM
This commit is contained in:
parent
1ff1ca37a1
commit
bba9b38e8e
@ -1099,7 +1099,11 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
:param qubes.vm.qubesvm.QubesVM src: source VM
|
:param qubes.vm.qubesvm.QubesVM src: source VM
|
||||||
'''
|
'''
|
||||||
|
|
||||||
if not self.is_halted():
|
# If the current vm name is not a part of `self.app.domains.keys()`,
|
||||||
|
# then the current vm is in creation process. Calling
|
||||||
|
# `self.is_halted()` at this point, would instantiate libvirt, we want
|
||||||
|
# avoid that.
|
||||||
|
if self.name in self.app.domains.keys() and not self.is_halted():
|
||||||
raise qubes.exc.QubesVMNotHaltedError(
|
raise qubes.exc.QubesVMNotHaltedError(
|
||||||
self, 'Cannot clone a running domain {!r}'.format(self.name))
|
self, 'Cannot clone a running domain {!r}'.format(self.name))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user