From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [PATCH 2/4] monitor: allow calling monitor_resume under mon_lock
Date: Thu, 25 May 2023 17:08:17 +0200 [thread overview]
Message-ID: <87353ko3dq.fsf@pond.sub.org> (raw)
In-Reply-To: <20230518101804.992085-3-pbonzini@redhat.com> (Paolo Bonzini's message of "Thu, 18 May 2023 12:18:02 +0200")
Paolo Bonzini <pbonzini@redhat.com> writes:
> 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.
This describes what the patch changes, but not why we want the change.
Could you elaborate a bit?
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> monitor/monitor.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/monitor/monitor.c b/monitor/monitor.c
> index 4b11bca2a21d..7080d2da8ec6 100644
> --- a/monitor/monitor.c
> +++ b/monitor/monitor.c
> @@ -567,6 +567,12 @@ static void monitor_accept_input(void *opaque)
> {
> Monitor *mon = opaque;
>
> + if (!monitor_is_qmp(mon)) {
> + MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
> + assert(hmp_mon->rs);
> + readline_show_prompt(hmp_mon->rs);
> + }
> +
> qemu_chr_fe_accept_input(&mon->chr);
> }
>
> @@ -585,12 +591,6 @@ void monitor_resume(Monitor *mon)
> ctx = qemu_get_aio_context();
> }
>
> - if (!monitor_is_qmp(mon)) {
> - MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
> - assert(hmp_mon->rs);
> - readline_show_prompt(hmp_mon->rs);
> - }
> -
> aio_bh_schedule_oneshot(ctx, monitor_accept_input, mon);
> }
next prev parent reply other threads:[~2023-05-25 15:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-18 10:18 [PATCH 0/4] monitor/hmp: cleanup monitor_event() and suspend_cnt Paolo Bonzini
2023-05-18 10:18 ` [PATCH 1/4] monitor: use QEMU_LOCK_GUARD a bit more Paolo Bonzini
2023-05-18 13:18 ` Richard Henderson
2023-05-25 15:06 ` Markus Armbruster
2023-05-18 10:18 ` [PATCH 2/4] monitor: allow calling monitor_resume under mon_lock Paolo Bonzini
2023-05-25 15:08 ` Markus Armbruster [this message]
2023-05-18 10:18 ` [PATCH 3/4] monitor: add more *_locked() functions Paolo Bonzini
2023-05-18 13:18 ` Richard Henderson
2023-05-25 15:13 ` Markus Armbruster
2023-05-18 10:18 ` [PATCH 4/4] monitor: do not use mb_read/mb_set for suspend_cnt Paolo Bonzini
2023-05-25 15:14 ` [PATCH 0/4] monitor/hmp: cleanup monitor_event() and suspend_cnt Markus Armbruster
2023-05-25 18:13 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87353ko3dq.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.