Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-19 Thread Kevin Wolf
Am 19.02.2020 um 15:21 hat Markus Armbruster geschrieben: > I think we need to talk about AioContext in qapi-code-gen.txt. PATCH 1 > now adds > > Member 'coroutine' tells the QMP dispatcher whether the command handler > is safe to be run in a coroutine. It defaults to false. If it is true,

Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-19 Thread Markus Armbruster
Markus Armbruster writes: [...] > If you agree with my proposed tweaks, and nothing else comes up, I can > try to do them in my tree. I'll tweak your v5, of course.

Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-19 Thread Markus Armbruster
Kevin Wolf writes: > Am 19.02.2020 um 10:03 hat Markus Armbruster geschrieben: >> >> >> @@ -246,8 +287,15 @@ void monitor_qmp_bh_dispatcher(void *data) >> >> >>} >> >> >>qmp_request_free(req_obj); >> >> >> >> >> >> -/* Reschedule instead of looping so the main loo

Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-19 Thread Kevin Wolf
Am 19.02.2020 um 10:03 hat Markus Armbruster geschrieben: > >> >> @@ -246,8 +287,15 @@ void monitor_qmp_bh_dispatcher(void *data) > >> >>} > >> >>qmp_request_free(req_obj); > >> >> > >> >> -/* Reschedule instead of looping so the main loop stays > >> >> responsive

Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-19 Thread Markus Armbruster
Kevin Wolf writes: > Am 18.02.2020 um 15:12 hat Markus Armbruster geschrieben: >> >> Regarding calling monitor_qmp_requests_pop_any_with_lock(): it needs >> >> @monitor_lock and @mon_list to be valid. We just initialized >> >> @monitor_lock, and @mon_list is empty. >> >> monitor_qmp_requests_pop

Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-18 Thread Kevin Wolf
Am 18.02.2020 um 15:12 hat Markus Armbruster geschrieben: > >> Regarding calling monitor_qmp_requests_pop_any_with_lock(): it needs > >> @monitor_lock and @mon_list to be valid. We just initialized > >> @monitor_lock, and @mon_list is empty. > >> monitor_qmp_requests_pop_any_with_lock() should be

Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-18 Thread Markus Armbruster
Never been closer... Kevin Wolf writes: > Am 17.02.2020 um 12:08 hat Markus Armbruster geschrieben: >> This is the hairy one. Please bear with me while I try to grok it. >> >> Kevin Wolf writes: >> >> > This moves the QMP dispatcher to a coroutine and runs all QMP command >> > handlers that

Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-17 Thread Kevin Wolf
Am 17.02.2020 um 12:08 hat Markus Armbruster geschrieben: > This is the hairy one. Please bear with me while I try to grok it. > > Kevin Wolf writes: > > > This moves the QMP dispatcher to a coroutine and runs all QMP command > > handlers that declare 'coroutine': true in coroutine context so t

Re: [PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-02-17 Thread Markus Armbruster
This is the hairy one. Please bear with me while I try to grok it. Kevin Wolf writes: > This moves the QMP dispatcher to a coroutine and runs all QMP command > handlers that declare 'coroutine': true in coroutine context so they > can avoid blocking the main loop while doing I/O or waiting for

[PATCH v4 3/4] qmp: Move dispatcher to a coroutine

2020-01-21 Thread Kevin Wolf
This moves the QMP dispatcher to a coroutine and runs all QMP command handlers that declare 'coroutine': true in coroutine context so they can avoid blocking the main loop while doing I/O or waiting for other events. For commands that are not declared safe to run in a coroutine, the dispatcher dro