0ff25537 | 03-Mar-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
monitor: cleanup fetching of QMP requests
Use a continue statement so that "after going to sleep" is treated the same way as "after processing a request". Pull the monitor_lock critical section out
monitor: cleanup fetching of QMP requests
Use a continue statement so that "after going to sleep" is treated the same way as "after processing a request". Pull the monitor_lock critical section out of monitor_qmp_requests_pop_any_with_lock() and protect qmp_dispatcher_co_shutdown with the monitor_lock.
The two changes are complex to separate because monitor_qmp_dispatcher_co() previously had a complicated logic to check for shutdown both before and after going to sleep.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
3e6bed61 | 03-Mar-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
monitor: cleanup detection of qmp_dispatcher_co shutting down
Instead of overloading qmp_dispatcher_co_busy, make the coroutine pointer NULL. This will make things break spectacularly if somebody t
monitor: cleanup detection of qmp_dispatcher_co shutting down
Instead of overloading qmp_dispatcher_co_busy, make the coroutine pointer NULL. This will make things break spectacularly if somebody tries to start a request after monitor_cleanup().
AIO_WAIT_WHILE_UNLOCKED() does not need qatomic_mb_read(), because the macro contains all the necessary memory barriers.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
6ee7c82d | 03-Mar-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
monitor: do not use mb_read/mb_set for suspend_cnt
Clean up monitor_event to just use monitor_suspend/monitor_resume, using mon->mux_out to protect against incorrect nesting (especially on startup).
monitor: do not use mb_read/mb_set for suspend_cnt
Clean up monitor_event to just use monitor_suspend/monitor_resume, using mon->mux_out to protect against incorrect nesting (especially on startup).
The only remaining case of reading suspend_cnt is in the can_read callback, which is just advisory and can use qatomic_read.
As an extra benefit, mux_out is now simply protected by mon_lock. Also, moving the prompt to the beginning of the main loop removes it from the output in some error cases where QEMU does not actually start successfully. It is not a full fix and it would be nice to also remove the monitor heading, but this is already a small (though unintentional) improvement.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
4cb96b97 | 17-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
monitor: add more *_locked() functions
Allow flushing and printing to the monitor while mon->mon_lock is held. This will help cleaning up the locking of mon->mux_out and mon->suspend_cnt.
Reviewed
monitor: add more *_locked() functions
Allow flushing and printing to the monitor while mon->mon_lock is held. This will help cleaning up the locking of mon->mux_out and mon->suspend_cnt.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
c5d0c55f | 17-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
monitor: allow calling monitor_resume under mon_lock
Move monitor_resume()'s call to readline_show_prompt() outside the potentially locked section. Reuse the existing monitor_accept_input() bottom
monitor: allow calling monitor_resume under mon_lock
Move monitor_resume()'s call to readline_show_prompt() outside the potentially locked section. Reuse the existing monitor_accept_input() bottom half for this purpose.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
9612aa40 | 09-Mar-2023 |
Stefan Hajnoczi <stefanha@redhat.com> |
monitor: convert monitor_cleanup() to AIO_WAIT_WHILE_UNLOCKED()
monitor_cleanup() is called from the main loop thread. Calling AIO_WAIT_WHILE(qemu_get_aio_context(), ...) from the main loop thread i
monitor: convert monitor_cleanup() to AIO_WAIT_WHILE_UNLOCKED()
monitor_cleanup() is called from the main loop thread. Calling AIO_WAIT_WHILE(qemu_get_aio_context(), ...) from the main loop thread is equivalent to AIO_WAIT_WHILE_UNLOCKED(NULL, ...) because neither unlocks the AioContext and the latter's assertion that we're in the main loop succeeds.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20230309190855.414275-7-stefanha@redhat.com> Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
4bf21c7f | 02-Mar-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
monitor: restrict command getfd to POSIX hosts
Currently, the function will simply fail if ancillary fds are not provided, for ex on unsupported platforms.
This changes the failure from:
{"err
monitor: restrict command getfd to POSIX hosts
Currently, the function will simply fail if ancillary fds are not provided, for ex on unsupported platforms.
This changes the failure from:
{"error": {"class": "GenericError", "desc": "No file descriptor supplied via SCM_RIGHTS"}}
to:
{"error": {"class": "CommandNotFound", "desc": "The command getfd has not been found"}}
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
4cda177c | 06-Mar-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qmp: add 'get-win32-socket'
A process with enough capabilities can duplicate a socket to QEMU. Add a QMP command to import it and add it to the monitor fd list, so it can be later used by other comm
qmp: add 'get-win32-socket'
A process with enough capabilities can duplicate a socket to QEMU. Add a QMP command to import it and add it to the monitor fd list, so it can be later used by other commands.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230306122751.2355515-9-marcandre.lureau@redhat.com>
show more ...
|
78ae0e26 | 06-Mar-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
monitor: release the lock before calling close()
As per comment, presumably to avoid syscall in critical section.
Fixes: 0210c3b39bef08 ("monitor: Use LOCK_GUARD macros") Signed-off-by: Marc-André
monitor: release the lock before calling close()
As per comment, presumably to avoid syscall in critical section.
Fixes: 0210c3b39bef08 ("monitor: Use LOCK_GUARD macros") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230306122751.2355515-7-marcandre.lureau@redhat.com>
show more ...
|
864a3fa4 | 24-Jan-2023 |
Markus Armbruster <armbru@redhat.com> |
monitor: Rename misc.c to hmp-target.c
What's left in misc.c is exactly the target-dependent part of the HMP core. Rename accordingly.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-
monitor: Rename misc.c to hmp-target.c
What's left in misc.c is exactly the target-dependent part of the HMP core. Rename accordingly.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-33-armbru@redhat.com>
show more ...
|
cbf81997 | 24-Jan-2023 |
Markus Armbruster <armbru@redhat.com> |
monitor: Move remaining HMP commands from misc.c to hmp-cmds.c
This requires giving them external linkage. Rename do_help_cmd() to hmp_help(), and do_print() to hmp_print().
Signed-off-by: Markus
monitor: Move remaining HMP commands from misc.c to hmp-cmds.c
This requires giving them external linkage. Rename do_help_cmd() to hmp_help(), and do_print() to hmp_print().
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-30-armbru@redhat.com>
show more ...
|
e2245566 | 24-Jan-2023 |
Markus Armbruster <armbru@redhat.com> |
monitor: Move target-dependent HMP commands to hmp-cmds-target.c
Target-independent hmp_gpa2hva(), hmp_gpa2hpa() move along to stay next to hmp_gva2gpa().
Signed-off-by: Markus Armbruster <armbru@r
monitor: Move target-dependent HMP commands to hmp-cmds-target.c
Target-independent hmp_gpa2hva(), hmp_gpa2hpa() move along to stay next to hmp_gva2gpa().
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-29-armbru@redhat.com>
show more ...
|
dd00d7fa | 24-Jan-2023 |
Markus Armbruster <armbru@redhat.com> |
monitor: Move monitor_putc() next to monitor_puts & external linkage
monitor_putc() will soon be used from more than one .c file.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <2
monitor: Move monitor_putc() next to monitor_puts & external linkage
monitor_putc() will soon be used from more than one .c file.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-28-armbru@redhat.com>
show more ...
|
9c9c5ce7 | 24-Jan-2023 |
Markus Armbruster <armbru@redhat.com> |
qdev: Move HMP command completion from monitor to softmmu/
This moves the completion code from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to section "QOM".
Signed-off-by: Markus Armbruste
qdev: Move HMP command completion from monitor to softmmu/
This moves the completion code from MAINTAINERS sections "Human Monitor (HMP)" and "QMP" to section "QOM".
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-26-armbru@redhat.com>
show more ...
|
5bd26d78 | 24-Jan-2023 |
Markus Armbruster <armbru@redhat.com> |
acpi: Move the QMP command from monitor/ to hw/acpi/
This moves the command from MAINTAINERS section "QMP" to section "ACPI/SMBIOS)".
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id
acpi: Move the QMP command from monitor/ to hw/acpi/
This moves the command from MAINTAINERS section "QMP" to section "ACPI/SMBIOS)".
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230124121946.1139465-25-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|