From patchwork Mon Oct 15 19:34:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 191642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 400EA2C007C for ; Tue, 16 Oct 2012 06:35:03 +1100 (EST) Received: from localhost ([::1]:59993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNqRJ-00053M-BZ for incoming@patchwork.ozlabs.org; Mon, 15 Oct 2012 15:35:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNqR4-0004us-Tt for qemu-devel@nongnu.org; Mon, 15 Oct 2012 15:34:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNqQz-0001Lr-TR for qemu-devel@nongnu.org; Mon, 15 Oct 2012 15:34:46 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:47514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNqQz-0001Lg-Ac for qemu-devel@nongnu.org; Mon, 15 Oct 2012 15:34:41 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Oct 2012 01:04:39 +0530 Received: from d28relay04.in.ibm.com (9.184.220.61) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 16 Oct 2012 01:04:37 +0530 Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9FJYanc4522410 for ; Tue, 16 Oct 2012 01:04:37 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9FJYaRg002723 for ; Tue, 16 Oct 2012 06:34:36 +1100 Received: from titi.austin.rr.com (sig-9-76-154-111.mts.ibm.com [9.76.154.111]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9FJYJLZ002127; Tue, 16 Oct 2012 06:34:34 +1100 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Mon, 15 Oct 2012 14:34:16 -0500 Message-Id: <1350329657-18665-6-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1350329657-18665-1-git-send-email-aliguori@us.ibm.com> References: <1350329657-18665-1-git-send-email-aliguori@us.ibm.com> x-cbid: 12101519-5816-0000-0000-000004E7A0B2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 122.248.162.2 Cc: Paolo Bonzini , Anthony Liguori , Gerd Hoffmann , Andreas Faerber Subject: [Qemu-devel] [PATCH 5/6] chardev: switch the easy backends to realize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org For backends that take no options, switching to realize is trivially easy. Signed-off-by: Anthony Liguori --- qemu-char.c | 12 ++++++------ qemu-char.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) 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 {