aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-09-29 15:33:42 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-10-19 10:06:09 +0200
commit0498790173e462ac3a7e4e0f3608704b8382dd10 (patch)
tree986421c82cbf36f12a7916fe10bf945f46e3c958
parente47666b8d1f0a7043d53671587058b3ce539b09d (diff)
qemu-char: convert testdev backend to data-driven creation
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--backends/testdev.c7
-rw-r--r--include/sysemu/char.h3
-rw-r--r--qemu-char.c2
-rw-r--r--stubs/Makefile.objs1
-rw-r--r--stubs/chr-testdev.c7
5 files changed, 6 insertions, 14 deletions
diff --git a/backends/testdev.c b/backends/testdev.c
index 43787f689f..26d5c7307a 100644
--- a/backends/testdev.c
+++ b/backends/testdev.c
@@ -108,7 +108,10 @@ static void testdev_close(struct CharDriverState *chr)
g_free(testdev);
}
-CharDriverState *chr_testdev_init(void)
+static CharDriverState *chr_testdev_init(const char *id,
+ ChardevBackend *backend,
+ ChardevReturn *ret,
+ Error **errp)
{
TestdevCharState *testdev;
CharDriverState *chr;
@@ -126,7 +129,7 @@ CharDriverState *chr_testdev_init(void)
static void register_types(void)
{
register_char_driver("testdev", CHARDEV_BACKEND_KIND_TESTDEV, NULL,
- NULL);
+ chr_testdev_init);
}
type_init(register_types);
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index 77415ec2eb..5c28c161f1 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -356,9 +356,6 @@ extern int term_escape_char;
CharDriverState *qemu_char_get_next_serial(void);
-/* testdev.c */
-CharDriverState *chr_testdev_init(void);
-
/* console.c */
typedef CharDriverState *(VcHandler)(ChardevVC *vc);
diff --git a/qemu-char.c b/qemu-char.c
index f2e3a352f4..56bc7ed6d9 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -4318,7 +4318,7 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
abort();
break;
case CHARDEV_BACKEND_KIND_TESTDEV:
- chr = chr_testdev_init();
+ abort();
break;
case CHARDEV_BACKEND_KIND_STDIO:
chr = qemu_chr_open_stdio(backend->stdio);
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 8cfa5a2f46..b5322a2057 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -1,6 +1,5 @@
stub-obj-y += arch-query-cpu-def.o
stub-obj-y += bdrv-commit-all.o
-stub-obj-y += chr-testdev.o
stub-obj-y += clock-warp.o
stub-obj-y += cpu-get-clock.o
stub-obj-y += cpu-get-icount.o
diff --git a/stubs/chr-testdev.c b/stubs/chr-testdev.c
deleted file mode 100644
index 23112a2c07..0000000000
--- a/stubs/chr-testdev.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "qemu-common.h"
-#include "sysemu/char.h"
-
-CharDriverState *chr_testdev_init(void)
-{
- return 0;
-}