Patchwork [3/9] chardev: switch null init to qapi

login
register
mail settings
Submitter Gerd Hoffmann
Date Feb. 25, 2013, 9:03 a.m.
Message ID <1361783023-10082-6-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/222874/
State New
Headers show

Comments

Gerd Hoffmann - Feb. 25, 2013, 9:03 a.m.
This patch switches over the 'null' chardev initialization
to the new qapi code path.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 qemu-char.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/qemu-char.c b/qemu-char.c
index fc908fa..ec49fb7 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -221,7 +221,7 @@  static int null_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
     return len;
 }
 
-static CharDriverState *qemu_chr_open_null(QemuOpts *opts)
+static CharDriverState *qemu_chr_open_null(void)
 {
     CharDriverState *chr;
 
@@ -2980,7 +2980,7 @@  static const struct {
     const int kind;
     void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp);
 } backend_table[] = {
-    { .name = "null",      .open = qemu_chr_open_null },
+    { .name = "null",      .kind  = CHARDEV_BACKEND_KIND_NULL },
     { .name = "socket",    .open = qemu_chr_open_socket },
     { .name = "udp",       .open = qemu_chr_open_udp },
     { .name = "msmouse",   .open = qemu_chr_open_msmouse },
@@ -3466,7 +3466,7 @@  ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
     }
 #endif
     case CHARDEV_BACKEND_KIND_NULL:
-        chr = qemu_chr_open_null(NULL);
+        chr = qemu_chr_open_null();
         break;
     case CHARDEV_BACKEND_KIND_MUX:
         base = qemu_chr_find(backend->mux->chardev);