From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH 1/7] console: allow VCs to be overridden by UI
Date: Wed, 5 Sep 2012 14:18:38 -0500 [thread overview]
Message-ID: <1346872724-9156-2-git-send-email-aliguori@us.ibm.com> (raw)
In-Reply-To: <1346872724-9156-1-git-send-email-aliguori@us.ibm.com>
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 <aliguori@us.ibm.com>
---
console.c | 14 +++++++++++++-
console.h | 6 +++++-
qemu-char.c | 2 +-
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/console.c b/console.c
index 3b5cabb..88a33f2 100644
--- a/console.c
+++ b/console.c
@@ -1536,7 +1536,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;
TextConsole *s;
@@ -1572,6 +1572,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;
diff --git a/console.h b/console.h
index 4334db5..eb428f9 100644
--- a/console.h
+++ b/console.h
@@ -359,7 +359,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);
@@ -367,6 +366,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 398baf1..18628d2 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2725,7 +2725,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 },
#ifdef _WIN32
{ .name = "file", .open = qemu_chr_open_win_file_out },
{ .name = "pipe", .open = qemu_chr_open_win_pipe },
--
1.7.5.4
next prev parent reply other threads:[~2012-09-05 19:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 19:18 [Qemu-devel] [PATCH 0/7] Add GTK UI to enable basic accessibility (v3) Anthony Liguori
2012-09-05 19:18 ` Anthony Liguori [this message]
2012-09-05 19:18 ` [Qemu-devel] [PATCH 2/7] ui: add basic GTK gui (v2) Anthony Liguori
2012-09-05 19:53 ` Blue Swirl
2012-09-05 20:00 ` Eric Blake
2012-09-05 20:38 ` Anthony Liguori
2012-09-05 21:00 ` Blue Swirl
2012-09-05 23:07 ` Anthony Liguori
2012-09-08 7:00 ` Blue Swirl
2012-09-05 20:04 ` Stefan Weil
2012-09-05 20:39 ` Anthony Liguori
2012-09-05 20:45 ` Jan Kiszka
2012-09-05 22:55 ` Anthony Liguori
2012-09-05 20:54 ` Jan Kiszka
2012-09-05 19:18 ` [Qemu-devel] [PATCH 3/7] gtk: add virtual console support (v2) Anthony Liguori
2012-09-05 19:18 ` [Qemu-devel] [PATCH 4/7] gtk: add support for input grabbing (v2) Anthony Liguori
2012-09-05 19:37 ` Jan Kiszka
2012-09-05 20:40 ` Anthony Liguori
2012-09-05 20:43 ` Jan Kiszka
2012-09-05 19:18 ` [Qemu-devel] [PATCH 5/7] gtk: add support for screen scaling and full screen (v3) Anthony Liguori
2012-09-05 19:18 ` [Qemu-devel] [PATCH 6/7] gtk: add translation support Anthony Liguori
2012-09-06 12:18 ` Kevin Wolf
2012-09-06 12:40 ` Anthony Liguori
2012-09-06 13:00 ` Peter Maydell
2012-09-05 19:18 ` [Qemu-devel] [PATCH 7/7] gtk: make default UI (v3) Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346872724-9156-2-git-send-email-aliguori@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).