提交 d9ac374f 编写于 作者: G Gerd Hoffmann

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: NGerd Hoffmann <kraxel@redhat.com>
上级 e68c5958
...@@ -3226,7 +3226,8 @@ ...@@ -3226,7 +3226,8 @@
'mux' : 'ChardevMux', 'mux' : 'ChardevMux',
'msmouse': 'ChardevDummy', 'msmouse': 'ChardevDummy',
'braille': 'ChardevDummy', 'braille': 'ChardevDummy',
'stdio' : 'ChardevStdio' } } 'stdio' : 'ChardevStdio',
'console': 'ChardevDummy' } }
## ##
# @ChardevReturn: # @ChardevReturn:
......
...@@ -1952,7 +1952,7 @@ static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out) ...@@ -1952,7 +1952,7 @@ static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out)
return chr; 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)); return qemu_chr_open_win_file(GetStdHandle(STD_OUTPUT_HANDLE));
} }
...@@ -3708,6 +3708,11 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend, ...@@ -3708,6 +3708,11 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
case CHARDEV_BACKEND_KIND_STDIO: case CHARDEV_BACKEND_KIND_STDIO:
chr = qemu_chr_open_stdio(backend->stdio); chr = qemu_chr_open_stdio(backend->stdio);
break; break;
#ifdef _WIN32
case CHARDEV_BACKEND_KIND_CONSOLE:
chr = qemu_chr_open_win_con();
break;
#endif
default: default:
error_setg(errp, "unknown chardev backend (%d)", backend->kind); error_setg(errp, "unknown chardev backend (%d)", backend->kind);
break; break;
...@@ -3764,9 +3769,9 @@ static void register_types(void) ...@@ -3764,9 +3769,9 @@ static void register_types(void)
register_char_driver_qapi("parport", CHARDEV_BACKEND_KIND_PARALLEL, register_char_driver_qapi("parport", CHARDEV_BACKEND_KIND_PARALLEL,
qemu_chr_parse_parallel); qemu_chr_parse_parallel);
register_char_driver_qapi("pty", CHARDEV_BACKEND_KIND_PTY, NULL); register_char_driver_qapi("pty", CHARDEV_BACKEND_KIND_PTY, NULL);
register_char_driver_qapi("console", CHARDEV_BACKEND_KIND_CONSOLE, NULL);
#ifdef _WIN32 #ifdef _WIN32
register_char_driver("pipe", qemu_chr_open_win_pipe); register_char_driver("pipe", qemu_chr_open_win_pipe);
register_char_driver("console", qemu_chr_open_win_con);
#else #else
register_char_driver("pipe", qemu_chr_open_pipe); register_char_driver("pipe", qemu_chr_open_pipe);
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册