mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
chardev/mux: switch mux frontends management to bitset
Frontends can be attached and detached during run-time (although detach is not implemented, but will follow). Counter variable of muxes is not enough for proper attach/detach management, so this patch implements bitset: if bit is set for the `mux_bitset` variable, then frontend device can be found in the `backend` array (yes, huge confusion with backend and frontends names). Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> Cc: qemu-devel@nongnu.org Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20241014152408.427700-7-r.peniaev@gmail.com>
This commit is contained in:
parent
709a4cabfb
commit
005b6d511f
3 changed files with 30 additions and 16 deletions
|
@ -37,8 +37,8 @@ struct MuxChardev {
|
|||
Chardev parent;
|
||||
CharBackend *backends[MAX_MUX];
|
||||
CharBackend chr;
|
||||
unsigned long mux_bitset;
|
||||
int focus;
|
||||
unsigned int mux_cnt;
|
||||
bool term_got_escape;
|
||||
/* Intermediate input buffer catches escape sequences even if the
|
||||
currently active device is not accepting any input - but only until it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue