From: Roman Penyaev <r.peniaev@gmail.com>
Cc: "Roman Penyaev" <r.peniaev@gmail.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-devel@nongnu.org
Subject: [PATCH v3 3/7] chardev/char: rename frontend mux calls
Date: Thu, 10 Oct 2024 12:18:34 +0200 [thread overview]
Message-ID: <20241010101838.331032-4-r.peniaev@gmail.com> (raw)
In-Reply-To: <20241010101838.331032-1-r.peniaev@gmail.com>
This patch renames calls in the frontend mux implementation
to reflect its frontend nature. Patch does the following:
s/mux_chr/mux_fe_chr/g
No functional changes are made.
Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org
---
chardev/char-mux-fe.c | 57 ++++++++++++++++++++++---------------------
1 file changed, 29 insertions(+), 28 deletions(-)
diff --git a/chardev/char-mux-fe.c b/chardev/char-mux-fe.c
index cd9ff0c5dc12..5a8860b4310e 100644
--- a/chardev/char-mux-fe.c
+++ b/chardev/char-mux-fe.c
@@ -34,7 +34,7 @@
/* MUX driver for serial I/O splitting */
/* Called with chr_write_lock held. */
-static int mux_chr_write(Chardev *chr, const uint8_t *buf, int len)
+static int mux_fe_chr_write(Chardev *chr, const uint8_t *buf, int len)
{
MuxFeChardev *d = MUX_FE_CHARDEV(chr);
int ret;
@@ -117,7 +117,8 @@ static void mux_print_help(Chardev *chr)
}
}
-static void mux_chr_send_event(MuxFeChardev *d, int mux_nr, QEMUChrEvent event)
+static void mux_fe_chr_send_event(MuxFeChardev *d, int mux_nr,
+ QEMUChrEvent event)
{
CharBackend *be = d->backends[mux_nr];
@@ -126,12 +127,12 @@ static void mux_chr_send_event(MuxFeChardev *d, int mux_nr, QEMUChrEvent event)
}
}
-static void mux_chr_be_event(Chardev *chr, QEMUChrEvent event)
+static void mux_fe_chr_be_event(Chardev *chr, QEMUChrEvent event)
{
MuxFeChardev *d = MUX_FE_CHARDEV(chr);
if (d->focus != -1) {
- mux_chr_send_event(d, d->focus, event);
+ mux_fe_chr_send_event(d, d->focus, event);
}
}
@@ -180,7 +181,7 @@ static int mux_proc_byte(Chardev *chr, MuxFeChardev *d, int ch)
return 0;
}
-static void mux_chr_accept_input(Chardev *chr)
+static void mux_fe_chr_accept_input(Chardev *chr)
{
MuxFeChardev *d = MUX_FE_CHARDEV(chr);
int m = d->focus;
@@ -193,7 +194,7 @@ static void mux_chr_accept_input(Chardev *chr)
}
}
-static int mux_chr_can_read(void *opaque)
+static int mux_fe_chr_can_read(void *opaque)
{
MuxFeChardev *d = MUX_FE_CHARDEV(opaque);
int m = d->focus;
@@ -210,7 +211,7 @@ static int mux_chr_can_read(void *opaque)
return 0;
}
-static void mux_chr_read(void *opaque, const uint8_t *buf, int size)
+static void mux_fe_chr_read(void *opaque, const uint8_t *buf, int size)
{
Chardev *chr = CHARDEV(opaque);
MuxFeChardev *d = MUX_FE_CHARDEV(opaque);
@@ -218,7 +219,7 @@ static void mux_chr_read(void *opaque, const uint8_t *buf, int size)
CharBackend *be = d->backends[m];
int i;
- mux_chr_accept_input(opaque);
+ mux_fe_chr_accept_input(opaque);
for (i = 0; i < size; i++)
if (mux_proc_byte(chr, d, buf[i])) {
@@ -238,16 +239,16 @@ void mux_fe_chr_send_all_event(MuxFeChardev *d, QEMUChrEvent event)
/* Send the event to all registered listeners */
for (i = 0; i < d->mux_cnt; i++) {
- mux_chr_send_event(d, i, event);
+ mux_fe_chr_send_event(d, i, event);
}
}
-static void mux_chr_event(void *opaque, QEMUChrEvent event)
+static void mux_fe_chr_event(void *opaque, QEMUChrEvent event)
{
mux_chr_send_all_event(CHARDEV(opaque), event);
}
-static GSource *mux_chr_add_watch(Chardev *s, GIOCondition cond)
+static GSource *mux_fe_chr_add_watch(Chardev *s, GIOCondition cond)
{
MuxFeChardev *d = MUX_FE_CHARDEV(s);
Chardev *chr = qemu_chr_fe_get_driver(&d->chr);
@@ -260,7 +261,7 @@ static GSource *mux_chr_add_watch(Chardev *s, GIOCondition cond)
return cc->chr_add_watch(chr, cond);
}
-static void char_mux_finalize(Object *obj)
+static void char_mux_fe_finalize(Object *obj)
{
MuxFeChardev *d = MUX_FE_CHARDEV(obj);
int i;
@@ -274,15 +275,15 @@ static void char_mux_finalize(Object *obj)
qemu_chr_fe_deinit(&d->chr, false);
}
-static void mux_chr_update_read_handlers(Chardev *chr)
+static void mux_fe_chr_update_read_handlers(Chardev *chr)
{
MuxFeChardev *d = MUX_FE_CHARDEV(chr);
/* Fix up the real driver with mux routines */
qemu_chr_fe_set_handlers_full(&d->chr,
- mux_chr_can_read,
- mux_chr_read,
- mux_chr_event,
+ mux_fe_chr_can_read,
+ mux_fe_chr_read,
+ mux_fe_chr_event,
NULL,
chr,
chr->gcontext, true, false);
@@ -296,12 +297,12 @@ void mux_set_focus(Chardev *chr, int focus)
assert(focus < d->mux_cnt);
if (d->focus != -1) {
- mux_chr_send_event(d, d->focus, CHR_EVENT_MUX_OUT);
+ mux_fe_chr_send_event(d, d->focus, CHR_EVENT_MUX_OUT);
}
d->focus = focus;
chr->be = d->backends[focus];
- mux_chr_send_event(d, d->focus, CHR_EVENT_MUX_IN);
+ mux_fe_chr_send_event(d, d->focus, CHR_EVENT_MUX_IN);
}
static void qemu_chr_open_mux(Chardev *chr,
@@ -343,30 +344,30 @@ static void qemu_chr_parse_mux(QemuOpts *opts, ChardevBackend *backend,
mux->chardev = g_strdup(chardev);
}
-static void char_mux_class_init(ObjectClass *oc, void *data)
+static void char_mux_fe_class_init(ObjectClass *oc, void *data)
{
ChardevClass *cc = CHARDEV_CLASS(oc);
cc->parse = qemu_chr_parse_mux;
cc->open = qemu_chr_open_mux;
- cc->chr_write = mux_chr_write;
- cc->chr_accept_input = mux_chr_accept_input;
- cc->chr_add_watch = mux_chr_add_watch;
- cc->chr_be_event = mux_chr_be_event;
- cc->chr_update_read_handler = mux_chr_update_read_handlers;
+ cc->chr_write = mux_fe_chr_write;
+ cc->chr_accept_input = mux_fe_chr_accept_input;
+ cc->chr_add_watch = mux_fe_chr_add_watch;
+ cc->chr_be_event = mux_fe_chr_be_event;
+ cc->chr_update_read_handler = mux_fe_chr_update_read_handlers;
}
-static const TypeInfo char_mux_type_info = {
+static const TypeInfo char_mux_fe_type_info = {
.name = TYPE_CHARDEV_MUX_FE,
.parent = TYPE_CHARDEV,
- .class_init = char_mux_class_init,
+ .class_init = char_mux_fe_class_init,
.instance_size = sizeof(MuxFeChardev),
- .instance_finalize = char_mux_finalize,
+ .instance_finalize = char_mux_fe_finalize,
};
static void register_types(void)
{
- type_register_static(&char_mux_type_info);
+ type_register_static(&char_mux_fe_type_info);
}
type_init(register_types);
--
2.34.1
next prev parent reply other threads:[~2024-10-10 10:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241010101838.331032-1-r.peniaev@gmail.com>
2024-10-10 10:18 ` [PATCH v3 1/7] chardev/char: rename `char-mux.c` to `char-mux-fe.c` Roman Penyaev
2024-10-14 13:57 ` Marc-André Lureau
2024-10-14 14:08 ` Roman Penyaev
2024-10-10 10:18 ` [PATCH v3 2/7] chardev/char: move away mux suspend/resume calls Roman Penyaev
2024-10-10 10:18 ` Roman Penyaev [this message]
2024-10-10 10:18 ` [PATCH v3 4/7] chardev/char: introduce `mux-be-id=ID` option Roman Penyaev
2024-10-10 10:18 ` [PATCH v3 5/7] chardev/char-mux: implement backend chardev multiplexing Roman Penyaev
2024-10-10 10:18 ` [PATCH v3 6/7] tests/unit/test-char: add unit test for the `mux-be` multiplexer Roman Penyaev
2024-10-10 10:18 ` [PATCH v3 7/7] qemu-options.hx: describe multiplexing of several backend devices Roman Penyaev
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=20241010101838.331032-4-r.peniaev@gmail.com \
--to=r.peniaev@gmail.com \
--cc=marcandre.lureau@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).