aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-09-29 15:24:29 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-10-19 10:05:49 +0200
commit0d64992b5dfe099b170a0b19922833cc82745620 (patch)
treebec464dd5d4d5a256a9e24b987a34c5ded1cf683 /qemu-char.c
parentc2e75a432b907562cf93772b7d058d1ec8a8f8f1 (diff)
qemu-char: convert null backend to data-driven creation
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 15c1a1547f..5bacee8ff6 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -383,7 +383,10 @@ static int null_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
return len;
}
-static CharDriverState *qemu_chr_open_null(void)
+static CharDriverState *qemu_chr_open_null(const char *id,
+ ChardevBackend *backend,
+ ChardevReturn *ret,
+ Error **errp)
{
CharDriverState *chr;
@@ -4294,7 +4297,7 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
abort();
break;
case CHARDEV_BACKEND_KIND_NULL:
- chr = qemu_chr_open_null();
+ abort();
break;
case CHARDEV_BACKEND_KIND_MUX:
base = qemu_chr_find(backend->mux->chardev);
@@ -4397,7 +4400,7 @@ void qmp_chardev_remove(const char *id, Error **errp)
static void register_types(void)
{
register_char_driver("null", CHARDEV_BACKEND_KIND_NULL, NULL,
- NULL);
+ qemu_chr_open_null);
register_char_driver("socket", CHARDEV_BACKEND_KIND_SOCKET,
qemu_chr_parse_socket, qmp_chardev_open_socket);
register_char_driver("udp", CHARDEV_BACKEND_KIND_UDP, qemu_chr_parse_udp,