qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PATCH 14/21] qemu-char: convert braille backend to data-driven creation
Date: Mon, 12 Oct 2015 10:03:17 +0200	[thread overview]
Message-ID: <1444637004-20195-15-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1444637004-20195-1-git-send-email-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 backends/baum.c       | 13 ++++++++-----
 include/sysemu/char.h |  3 ---
 qemu-char.c           |  4 +---
 stubs/Makefile.objs   |  1 -
 stubs/chr-baum-init.c |  7 -------
 5 files changed, 9 insertions(+), 19 deletions(-)
 delete mode 100644 stubs/chr-baum-init.c

diff --git a/backends/baum.c b/backends/baum.c
index e86a019..281be30 100644
--- a/backends/baum.c
+++ b/backends/baum.c
@@ -561,7 +561,10 @@ static void baum_close(struct CharDriverState *chr)
     g_free(baum);
 }
 
-CharDriverState *chr_baum_init(void)
+static CharDriverState *chr_baum_init(const char *id,
+                                      ChardevBackend *backend,
+                                      ChardevReturn *ret,
+                                      Error **errp)
 {
     BaumDriverState *baum;
     CharDriverState *chr;
@@ -586,14 +589,14 @@ CharDriverState *chr_baum_init(void)
 
     baum->brlapi_fd = brlapi__openConnection(handle, NULL, NULL);
     if (baum->brlapi_fd == -1) {
-        brlapi_perror("baum_init: brlapi_openConnection");
+        error_setg(errp, "baum_init: brlapi_openConnection");
         goto fail_handle;
     }
 
     baum->cellCount_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, baum_cellCount_timer_cb, baum);
 
     if (brlapi__getDisplaySize(handle, &baum->x, &baum->y) == -1) {
-        brlapi_perror("baum_init: brlapi_getDisplaySize");
+        error_setg(errp, "baum_init: brlapi_getDisplaySize");
         goto fail;
     }
 
@@ -609,7 +612,7 @@ CharDriverState *chr_baum_init(void)
         tty = BRLAPI_TTY_DEFAULT;
 
     if (brlapi__enterTtyMode(handle, tty, NULL) == -1) {
-        brlapi_perror("baum_init: brlapi_enterTtyMode");
+        error_setg(errp, "baum_init: brlapi_enterTtyMode");
         goto fail;
     }
 
@@ -630,7 +633,7 @@ fail_handle:
 static void register_types(void)
 {
     register_char_driver("braille", CHARDEV_BACKEND_KIND_BRAILLE, NULL,
-                         NULL);
+                         chr_baum_init);
 }
 
 type_init(register_types);
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index 2fe8275..77415ec 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -359,9 +359,6 @@ CharDriverState *qemu_char_get_next_serial(void);
 /* testdev.c */
 CharDriverState *chr_testdev_init(void);
 
-/* baum.c */
-CharDriverState *chr_baum_init(void);
-
 /* console.c */
 typedef CharDriverState *(VcHandler)(ChardevVC *vc);
 
diff --git a/qemu-char.c b/qemu-char.c
index 8425891..96f40f3 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -4323,11 +4323,9 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
         case CHARDEV_BACKEND_KIND_MSMOUSE:
             abort();
             break;
-#ifdef CONFIG_BRLAPI
         case CHARDEV_BACKEND_KIND_BRAILLE:
-            chr = chr_baum_init();
+            abort();
             break;
-#endif
         case CHARDEV_BACKEND_KIND_TESTDEV:
             chr = chr_testdev_init();
             break;
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 63988ca..8cfa5a2 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-baum-init.o
 stub-obj-y += chr-testdev.o
 stub-obj-y += clock-warp.o
 stub-obj-y += cpu-get-clock.o
diff --git a/stubs/chr-baum-init.c b/stubs/chr-baum-init.c
deleted file mode 100644
index f5cc6ce..0000000
--- a/stubs/chr-baum-init.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "qemu-common.h"
-#include "sysemu/char.h"
-
-CharDriverState *chr_baum_init(void)
-{
-    return NULL;
-}
-- 
2.5.0

  parent reply	other threads:[~2015-10-12  8:03 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12  8:03 [Qemu-devel] [PATCH 00/22] qemu-char: refactoring of chardev creation Paolo Bonzini
2015-10-12  8:03 ` [Qemu-devel] [PATCH 01/21] qemu-char: cleanup qmp_chardev_add Paolo Bonzini
2015-10-12 14:55   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 02/21] qemu-char: cleanup HAVE_CHARDEV_* Paolo Bonzini
2015-10-12 14:57   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 03/21] qemu-char: add create to register_char_driver Paolo Bonzini
2015-10-12 15:04   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 04/21] qemu-char: convert file backend to data-driven creation Paolo Bonzini
2015-10-12 15:06   ` Eric Blake
2015-10-12 15:17     ` Paolo Bonzini
2015-10-12  8:03 ` [Qemu-devel] [PATCH 05/21] qemu-char: convert serial " Paolo Bonzini
2015-10-12 15:09   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 06/21] qemu-char: convert parallel " Paolo Bonzini
2015-10-12 15:13   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 07/21] qemu-char: convert pipe " Paolo Bonzini
2015-10-12 15:16   ` Eric Blake
2015-10-12 15:18     ` Paolo Bonzini
2015-10-12 15:21       ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 08/21] qemu-char: convert socket " Paolo Bonzini
2015-10-12 15:20   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 09/21] qemu-char: convert UDP " Paolo Bonzini
2015-10-12 15:22   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 10/21] qemu-char: convert pty " Paolo Bonzini
2015-10-12 15:22   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 11/21] qemu-char: convert null " Paolo Bonzini
2015-10-12 15:23   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 12/21] qemu-char: convert mux " Paolo Bonzini
2015-10-12 15:24   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 13/21] qemu-char: convert msmouse " Paolo Bonzini
2015-10-12 15:25   ` Eric Blake
2015-10-12  8:03 ` Paolo Bonzini [this message]
2015-10-12 15:30   ` [Qemu-devel] [PATCH 14/21] qemu-char: convert braille " Eric Blake
2015-10-12 15:41     ` Samuel Thibault
2015-10-14 15:51       ` Paolo Bonzini
2015-10-14 15:55         ` Eric Blake
2015-10-14 16:34         ` Samuel Thibault
2015-10-14 16:51           ` Paolo Bonzini
2015-10-12  8:03 ` [Qemu-devel] [PATCH 15/21] qemu-char: convert testdev " Paolo Bonzini
2015-10-12 15:49   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 16/21] qemu-char: convert stdio " Paolo Bonzini
2015-10-12 15:50   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 17/21] qemu-char: convert console " Paolo Bonzini
2015-10-12 15:50   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 18/21] qemu-char: convert spice " Paolo Bonzini
2015-10-12 15:51   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 19/21] qemu-char: convert vc " Paolo Bonzini
2015-10-12 15:53   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 20/21] qemu-char: convert ringbuf " Paolo Bonzini
2015-10-12 15:53   ` Eric Blake
2015-10-12  8:03 ` [Qemu-devel] [PATCH 21/21] qemu-char: cleanup after completed conversion to cd->create Paolo Bonzini
2015-10-12 15:55   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444637004-20195-15-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).