[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 35/40] char: move console in its own file
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 35/40] char: move console in its own file |
Date: |
Wed, 11 Jan 2017 18:29:51 +0100 |
Signed-off-by: Marc-André Lureau <address@hidden>
---
chardev/char-console.c | 30 ++++++++++++++++++++++++++++++
chardev/char.c | 3 ---
chardev/Makefile.objs | 1 +
3 files changed, 31 insertions(+), 3 deletions(-)
create mode 100644 chardev/char-console.c
diff --git a/chardev/char-console.c b/chardev/char-console.c
new file mode 100644
index 0000000000..6cc8336622
--- /dev/null
+++ b/chardev/char-console.c
@@ -0,0 +1,30 @@
+#include "qemu/osdep.h"
+#include "char-win.h"
+
+static void qemu_chr_open_win_con(Chardev *chr,
+ ChardevBackend *backend,
+ bool *be_opened,
+ Error **errp)
+{
+ qemu_chr_open_win_file(chr, GetStdHandle(STD_OUTPUT_HANDLE));
+}
+
+static void char_console_class_init(ObjectClass *oc, void *data)
+{
+ ChardevClass *cc = CHARDEV_CLASS(oc);
+
+ cc->open = qemu_chr_open_win_con;
+}
+
+static const TypeInfo char_console_type_info = {
+ .name = TYPE_CHARDEV_CONSOLE,
+ .parent = TYPE_CHARDEV_WIN,
+ .class_init = char_console_class_init,
+};
+
+static void register_types(void)
+{
+ type_register_static(&char_console_type_info);
+}
+
+type_init(register_types);
diff --git a/chardev/char.c b/chardev/char.c
index bd91826f8c..a11cec378d 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -2321,9 +2321,6 @@ static void register_types(void)
#ifdef HAVE_CHARDEV_PTY
type_register_static(&char_pty_type_info);
#endif
-#ifdef _WIN32
- type_register_static(&char_console_type_info);
-#endif
type_register_static(&char_pipe_type_info);
/* this must be done after machine init, since we register FEs with muxes
diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs
index ee40e8a1d7..265a6dad5d 100644
--- a/chardev/Makefile.objs
+++ b/chardev/Makefile.objs
@@ -1,4 +1,5 @@
chardev-obj-y += char.o
+chardev-obj-$(CONFIG_WIN32) += char-console.o
chardev-obj-$(CONFIG_POSIX) += char-fd.o
chardev-obj-y += char-file.o
chardev-obj-y += char-io.o
--
2.11.0
- [Qemu-devel] [PATCH 27/40] char: move QIOChannel-related in char-io.h, (continued)
- [Qemu-devel] [PATCH 27/40] char: move QIOChannel-related in char-io.h, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 28/40] char: move fd chardev in its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 29/40] char: move win chardev base class in its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 30/40] char: move win-stdio into its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 34/40] char: move stdio in its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 33/40] char: move file chardev in its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 32/40] char: move udp chardev in its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 35/40] char: move console in its own file,
Marc-André Lureau <=
- [Qemu-devel] [PATCH 36/40] char: move pipe chardev in its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 37/40] char: move pty chardev in its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 38/40] char: move serial chardev to itw own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 31/40] char: move socket chardev to its own file, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 40/40] char: headers clean-up, Marc-André Lureau, 2017/01/11
- [Qemu-devel] [PATCH 39/40] char: move parallel chardev in its own file, Marc-André Lureau, 2017/01/11