aboutsummaryrefslogtreecommitdiff
path: root/qtest.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-22 12:52:52 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-10-24 15:27:20 +0200
commit32a6ebecd2ffe82ffade5edf9e054e20cb48f281 (patch)
treeb1e82e3f6eb4a28c65098015dd8114e190a064bf /qtest.c
parentbecdfa00cfa2995e859ccefa4b7d72a72eb96581 (diff)
char: remaining switch to CharBackend in frontend
Similar to previous change, for the remaining CharDriverState front ends users. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-13-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qtest.c')
-rw-r--r--qtest.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/qtest.c b/qtest.c
index 2d9a021de3..3fb3c11c8e 100644
--- a/qtest.c
+++ b/qtest.c
@@ -38,7 +38,7 @@ bool qtest_allowed;
static DeviceState *irq_intercept_dev;
static FILE *qtest_log_fp;
-static CharDriverState *qtest_chr;
+static CharBackend qtest_chr;
static GString *inbuf;
static int irq_levels[MAX_IRQ];
static qemu_timeval start_time;
@@ -249,7 +249,7 @@ static void qtest_irq_handler(void *opaque, int n, int level)
qemu_set_irq(old_irq, level);
if (irq_levels[n] != level) {
- CharDriverState *chr = qtest_chr;
+ CharDriverState *chr = qtest_chr.chr;
irq_levels[n] = level;
qtest_send_prefix(chr);
qtest_sendf(chr, "IRQ %s %d\n",
@@ -690,12 +690,12 @@ void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
qemu_chr_fe_set_echo(chr, true);
inbuf = g_string_new("");
- qtest_chr = chr;
+ qemu_chr_fe_init(&qtest_chr, chr, errp);
}
bool qtest_driver(void)
{
- return qtest_chr;
+ return qtest_chr.chr != NULL;
}
static void qtest_accel_class_init(ObjectClass *oc, void *data)