Commit 969a6d4
committed
libvirt: Simplify '_create_domain' function
This is actually two functions, one of which takes an XML string and
another than takes an existing domain. Neither return a domain but
rather a Guest object, and while the first actually creates a new domain
along with the new Guest, the latter simply creates the new Guest and
resumes the existing domain. Simplify the function by ensuring it only
focuses on the former case, creation of new domains as part of the new
Guest object. The revised function is renamed, along with a related
function, '_create_domain_and_network', to reflect what it actually
returns. The other cases are replaced by simple call to
'Guest.resume()', which is all the latter case was really doing.
While we're here, we also update the function signature of the later to
make the 'block_device_info' argument mandatory, since all callers were
passing this anyway. All of this has some test impact but nothing
serious.
We also move some of the tests from 'test_driver' to 'test_guest', since
they were actually testing things from 'virt.libvirt.guest' but clearly
just weren't moved when that module was introduced many cycles ago.
Finally, we rename the '_prepare_domain_for_snapshot' and
'_snapshot_domain' functions to reflect what they're actually doing,
namely suspending and then resuming the domain before and after a
(cold) snapshot, respectively.
Part of blueprint add-emulated-virtual-tpm
Change-Id: I2489bf16dabc8a83b2044139247f4245ae29adb1
Signed-off-by: Stephen Finucane <[email protected]>1 parent 057891a commit 969a6d4
File tree
4 files changed
+281
-281
lines changed- nova
- tests/unit/virt
- libvirt
- virt/libvirt
4 files changed
+281
-281
lines changed
0 commit comments