summaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-02-25 11:48:06 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-03-13 10:27:46 +0100
commitd9ac374f0def9a65340c1768c08e3271f4d7798d (patch)
treeb46d323d8373937bf39c1a32f7ee2ec9eb640289 /qemu-char.c
parente68c5958668596a5023e30ddf8368410878f7682 (diff)
chardev: add console support to qapi
This patch adds 'console' support to qapi and also switches over the console chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 158b81edef..c3d44207da 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1952,7 +1952,7 @@ static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out)
return chr;
}
-static CharDriverState *qemu_chr_open_win_con(QemuOpts *opts)
+static CharDriverState *qemu_chr_open_win_con(void)
{
return qemu_chr_open_win_file(GetStdHandle(STD_OUTPUT_HANDLE));
}
@@ -3708,6 +3708,11 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
case CHARDEV_BACKEND_KIND_STDIO:
chr = qemu_chr_open_stdio(backend->stdio);
break;
+#ifdef _WIN32
+ case CHARDEV_BACKEND_KIND_CONSOLE:
+ chr = qemu_chr_open_win_con();
+ break;
+#endif
default:
error_setg(errp, "unknown chardev backend (%d)", backend->kind);
break;
@@ -3764,9 +3769,9 @@ static void register_types(void)
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);
#ifdef _WIN32
register_char_driver("pipe", qemu_chr_open_win_pipe);
- register_char_driver("console", qemu_chr_open_win_con);
#else
register_char_driver("pipe", qemu_chr_open_pipe);
#endif