summaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-18 14:08:04 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-18 14:08:04 +0000
commit95991b84e71e0b01f21e79767d77c13cc7d20a7c (patch)
treebb58577711ef3fedae6ebbe731ac4da7f2d85bde /qemu-char.c
parentb6555bcd4a4917899ed080888af84365f906f1a7 (diff)
downloadqemu-95991b84e71e0b01f21e79767d77c13cc7d20a7c.tar.gz
qemu-95991b84e71e0b01f21e79767d77c13cc7d20a7c.tar.bz2
qemu-95991b84e71e0b01f21e79767d77c13cc7d20a7c.zip
add an init function parameter to qemu_chr_open()
And use it for the malta emulation. Fix segfault introduced in revision 6352. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6365 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 02d4049d0c..ac431c7c5c 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2122,7 +2122,7 @@ static CharDriverState *qemu_chr_open_tcp(const char *host_str,
static TAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs
= TAILQ_HEAD_INITIALIZER(chardevs);
-CharDriverState *qemu_chr_open(const char *label, const char *filename)
+CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
{
const char *p;
CharDriverState *chr;
@@ -2146,7 +2146,7 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename)
chr = qemu_chr_open_udp(p);
} else
if (strstart(filename, "mon:", &p)) {
- chr = qemu_chr_open(label, p);
+ chr = qemu_chr_open(label, p, NULL);
if (chr) {
chr = qemu_chr_open_mux(chr);
monitor_init(chr, !nographic);
@@ -2207,6 +2207,7 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename)
if (chr) {
if (!chr->filename)
chr->filename = qemu_strdup(filename);
+ chr->init = init;
chr->label = qemu_strdup(label);
TAILQ_INSERT_TAIL(&chardevs, chr, next);
}