mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
chardev: ChardevClass: consistent naming for handlers
Most handlers have name prefixed with "chr_". That's a good practice which helps to grep them. Convert the rest: .parse, .open, get/set_msgfds. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20260115144606.233252-4-vsementsov@yandex-team.ru>
This commit is contained in:
committed by
Marc-André Lureau
parent
2a545fd851
commit
6b4f8e7488
@@ -676,7 +676,7 @@ static void char_braille_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->open = baum_chr_open;
|
||||
cc->chr_open = baum_chr_open;
|
||||
cc->chr_write = baum_chr_write;
|
||||
cc->chr_accept_input = baum_chr_accept_input;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ static void char_console_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->open = qemu_chr_open_win_con;
|
||||
cc->chr_open = qemu_chr_open_win_con;
|
||||
}
|
||||
|
||||
static const TypeInfo char_console_type_info = {
|
||||
|
||||
@@ -130,8 +130,8 @@ int qemu_chr_fe_get_msgfds(CharFrontend *c, int *fds, int len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return CHARDEV_GET_CLASS(s)->get_msgfds ?
|
||||
CHARDEV_GET_CLASS(s)->get_msgfds(s, fds, len) : -1;
|
||||
return CHARDEV_GET_CLASS(s)->chr_get_msgfds ?
|
||||
CHARDEV_GET_CLASS(s)->chr_get_msgfds(s, fds, len) : -1;
|
||||
}
|
||||
|
||||
int qemu_chr_fe_set_msgfds(CharFrontend *c, int *fds, int num)
|
||||
@@ -142,8 +142,8 @@ int qemu_chr_fe_set_msgfds(CharFrontend *c, int *fds, int num)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return CHARDEV_GET_CLASS(s)->set_msgfds ?
|
||||
CHARDEV_GET_CLASS(s)->set_msgfds(s, fds, num) : -1;
|
||||
return CHARDEV_GET_CLASS(s)->chr_set_msgfds ?
|
||||
CHARDEV_GET_CLASS(s)->chr_set_msgfds(s, fds, num) : -1;
|
||||
}
|
||||
|
||||
void qemu_chr_fe_accept_input(CharFrontend *c)
|
||||
|
||||
@@ -133,8 +133,8 @@ static void char_file_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_file_out;
|
||||
cc->open = qmp_chardev_open_file;
|
||||
cc->chr_parse = qemu_chr_parse_file_out;
|
||||
cc->chr_open = qmp_chardev_open_file;
|
||||
}
|
||||
|
||||
static const TypeInfo char_file_type_info = {
|
||||
|
||||
@@ -276,8 +276,8 @@ static void char_hub_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_hub;
|
||||
cc->open = qemu_chr_open_hub;
|
||||
cc->chr_parse = qemu_chr_parse_hub;
|
||||
cc->chr_open = qemu_chr_open_hub;
|
||||
cc->chr_write = hub_chr_write;
|
||||
cc->chr_add_watch = hub_chr_add_watch;
|
||||
/* We handle events from backends only */
|
||||
|
||||
@@ -451,8 +451,8 @@ static void char_mux_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_mux;
|
||||
cc->open = qemu_chr_open_mux;
|
||||
cc->chr_parse = qemu_chr_parse_mux;
|
||||
cc->chr_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;
|
||||
|
||||
@@ -38,7 +38,7 @@ static void char_null_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->open = null_chr_open;
|
||||
cc->chr_open = null_chr_open;
|
||||
}
|
||||
|
||||
static const TypeInfo char_null_type_info = {
|
||||
|
||||
@@ -274,8 +274,8 @@ static void char_parallel_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_parallel;
|
||||
cc->open = qmp_chardev_open_parallel;
|
||||
cc->chr_parse = qemu_chr_parse_parallel;
|
||||
cc->chr_open = qmp_chardev_open_parallel;
|
||||
cc->chr_ioctl = pp_ioctl;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,8 +182,8 @@ static void char_pipe_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_pipe;
|
||||
cc->open = qemu_chr_open_pipe;
|
||||
cc->chr_parse = qemu_chr_parse_pipe;
|
||||
cc->chr_open = qemu_chr_open_pipe;
|
||||
}
|
||||
|
||||
static const TypeInfo char_pipe_type_info = {
|
||||
|
||||
@@ -394,8 +394,8 @@ static void char_pty_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = char_pty_parse;
|
||||
cc->open = char_pty_open;
|
||||
cc->chr_parse = char_pty_parse;
|
||||
cc->chr_open = char_pty_open;
|
||||
cc->chr_write = char_pty_chr_write;
|
||||
cc->chr_update_read_handler = pty_chr_update_read_handler;
|
||||
cc->chr_add_watch = pty_chr_add_watch;
|
||||
|
||||
@@ -227,8 +227,8 @@ static void char_ringbuf_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_ringbuf;
|
||||
cc->open = qemu_chr_open_ringbuf;
|
||||
cc->chr_parse = qemu_chr_parse_ringbuf;
|
||||
cc->chr_open = qemu_chr_open_ringbuf;
|
||||
cc->chr_write = ringbuf_chr_write;
|
||||
}
|
||||
|
||||
|
||||
@@ -305,8 +305,8 @@ static void char_serial_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_serial;
|
||||
cc->open = qmp_chardev_open_serial;
|
||||
cc->chr_parse = qemu_chr_parse_serial;
|
||||
cc->chr_open = qmp_chardev_open_serial;
|
||||
#ifndef _WIN32
|
||||
cc->chr_ioctl = tty_serial_ioctl;
|
||||
#endif
|
||||
|
||||
@@ -1585,14 +1585,14 @@ static void char_socket_class_init(ObjectClass *oc, const void *data)
|
||||
|
||||
cc->supports_yank = true;
|
||||
|
||||
cc->parse = qemu_chr_parse_socket;
|
||||
cc->open = qmp_chardev_open_socket;
|
||||
cc->chr_parse = qemu_chr_parse_socket;
|
||||
cc->chr_open = qmp_chardev_open_socket;
|
||||
cc->chr_wait_connected = tcp_chr_wait_connected;
|
||||
cc->chr_write = tcp_chr_write;
|
||||
cc->chr_sync_read = tcp_chr_sync_read;
|
||||
cc->chr_disconnect = tcp_chr_disconnect;
|
||||
cc->get_msgfds = tcp_get_msgfds;
|
||||
cc->set_msgfds = tcp_set_msgfds;
|
||||
cc->chr_get_msgfds = tcp_get_msgfds;
|
||||
cc->chr_set_msgfds = tcp_set_msgfds;
|
||||
cc->chr_add_client = tcp_chr_add_client;
|
||||
cc->chr_add_watch = tcp_chr_add_watch;
|
||||
cc->chr_update_read_handler = tcp_chr_update_read_handler;
|
||||
|
||||
@@ -142,9 +142,9 @@ static void char_stdio_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_stdio;
|
||||
cc->chr_parse = qemu_chr_parse_stdio;
|
||||
#ifndef _WIN32
|
||||
cc->open = qemu_chr_open_stdio;
|
||||
cc->chr_open = qemu_chr_open_stdio;
|
||||
cc->chr_set_echo = qemu_chr_set_echo_stdio;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -221,8 +221,8 @@ static void char_udp_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_udp;
|
||||
cc->open = qmp_chardev_open_udp;
|
||||
cc->chr_parse = qemu_chr_parse_udp;
|
||||
cc->chr_open = qmp_chardev_open_udp;
|
||||
cc->chr_write = udp_chr_write;
|
||||
cc->chr_update_read_handler = udp_chr_update_read_handler;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ static void char_win_stdio_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->open = qemu_chr_open_stdio;
|
||||
cc->chr_open = qemu_chr_open_stdio;
|
||||
cc->chr_write = win_stdio_write;
|
||||
cc->chr_set_echo = qemu_chr_set_echo_win_stdio;
|
||||
}
|
||||
|
||||
@@ -267,8 +267,8 @@ static void qemu_char_open(Chardev *chr, ChardevBackend *backend,
|
||||
}
|
||||
}
|
||||
|
||||
if (cc->open) {
|
||||
cc->open(chr, backend, be_opened, errp);
|
||||
if (cc->chr_open) {
|
||||
cc->chr_open(chr, backend, be_opened, errp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,8 +604,8 @@ ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts, Error **errp)
|
||||
backend = g_new0(ChardevBackend, 1);
|
||||
backend->type = CHARDEV_BACKEND_KIND_NULL;
|
||||
|
||||
if (cc->parse) {
|
||||
cc->parse(opts, backend, &local_err);
|
||||
if (cc->chr_parse) {
|
||||
cc->chr_parse(opts, backend, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
qapi_free_ChardevBackend(backend);
|
||||
|
||||
@@ -271,7 +271,7 @@ static void char_msmouse_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->open = msmouse_chr_open;
|
||||
cc->chr_open = msmouse_chr_open;
|
||||
cc->chr_write = msmouse_chr_write;
|
||||
cc->chr_accept_input = msmouse_chr_accept_input;
|
||||
cc->chr_ioctl = msmouse_ioctl;
|
||||
|
||||
@@ -364,8 +364,8 @@ static void char_spicevmc_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_spice_vmc;
|
||||
cc->open = qemu_chr_open_spice_vmc;
|
||||
cc->chr_parse = qemu_chr_parse_spice_vmc;
|
||||
cc->chr_open = qemu_chr_open_spice_vmc;
|
||||
cc->chr_set_fe_open = spice_vmc_set_fe_open;
|
||||
}
|
||||
|
||||
@@ -380,8 +380,8 @@ static void char_spiceport_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->parse = qemu_chr_parse_spice_port;
|
||||
cc->open = qemu_chr_open_spice_port;
|
||||
cc->chr_parse = qemu_chr_parse_spice_port;
|
||||
cc->chr_open = qemu_chr_open_spice_port;
|
||||
cc->chr_set_fe_open = spice_port_set_fe_open;
|
||||
}
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ static void wctablet_chr_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
ChardevClass *cc = CHARDEV_CLASS(oc);
|
||||
|
||||
cc->open = wctablet_chr_open;
|
||||
cc->chr_open = wctablet_chr_open;
|
||||
cc->chr_write = wctablet_chr_write;
|
||||
cc->chr_ioctl = wctablet_chr_ioctl;
|
||||
cc->chr_accept_input = wctablet_chr_accept_input;
|
||||
|
||||
Reference in New Issue
Block a user