qemu-cr16/include
Richard W.M. Jones 886898baad Implement -run-with exit-with-parent=on
Libguestfs wants to use qemu to run a captive appliance.  When the
program linked to libguestfs exits, we want qemu to be cleaned up.
Libguestfs goes to great lengths to do this at the moment: it either
forks a separate process to ensure clean-up is done, or it asks
libvirt to clean up the qemu process.  However this is complicated and
not totally reliable.

On Linux, FreeBSD and macOS, there are mechanisms to ensure a signal
or message is delivered to a process when its parent process goes
away.  The qemu test suite even uses this mechanism on Linux (see
PR_SET_PDEATHSIG in tests/qtest/libqtest.c).

In nbdkit we have long had the concept of running nbdkit captively,
and we have the nbdkit --exit-with-parent flag to help
(https://libguestfs.org/nbdkit-captive.1.html#EXIT-WITH-PARENT)

This commit adds the same mechanism.  The syntax is:

  qemu -run-with exit-with-parent=on [...]

This is not a feature that most typical users of qemu (for running
general purpose, long-lived VMs) should use, so it defaults to off.

The exit-with-parent.[ch] files are copied from nbdkit, where they
have a 3-clause BSD license which is compatible with qemu:

https://gitlab.com/nbdkit/nbdkit/-/tree/master/common/utils?ref_type=heads

Thanks: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-03 10:05:39 +00:00
..
accel accel/tcg: Add cpu_atomic_*_mmu for 16-byte xchg, fetch_and, fetch_or 2025-08-30 16:37:23 +01:00
authz
block nvme queue 2025-10-31 12:56:05 +01:00
chardev char: rename CharBackend->CharFrontend 2025-10-28 14:49:52 +01:00
crypto io/crypto: Move tls premature termination handling into QIO layer 2025-10-03 09:48:02 -04:00
disas disas: Fix build against Capstone v6 (again) 2024-11-05 10:09:59 +00:00
exec accel/tcg: Introduce and use MO_ALIGN_TLB_ONLY 2025-10-31 12:49:46 +01:00
fpu fpu: Move m68k_denormal fmt flag into floatx80_behaviour 2025-02-25 15:32:57 +00:00
gdbstub gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian() 2025-07-15 02:56:39 -04:00
hw target-arm queue: 2025-11-01 10:52:48 +01:00
io io: fix use after free in websocket handshake code 2025-10-24 13:04:31 +01:00
libdecnumber include/libdecnumber: replace FSF postal address with licenses URL 2025-06-26 00:42:37 +02:00
migration migration/vmstate: remove VMSTATE_BUFFER_POINTER_UNSAFE macro 2025-10-28 08:08:11 +01:00
monitor qdev: add qdev_find_default_bus() 2025-10-29 22:53:41 +04:00
net qom: remove redundant typedef when use OBJECT_DECLARE_SIMPLE_TYPE 2025-10-28 08:08:04 +01:00
qapi error: Kill @error_warn 2025-10-01 08:33:24 +02:00
qemu Implement -run-with exit-with-parent=on 2025-11-03 10:05:39 +00:00
qobject qobject: make refcount atomic 2025-10-28 13:02:26 +01:00
qom qom: reverse order of instance_post_init calls 2025-05-20 08:18:53 +02:00
scsi
semihosting include/semihosting/common-semi: extract common_semi API 2025-09-26 09:55:19 +01:00
standard-headers linux-headers: Update to Linux v6.18-rc3 2025-10-30 10:33:55 +08:00
system target-arm queue: 2025-11-01 10:52:48 +01:00
tcg tcg: Add tcg_gen_atomic_{xchg,fetch_and,fetch_or}_i128 2025-08-30 16:37:24 +01:00
ui ui/gtk: Add scale option 2025-07-15 10:22:33 +04:00
user accel/tcg: Add clear_flags argument to page_set_flags 2025-10-14 07:30:39 -07:00
elf.h elf: Add EF_MIPS_ARCH_ASE definitions 2025-09-02 17:57:05 +02:00
glib-compat.h include/glib-compat.h: Poison g_list_sort and g_slist_sort 2025-05-06 16:02:04 +02:00
qemu-io.h
qemu-main.h ui & main loop: Redesign of system-specific main thread event handling 2024-12-31 21:21:34 +01:00