diff mbox

[5/6] chardev: switch the easy backends to realize

Message ID 1350329657-18665-6-git-send-email-aliguori@us.ibm.com
State New
Headers show

Commit Message

Anthony Liguori Oct. 15, 2012, 7:34 p.m. UTC
For backends that take no options, switching to realize is trivially easy.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qemu-char.c |   12 ++++++------
 qemu-char.h |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/qemu-char.c b/qemu-char.c
index e9a81c7..bc0fdbe 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 void qemu_chr_open_null(CharDriverState *chr, QemuOpts *opts, Error **errp)
+static void qemu_chr_open_null(CharDriverState *chr, Error **errp)
 {
     chr->chr_write = null_chr_write;
 }
@@ -1763,7 +1763,7 @@  static void qemu_chr_open_win_file(CharDriverState *chr, HANDLE fd_out)
     qemu_chr_generic_open(chr);
 }
 
-static void qemu_chr_open_win_con(CharDriverState *chr, QemuOpts *opts, Error **errp)
+static void qemu_chr_open_win_con(CharDriverState *chr, Error **errp)
 {
     qemu_chr_open_win_file(chr, GetStdHandle(STD_OUTPUT_HANDLE));
 }
@@ -1920,7 +1920,7 @@  static void win_stdio_close(CharDriverState *chr)
     stdio_nb_clients--;
 }
 
-static void qemu_chr_open_win_stdio(CharDriverState *chr, QemuOpts *opts, Error **errp)
+static void qemu_chr_open_win_stdio(CharDriverState *chr, Error **errp)
 {
     WinStdioCharState *stdio;
     DWORD              dwMode;
@@ -2693,7 +2693,7 @@  static void chardev_null_class_init(ObjectClass *klass, void *data)
 {
     CharDriverClass *cdc = CHARDEV_CLASS(klass);
 
-    cdc->open = qemu_chr_open_null;
+    cdc->realize = qemu_chr_open_null;
 }
 
 static const TypeInfo chardev_null_info = {
@@ -2774,7 +2774,7 @@  static void chardev_console_class_init(ObjectClass *klass, void *data)
 {
     CharDriverClass *cdc = CHARDEV_CLASS(klass);
 
-    cdc->open = qemu_chr_open_win_con;
+    cdc->realize = qemu_chr_open_win_con;
 }
 
 static const TypeInfo chardev_console_info = {
@@ -2864,7 +2864,7 @@  static void chardev_stdio_class_init(ObjectClass *klass, void *data)
     CharDriverClass *cdc = CHARDEV_CLASS(klass);
 
 #ifdef _WIN32
-    cdc->open = qemu_chr_open_win_stdio;
+    cdc->realize = qemu_chr_open_win_stdio;
 #else
     cdc->open = qemu_chr_open_stdio;
 #endif
diff --git a/qemu-char.h b/qemu-char.h
index be2a410..9e15dcd 100644
--- a/qemu-char.h
+++ b/qemu-char.h
@@ -68,7 +68,7 @@  struct CharDriverClass
 
     /* Objects should implement only one of these two methods */
     void (*open)(struct CharDriverState *chr, QemuOpts *opts, Error **errp);
-    void (*realize)(struct CharDriverState *chr, QemuOpts *opts, Error **errp);
+    void (*realize)(struct CharDriverState *chr, Error **errp);
 };
 
 struct CharDriverState {