qemu: Stop domain on failed restore
qemu: Stop domain on failed restore

When resuming a domain from a save file, we read the domain XML
from the file, add it onto our internal list of domains, start
the qemu process, let it load the incoming migration stream and
resume its vCPUs afterwards. If anything goes wrong, the domain
object is removed from the list of domains and error is returned
to the caller. However, the qemu process might be left behind -
if resuming vCPUs fails (e.g. because qemu is unable to acquire
write lock on a disk) then due to a bug the qemu process is not
killed but the domain object is removed from the list.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1718707

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Daniel Henrique Barboza <627b089ad62deae9aaf06ccfa2c9056df28927e0@gmail.com>

crobinso/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,libvirt/libvirt,olafhering/libvirt,libvirt/libvirt,crobinso/libvirt,nertpinx/libvirt,olafhering/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,jfehlig/libvirt,zippy2/libvirt,crobinso/libvirt,jardasgit/libvirt,jfehlig/libvirt,libvirt/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,zippy2/libvirt,zippy2/libvirt,olafhering/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,crobinso/libvirt,jardasgit/libvirt,olafhering/libvirt,libvirt/libvirt,nertpinx/libvirt,jardasgit/libvirt,nertpinx/libvirt,zippy2/libvirt,jfehlig/libvirt