Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virt: switch domain to Defined once migrated VM is stopped
When the VM is stopped on the source after migration, set VM status to Down and also switch domain to Defined state. The domain is not running and not all calls are available -- some would result in libvirt error. Defined domain will throw virdomain.NotConnectedError which should be handled by the caller. Added handling of this exception into Vm._destroyVm* methods. The methods are not called on not connected domain so this is only a preventive measure to be on the safe side. It would be more practical to change the domain to Defined much sooner, ideally in _handle_libvirt_domain_stopped(). That would avoid any delays especially from calling hooks. But postponing the change and doing it together with state change later makes the behavior more predictable and more consistent. Bug-Url: https://bugzilla.redhat.com/2000046 Signed-off-by: Vojtech Juranek <[email protected]> Signed-off-by: Tomáš Golembiovský <[email protected]>
- Loading branch information