summary refs log tree commit diff stats
path: root/chardev/char.c
diff options
context:
space:
mode:
authorRoman Penyaev <r.peniaev@gmail.com>2024-10-14 17:24:06 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2024-10-15 12:26:01 +0400
commit005b6d511f23e0c2b69b4c7353defaa48c24853d (patch)
treebc4b71add5b2f37464a155886c1171011f610917 /chardev/char.c
parent709a4cabfb9a425118d37855fcc661559a1610bb (diff)
downloadfocaccia-qemu-005b6d511f23e0c2b69b4c7353defaa48c24853d.tar.gz
focaccia-qemu-005b6d511f23e0c2b69b4c7353defaa48c24853d.zip
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>
Diffstat (limited to 'chardev/char.c')
-rw-r--r--chardev/char.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chardev/char.c b/chardev/char.c
index f54dc3a862..a1722aa076 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -333,7 +333,7 @@ static bool qemu_chr_is_busy(Chardev *s)
 {
     if (CHARDEV_IS_MUX(s)) {
         MuxChardev *d = MUX_CHARDEV(s);
-        return d->mux_cnt > 0;
+        return d->mux_bitset != 0;
     } else {
         return s->be != NULL;
     }