]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
char-udp: Fix initial backend open status
authorEric K <erickra@cs.utexas.edu>
Mon, 8 Dec 2025 22:58:49 +0000 (16:58 -0600)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 13 Feb 2026 09:00:01 +0000 (10:00 +0100)
This patch removes the `*be_opened = false` override for the UDP chardev
backend. Since UDP is connectionless it never sends a `CHR_EVENT_OPENED`
so it is never marked open. This causes some frontends (e.g. virtio-serial)
to never perform any operations on the socket.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2993
Signed-off-by: Eric K <erickra@cs.utexas.edu>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20251208225849.705554-1-erickra@cs.utexas.edu>

chardev/char-udp.c
tests/unit/test-char.c

index 572fab0ad1342817bf4ac4ce9c7d3191fb6cf13f..1025f577a0d71b673f0878c74f7544cca7fb8d7e 100644 (file)
@@ -215,8 +215,6 @@ static void qmp_chardev_open_udp(Chardev *chr,
     g_free(name);
 
     s->ioc = QIO_CHANNEL(sioc);
-    /* be isn't opened until we get a connection */
-    *be_opened = false;
 }
 
 static void char_udp_class_init(ObjectClass *oc, const void *data)
index 8a98e42cad04ee289a2588efd3a3f5230cfbdfb6..2869c4e09df054abf0edc05682c064f8c000bd23 100644 (file)
@@ -1012,6 +1012,8 @@ static void char_udp_test_internal(Chardev *reuse_chr, int sock)
         qemu_chr_fe_init(fe, chr, &error_abort);
     }
 
+    g_assert(chr->be_open);
+
     d.chr = chr;
     qemu_chr_fe_set_handlers(fe, socket_can_read_hello, socket_read_hello,
                              NULL, NULL, &d, NULL, true);