From: Eric K <erickra@cs.utexas.edu>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Eric K" <erickra@cs.utexas.edu>
Subject: [PATCH] char-udp: Fix initial backend open status
Date: Mon, 8 Dec 2025 16:58:49 -0600 [thread overview]
Message-ID: <20251208225849.705554-1-erickra@cs.utexas.edu> (raw)
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>
---
chardev/char-udp.c | 2 --
tests/unit/test-char.c | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/chardev/char-udp.c b/chardev/char-udp.c
index 572fab0ad1..1025f577a0 100644
--- a/chardev/char-udp.c
+++ b/chardev/char-udp.c
@@ -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)
diff --git a/tests/unit/test-char.c b/tests/unit/test-char.c
index 8a98e42cad..2869c4e09d 100644
--- a/tests/unit/test-char.c
+++ b/tests/unit/test-char.c
@@ -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);
--
2.52.0
next reply other threads:[~2025-12-09 1:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 22:58 Eric K [this message]
2025-12-09 8:02 ` [PATCH] char-udp: Fix initial backend open status Marc-André Lureau
2025-12-09 8:33 ` Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251208225849.705554-1-erickra@cs.utexas.edu \
--to=erickra@cs.utexas.edu \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).