Now we have removed the legacy register_char_driver() we can rename register_char_driver_qapi() to the more obvious and shorter name.
Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> --- backends/baum.c | 2 +- backends/msmouse.c | 2 +- backends/testdev.c | 2 +- include/sysemu/char.h | 2 +- qemu-char.c | 54 +++++++++++++++++++++++++-------------------------- spice-qemu-char.c | 8 ++++---- ui/console.c | 3 +-- 7 files changed, 35 insertions(+), 38 deletions(-) diff --git a/backends/baum.c b/backends/baum.c index 796512d..a69aaff 100644 --- a/backends/baum.c +++ b/backends/baum.c @@ -629,7 +629,7 @@ fail_handle: static void register_types(void) { - register_char_driver_qapi("braille", CHARDEV_BACKEND_KIND_BRAILLE, NULL); + register_char_driver("braille", CHARDEV_BACKEND_KIND_BRAILLE, NULL); } type_init(register_types); diff --git a/backends/msmouse.c b/backends/msmouse.c index 650a531..0119110 100644 --- a/backends/msmouse.c +++ b/backends/msmouse.c @@ -79,7 +79,7 @@ CharDriverState *qemu_chr_open_msmouse(void) static void register_types(void) { - register_char_driver_qapi("msmouse", CHARDEV_BACKEND_KIND_MSMOUSE, NULL); + register_char_driver("msmouse", CHARDEV_BACKEND_KIND_MSMOUSE, NULL); } type_init(register_types); diff --git a/backends/testdev.c b/backends/testdev.c index 70d63b3..eba396a 100644 --- a/backends/testdev.c +++ b/backends/testdev.c @@ -125,7 +125,7 @@ CharDriverState *chr_testdev_init(void) static void register_types(void) { - register_char_driver_qapi("testdev", CHARDEV_BACKEND_KIND_TESTDEV, NULL); + register_char_driver("testdev", CHARDEV_BACKEND_KIND_TESTDEV, NULL); } type_init(register_types); diff --git a/include/sysemu/char.h b/include/sysemu/char.h index dbfd4e6..832b7fe 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -344,7 +344,7 @@ bool chr_is_ringbuf(const CharDriverState *chr); QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename); -void register_char_driver_qapi(const char *name, ChardevBackendKind kind, +void register_char_driver(const char *name, ChardevBackendKind kind, void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp)); /* add an eventfd to the qemu devices that are polled */ diff --git a/qemu-char.c b/qemu-char.c index 33d613f..82c8d09 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3493,7 +3493,7 @@ typedef struct CharDriver { static GSList *backends; -void register_char_driver_qapi(const char *name, ChardevBackendKind kind, +void register_char_driver(const char *name, ChardevBackendKind kind, void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp)) { CharDriver *s; @@ -4122,34 +4122,32 @@ void qmp_chardev_remove(const char *id, Error **errp) static void register_types(void) { - register_char_driver_qapi("null", CHARDEV_BACKEND_KIND_NULL, NULL); - register_char_driver_qapi("socket", CHARDEV_BACKEND_KIND_SOCKET, - qemu_chr_parse_socket); - register_char_driver_qapi("udp", CHARDEV_BACKEND_KIND_UDP, - qemu_chr_parse_udp); - register_char_driver_qapi("ringbuf", CHARDEV_BACKEND_KIND_RINGBUF, - qemu_chr_parse_ringbuf); - register_char_driver_qapi("file", CHARDEV_BACKEND_KIND_FILE, - qemu_chr_parse_file_out); - register_char_driver_qapi("stdio", CHARDEV_BACKEND_KIND_STDIO, - qemu_chr_parse_stdio); - register_char_driver_qapi("serial", CHARDEV_BACKEND_KIND_SERIAL, - qemu_chr_parse_serial); - register_char_driver_qapi("tty", CHARDEV_BACKEND_KIND_SERIAL, - qemu_chr_parse_serial); - register_char_driver_qapi("parallel", CHARDEV_BACKEND_KIND_PARALLEL, - qemu_chr_parse_parallel); - register_char_driver_qapi("parport", CHARDEV_BACKEND_KIND_PARALLEL, - qemu_chr_parse_parallel); - register_char_driver_qapi("pty", CHARDEV_BACKEND_KIND_PTY, NULL); - register_char_driver_qapi("console", CHARDEV_BACKEND_KIND_CONSOLE, NULL); - register_char_driver_qapi("pipe", CHARDEV_BACKEND_KIND_PIPE, - qemu_chr_parse_pipe); - register_char_driver_qapi("mux", CHARDEV_BACKEND_KIND_MUX, - qemu_chr_parse_mux); + register_char_driver("null", CHARDEV_BACKEND_KIND_NULL, NULL); + register_char_driver("socket", CHARDEV_BACKEND_KIND_SOCKET, + qemu_chr_parse_socket); + register_char_driver("udp", CHARDEV_BACKEND_KIND_UDP, qemu_chr_parse_udp); + register_char_driver("ringbuf", CHARDEV_BACKEND_KIND_RINGBUF, + qemu_chr_parse_ringbuf); + register_char_driver("file", CHARDEV_BACKEND_KIND_FILE, + qemu_chr_parse_file_out); + register_char_driver("stdio", CHARDEV_BACKEND_KIND_STDIO, + qemu_chr_parse_stdio); + register_char_driver("serial", CHARDEV_BACKEND_KIND_SERIAL, + qemu_chr_parse_serial); + register_char_driver("tty", CHARDEV_BACKEND_KIND_SERIAL, + qemu_chr_parse_serial); + register_char_driver("parallel", CHARDEV_BACKEND_KIND_PARALLEL, + qemu_chr_parse_parallel); + register_char_driver("parport", CHARDEV_BACKEND_KIND_PARALLEL, + qemu_chr_parse_parallel); + register_char_driver("pty", CHARDEV_BACKEND_KIND_PTY, NULL); + register_char_driver("console", CHARDEV_BACKEND_KIND_CONSOLE, NULL); + register_char_driver("pipe", CHARDEV_BACKEND_KIND_PIPE, + qemu_chr_parse_pipe); + register_char_driver("mux", CHARDEV_BACKEND_KIND_MUX, qemu_chr_parse_mux); /* Bug-compatibility: */ - register_char_driver_qapi("memory", CHARDEV_BACKEND_KIND_MEMORY, - qemu_chr_parse_ringbuf); + register_char_driver("memory", CHARDEV_BACKEND_KIND_MEMORY, + qemu_chr_parse_ringbuf); /* this must be done after machine init, since we register FEs with muxes * as part of realize functions like serial_isa_realizefn when -nographic * is specified diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 4518a4d..8106e06 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -368,10 +368,10 @@ static void qemu_chr_parse_spice_port(QemuOpts *opts, ChardevBackend *backend, static void register_types(void) { - register_char_driver_qapi("spicevmc", CHARDEV_BACKEND_KIND_SPICEVMC, - qemu_chr_parse_spice_vmc); - register_char_driver_qapi("spiceport", CHARDEV_BACKEND_KIND_SPICEPORT, - qemu_chr_parse_spice_port); + register_char_driver("spicevmc", CHARDEV_BACKEND_KIND_SPICEVMC, + qemu_chr_parse_spice_vmc); + register_char_driver("spiceport", CHARDEV_BACKEND_KIND_SPICEPORT, + qemu_chr_parse_spice_port); } type_init(register_types); diff --git a/ui/console.c b/ui/console.c index ab84549..3248d60 100644 --- a/ui/console.c +++ b/ui/console.c @@ -2066,8 +2066,7 @@ static const TypeInfo qemu_console_info = { static void register_types(void) { type_register_static(&qemu_console_info); - register_char_driver_qapi("vc", CHARDEV_BACKEND_KIND_VC, - qemu_chr_parse_vc); + register_char_driver("vc", CHARDEV_BACKEND_KIND_VC, qemu_chr_parse_vc); } type_init(register_types); -- 1.9.1