]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Monitor nbdkit process for exit
authorJonathon Jongsma <jjongsma@redhat.com>
Wed, 5 Oct 2022 17:03:33 +0000 (12:03 -0500)
committerJonathon Jongsma <jjongsma@redhat.com>
Tue, 19 Sep 2023 19:28:50 +0000 (14:28 -0500)
commit447e09dfdbbc2a930a7ad867454a678f631f70ed
tree3e7f915d8e86485b313b18c4866b95d59d292899
parent8836f331d7c703483d7c1489b938f33cb6f9a268
qemu: Monitor nbdkit process for exit

Adds the ability to monitor the nbdkit process so that we can take
action in case the child exits unexpectedly.

When the nbdkit process exits, we pause the vm, restart nbdkit, and then
resume the vm. This allows the vm to continue working in the event of a
nbdkit failure.

Eventually we may want to generalize this functionality since we may
need something similar for e.g. qemu-storage-daemon, etc.

The process is monitored with the pidfd_open() syscall if it exists
(since linux 5.3). Otherwise it resorts to checking whether the process
is alive once a second. The one-second time period was chosen somewhat
arbitrarily.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
meson.build
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_driver.c
src/qemu/qemu_nbdkit.c
src/qemu/qemu_nbdkit.h
src/qemu/qemu_process.c
src/qemu/qemu_process.h
tests/meson.build
tests/qemuxml2argvtest.c