[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 49/54] char: move console in its own file
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 49/54] char: move console in its own file |
Date: |
Tue, 13 Dec 2016 01:43:20 +0300 |
Signed-off-by: Marc-André Lureau <address@hidden>
---
chardev/char-console.c | 30 ++++++++++++++++++++++++++++++
chardev/char.c | 24 ------------------------
chardev/Makefile.objs | 1 +
3 files changed, 31 insertions(+), 24 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 7421570399..3975236cd9 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -1403,27 +1403,6 @@ static void qemu_chr_open_pipe(Chardev *chr,
}
}
-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,
-};
-
#endif /* !_WIN32 */
int qemu_chr_wait_connected(Chardev *chr, Error **errp)
@@ -2319,9 +2298,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 40/54] char: remove unused READ_RETRIES, (continued)
- [Qemu-devel] [PATCH 40/54] char: remove unused READ_RETRIES, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 39/54] char: rename and move to header CHR_READ_BUF_LEN, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 41/54] char: move QIOChannel-related in char-io.h, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 42/54] char: move fd chardev in its own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 43/54] char: move win chardev base class in its own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 44/54] char: move win-stdio into its own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 46/54] char: move udp chardev in its own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 45/54] char: move socket chardev to itw own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 48/54] char: move stdio in its own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 47/54] char: move file chardev in its own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 49/54] char: move console in its own file,
Marc-André Lureau <=
- [Qemu-devel] [PATCH 50/54] char: move pipe chardev in its own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 51/54] char: move pty chardev in its own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 52/54] char: move serial chardev to itw own file, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 54/54] char: headers clean-up, Marc-André Lureau, 2016/12/12
- [Qemu-devel] [PATCH 53/54] char: move parallel chardev in its own file, Marc-André Lureau, 2016/12/12
- Re: [Qemu-devel] [PATCH 00/54] WIP: chardev: qom-ify, no-reply, 2016/12/12