RFC chardev: introduce chardev contexts
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest3 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | chardev: introduce chardev contextschardev/ gdbstub.c hw/ +2 more | +86 | 0 replies | |
| 2/3 | monitor: generate flag parse helper from init funcvl.c | +11 | 0 replies | |
| 3/3 | monitor: switch to use chardev's iothreadchardev/ chardev/ monitor.c +1 more | +39 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [RFC 0/3] chardev: introduce chardev contexts
This is a RFC series. It majorly did these things:
(1) move the monitor iothread management from monitor code to chardev code somehow,
(2) decide which context/iothread to use for the chardev before chardev creates, by parsing monitor options earlier (not init, but only parsing) since monitor is the only exception now,
(2) disallow chardev context to change for the whole lifecycle.
Basically this work moves the only chardev iothread (the monitor iothread) into chardev's management, then it's easy to setup the iothread even before the chardev creates, hence no context switch for chardev is needed any more. In the future if we want to let any chardev to run on some other threads, we just define a new ChardevContext, then do qemu_opt_set_number(...) for the chardev. For now, there is only a monitor context.
It does not mean that this will let chardev depend on monitor code, instead it'll totally remove the reverse dependency - before this work, the chardev backend strangely depends on the frontend to setup the context (which brought us many trouble). Now this should be gone.
This series should solve the potential issue raised here:
https://patchwork.kernel.org/patch/10122713/#22187395
And also should let Marc-André's vhost-user reconnect series work without breaking context switch of chardev (since it never switches now hence no way to break):
http://patchwork.ozlabs.org/cover/961442/
Only smoke test carried out with out-of-band, and make check.
Please have a look on whether this is a workable solution,
TODO:
- should not allow user to specify the "context" parameter
- more ...
Thanks,
Peter Xu (3):
chardev: introduce chardev contexts
monitor: generate flag parse helper from init func
monitor: switch to use chardev's iothread
chardev/char-fe.c | 6 ++++ chardev/char.c | 74 ++++++++++++++++++++++++++++++++++++++---- gdbstub.c | 2 +- hw/bt/hci-csr.c | 2 +- include/chardev/char.h | 15 ++++++++- monitor.c | 4 +-- tests/test-char.c | 4 +-- vl.c | 45 +++++++++++++++++++++++-- 8 files changed, 136 insertions(+), 16 deletions(-)
Signature · 1 line
2.17.1