qemu-cr16/system
Peter Maydell 321ded29e6 system/qtest.c: Allow for multiple CHR_EVENT_CLOSED events
In the qtest_event() QEMUChrEvent handler, we create a timer
and log OPENED on CHR_EVENT_OPENED, and we destroy the timer and
log CLOSED on CHR_EVENT_CLOSED. However, the chardev subsystem
can send us more than one CHR_EVENT_CLOSED if we're reading from
a file chardev:
 * the first one happens when we read the last data from the file
 * the second one happens when the user hits ^C to exit QEMU
   and the chardev is finalized: char_fd_finalize()

This causes us to call g_timer_elapsed() with a NULL timer
(which glib complains about) and print an extra CLOSED log line
with a zero timestamp:

[I +0.063829] CLOSED
qemu-system-aarch64: GLib: g_timer_elapsed: assertion 'timer != NULL' failed
[I +0.000000] CLOSED

Avoid this by ignoring a CHR_EVENT_CLOSED if we have already
processed one.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <20251107174306.1408139-1-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2025-11-18 19:56:11 +01:00
..
arch_init.c system: Replace arch_type global by qemu_arch_available() helper 2025-03-11 20:03:26 +01:00
async-teardown.c qemu/osdep: Add excluded fd parameter to qemu_close_all_open_fd() 2024-08-05 08:21:59 +10:00
balloon.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
bootdevice.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpu-timers.c cpus: properly kick CPUs out of inner execution loop 2025-09-17 19:00:55 +02:00
cpus.c bql: Fix bql_locked status with condvar APIs 2025-11-03 11:59:32 +01:00
datadir.c pc-bios: Move device tree files in their own subdir 2025-04-25 17:09:58 +02:00
device_tree-stub.c hw/core/machine.c: Make -machine dumpdtb=file.dtb with no DTB an error 2025-02-25 15:32:57 +00:00
device_tree.c hw/core/loader: capture Error from load_image_targphys 2025-10-28 08:19:18 +01:00
dirtylimit.c Miscellaneous patches for 2025-04-24 2025-04-24 13:44:57 -04:00
dma-helpers.c include/exec: Split out icount.h 2025-04-23 14:08:44 -07:00
exit-with-parent.c Implement -run-with exit-with-parent=on 2025-11-03 10:05:39 +00:00
globals-target.c system: Extract target-specific globals to their own compilation unit 2025-03-11 20:03:26 +01:00
globals.c system: drop the -old-param option 2025-09-16 17:31:54 +01:00
ioport.c include/system: Move exec/ioport.h to system/ioport.h 2025-04-23 14:08:21 -07:00
main.c system/main: comment lock rationale 2025-05-28 08:07:59 +01:00
memory-internal.h system/memory: Remove DEVICE_HOST_ENDIAN definition 2025-04-25 17:09:58 +02:00
memory.c system/physmem: Extract API out of 'system/ram_addr.h' header 2025-10-07 05:03:56 +02:00
memory_ldst.c.inc system/physmem: Drop 'cpu_' prefix in Physical Memory API 2025-10-07 05:03:56 +02:00
memory_mapping.c include/system: Move exec/address-spaces.h to system/address-spaces.h 2025-04-23 14:08:21 -07:00
meson.build Implement -run-with exit-with-parent=on 2025-11-03 10:05:39 +00:00
physmem.c system/physmem: mark io_mem_unassigned lockless 2025-11-03 16:04:10 -05:00
qdev-monitor.c qdev: add qdev_find_default_bus() 2025-10-29 22:53:41 +04:00
qemu-seccomp.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
qtest.c system/qtest.c: Allow for multiple CHR_EVENT_CLOSED events 2025-11-18 19:56:11 +01:00
ram-block-attributes.c ram-block-attributes: Unify the retrieval of the block size 2025-11-03 16:04:10 -05:00
rtc.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
runstate-action.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
runstate-hmp-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
runstate.c audio: move audio.h under include/qemu/ 2025-10-30 22:56:51 +04:00
tpm-hmp-cmds.c
tpm.c tpm: "qemu -tpmdev help" should return success 2025-07-15 10:22:33 +04:00
trace-events ram-block-attributes: Introduce RamBlockAttributes to manage RAMBlock with guest_memfd 2025-06-23 16:03:59 -04:00
trace.h
vl.c Implement -run-with exit-with-parent=on 2025-11-03 10:05:39 +00:00
watchpoint.c include/exec: Split out watchpoint.h 2025-04-23 14:08:36 -07:00