qemu-e2k/stubs
Kevin Wolf e69ee454b5 monitor: Make current monitor a per-coroutine property
This way, a monitor command handler will still be able to access the
current monitor, but when it yields, all other code code will correctly
get NULL from monitor_cur().

This uses a hash table to map the coroutine pointer to the current
monitor of that coroutine.  Outside of coroutine context, we associate
the current monitor with the leader coroutine of the current thread.

Approaches to implement some form of coroutine local storage directly in
the coroutine core code have been considered and discarded because they
didn't end up being much more generic than the hash table and their
performance impact on coroutines not using coroutine local storage was
unclear. As the block layer uses a coroutine per I/O request, this is a
fast path and we have to be careful. It's safest to just stay out of
this path with code only used by the monitor.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20201005155855.256490-8-kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-10-09 07:08:19 +02:00
..
arch_type.c
bdrv-next-monitor-owned.c
blk-commit-all.c
blockdev-close-all-bdrv-states.c
change-state-handler.c
cmos.c
cpu-get-clock.c cpu-timers, icount: new modules 2020-10-05 16:41:22 +02:00
cpu-synchronize-state.c cpus: prepare new CpusAccel cpu accelerator interface 2020-10-05 16:41:22 +02:00
cpus-get-virtual-clock.c cpus: prepare new CpusAccel cpu accelerator interface 2020-10-05 16:41:22 +02:00
dump.c
error-printf.c
fdset.c monitor: simplify functions for getting a dup'd fdset entry 2020-09-16 10:33:48 +01:00
fw_cfg.c
gdbstub.c
get-vm-name.c
icount.c icount: rename functions to be consistent with the module name 2020-10-05 16:41:22 +02:00
io_uring.c
iothread-lock.c
iothread.c
is-daemonized.c
isa-bus.c
linux-aio.c
machine-init-done.c
meson.build cpus: prepare new CpusAccel cpu accelerator interface 2020-10-05 16:41:22 +02:00
migr-blocker.c
monitor-core.c monitor: Make current monitor a per-coroutine property 2020-10-09 07:08:19 +02:00
monitor.c
pci-bus.c
pci-host-piix.c
qemu-timer-notify-cb.c cpu-timers, icount: new modules 2020-10-05 16:41:22 +02:00
qmp_memory_device.c
qtest.c cpu-timers, icount: new modules 2020-10-05 16:41:22 +02:00
ram-block.c
ramfb.c
replay-user.c
replay.c gdbstub: add reverse continue support in replay mode 2020-10-06 08:34:49 +02:00
runstate-check.c
semihost.c
set-fd-handler.c
sysbus.c
target-get-monitor-def.c
target-monitor-defs.c
tpm.c
trace-control.c
uuid.c qapi: Restrict query-uuid command to machine code 2020-09-29 15:41:35 +02:00
vm-stop.c
vmgenid.c qapi: Restrict query-vm-generation-id command to machine code 2020-09-29 15:41:35 +02:00
vmstate.c
win32-kbd-hook.c
xen-hw-stub.c hw/xen: Split x86-specific declaration from generic hardware ones 2020-09-30 19:11:36 +02:00