mirror of https://gitee.com/openkylin/qemu.git
qemu-char: convert testdev backend to data-driven creation
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e47666b8d1
commit
0498790173
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#include "qemu-common.h"
|
||||
#include "sysemu/char.h"
|
||||
|
||||
CharDriverState *chr_testdev_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue