[libvirt] [PATCH 0/4] qemu: Don't lose domain on failed restore

Michal Privoznik posted 4 patches 1 week ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1578912437.git.mprivozn@redhat.com
src/qemu/qemu_domain.c | 28 ++++++++++------------------
src/qemu/qemu_domain.h |  1 +
src/qemu/qemu_driver.c | 37 +++++++++++++++++--------------------
3 files changed, 28 insertions(+), 38 deletions(-)

[libvirt] [PATCH 0/4] qemu: Don't lose domain on failed restore

Posted by Michal Privoznik 1 week ago
https://bugzilla.redhat.com/show_bug.cgi?id=1718707

When restoring a domain we might leave a qemu process behind.

The problem is described in 4/4 in more detail, but the digest is: we
start qemu process successfully but then fail to restore its vCPUs and
leave qemu process running and forget about. I thought of two possible
ways to fix this:

1) Kill qemu process and claim error.

2) Don't kill qemu process and don't remove it from our internal list
   and claim error.

I lean towards 1) because I find it clearer. If I were a mgmt app and
call 'virsh restore /path/to/domain.save' then I'd much rather see
either success or an error without any need for cleanup (which would be
implied if we went with number 2).

Michal Prívozník (4):
  qemuDomainSaveImageStartVM: Use VIR_AUTOCLOSE for @intermediatefd
  qemuDomainSaveImageStartVM: Use g_autoptr() for virCommand
  qemu: Use g_autoptr() for qemuDomainSaveCookie
  qemu: Stop domain on failed restore

 src/qemu/qemu_domain.c | 28 ++++++++++------------------
 src/qemu/qemu_domain.h |  1 +
 src/qemu/qemu_driver.c | 37 +++++++++++++++++--------------------
 3 files changed, 28 insertions(+), 38 deletions(-)

-- 
2.24.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 0/4] qemu: Don't lose domain on failed restore

Posted by Daniel Henrique Barboza 1 week ago

On 1/13/20 7:58 AM, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1718707
> 
> When restoring a domain we might leave a qemu process behind.
> 
> The problem is described in 4/4 in more detail, but the digest is: we
> start qemu process successfully but then fail to restore its vCPUs and
> leave qemu process running and forget about. I thought of two possible
> ways to fix this:
> 
> 1) Kill qemu process and claim error.
> 
> 2) Don't kill qemu process and don't remove it from our internal list
>     and claim error.
> 
> I lean towards 1) because I find it clearer. If I were a mgmt app and
> call 'virsh restore /path/to/domain.save' then I'd much rather see
> either success or an error without any need for cleanup (which would be
> implied if we went with number 2).
> 
> Michal Prívozník (4):
>    qemuDomainSaveImageStartVM: Use VIR_AUTOCLOSE for @intermediatefd
>    qemuDomainSaveImageStartVM: Use g_autoptr() for virCommand
>    qemu: Use g_autoptr() for qemuDomainSaveCookie
>    qemu: Stop domain on failed restore


All patches:


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

> 
>   src/qemu/qemu_domain.c | 28 ++++++++++------------------
>   src/qemu/qemu_domain.h |  1 +
>   src/qemu/qemu_driver.c | 37 +++++++++++++++++--------------------
>   3 files changed, 28 insertions(+), 38 deletions(-)
> 


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list