[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/9] console: allow VCs to be overridden by UI
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 2/9] console: allow VCs to be overridden by UI |
Date: |
Mon, 18 Feb 2013 17:56:58 -0600 |
We want to expose VCs using a VteTerminal widget. We need access to provide our
own CharDriverState in order to do this.
Signed-off-by: Anthony Liguori <address@hidden>
---
include/ui/console.h | 6 +++++-
qemu-char.c | 2 +-
ui/console.c | 14 +++++++++++++-
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index fc23baa..b907931 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -442,7 +442,6 @@ void vga_hw_text_update(console_ch_t *chardata);
int is_graphic_console(void);
int is_fixedsize_console(void);
-CharDriverState *text_console_init(QemuOpts *opts);
void text_consoles_set_display(DisplayState *ds);
void console_select(unsigned int index);
void console_color_init(DisplayState *ds);
@@ -450,6 +449,11 @@ void qemu_console_resize(DisplayState *ds, int width, int
height);
void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
int dst_x, int dst_y, int w, int h);
+typedef CharDriverState *(VcHandler)(QemuOpts *);
+
+CharDriverState *vc_init(QemuOpts *opts);
+void register_vc_handler(VcHandler *handler);
+
/* sdl.c */
void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
diff --git a/qemu-char.c b/qemu-char.c
index e4b0f53..160decc 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2980,7 +2980,7 @@ static const struct {
{ .name = "socket", .open = qemu_chr_open_socket },
{ .name = "udp", .open = qemu_chr_open_udp },
{ .name = "msmouse", .open = qemu_chr_open_msmouse },
- { .name = "vc", .open = text_console_init },
+ { .name = "vc", .open = vc_init },
{ .name = "memory", .open = qemu_chr_open_ringbuf },
#ifdef _WIN32
{ .name = "file", .open = qemu_chr_open_win_file_out },
diff --git a/ui/console.c b/ui/console.c
index 0a68836..163706e 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1532,7 +1532,7 @@ static void text_console_do_init(CharDriverState *chr,
DisplayState *ds)
chr->init(chr);
}
-CharDriverState *text_console_init(QemuOpts *opts)
+static CharDriverState *text_console_init(QemuOpts *opts)
{
CharDriverState *chr;
QemuConsole *s;
@@ -1568,6 +1568,18 @@ CharDriverState *text_console_init(QemuOpts *opts)
return chr;
}
+static VcHandler *vc_handler = text_console_init;
+
+CharDriverState *vc_init(QemuOpts *opts)
+{
+ return vc_handler(opts);
+}
+
+void register_vc_handler(VcHandler *handler)
+{
+ vc_handler = handler;
+}
+
void text_consoles_set_display(DisplayState *ds)
{
int i;
--
1.8.0
- [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, (continued)
- [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, Anthony Liguori, 2013/02/18
- Re: [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, Kevin Wolf, 2013/02/20
- Re: [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, Laszlo Ersek, 2013/02/20
- Re: [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, Kevin Wolf, 2013/02/20
- Re: [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, Laszlo Ersek, 2013/02/20
- Re: [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, Kevin Wolf, 2013/02/20
- Re: [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, Laszlo Ersek, 2013/02/20
- Re: [Qemu-devel] [PATCH 1/9] build: disable Wstrict-prototypes, Markus Armbruster, 2013/02/20
[Qemu-devel] [PATCH 2/9] console: allow VCs to be overridden by UI,
Anthony Liguori <=
[Qemu-devel] [PATCH 4/9] gtk: add virtual console support (v2), Anthony Liguori, 2013/02/18
[Qemu-devel] [PATCH 5/9] gtk: add support for input grabbing (v2), Anthony Liguori, 2013/02/18
[Qemu-devel] [PATCH 3/9] ui: add basic GTK gui (v4), Anthony Liguori, 2013/02/18
[Qemu-devel] [PATCH 6/9] gtk: add support for screen scaling and full screen (v3), Anthony Liguori, 2013/02/18