From patchwork Tue Nov 3 14:29:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 37514 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 514F8B7B99 for ; Wed, 4 Nov 2009 01:57:37 +1100 (EST) Received: from localhost ([127.0.0.1]:60218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5KpC-0000RF-1T for incoming@patchwork.ozlabs.org; Tue, 03 Nov 2009 09:57:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5KR7-0002xR-76 for qemu-devel@nongnu.org; Tue, 03 Nov 2009 09:32:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5KR2-0002vZ-Gp for qemu-devel@nongnu.org; Tue, 03 Nov 2009 09:32:40 -0500 Received: from [199.232.76.173] (port=60065 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5KR2-0002vK-8z for qemu-devel@nongnu.org; Tue, 03 Nov 2009 09:32:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59040) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5KR1-0000t7-P1 for qemu-devel@nongnu.org; Tue, 03 Nov 2009 09:32:36 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nA3EWYHd022755 for ; Tue, 3 Nov 2009 09:32:34 -0500 Received: from localhost (vpn-11-19.rdu.redhat.com [10.11.11.19]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nA3EWWET026991; Tue, 3 Nov 2009 09:32:33 -0500 From: Amit Shah To: qemu-devel@nongnu.org Date: Tue, 3 Nov 2009 19:59:56 +0530 Message-Id: <1257258596-4556-4-git-send-email-amit.shah@redhat.com> In-Reply-To: <1257258596-4556-3-git-send-email-amit.shah@redhat.com> References: <1257258596-4556-1-git-send-email-amit.shah@redhat.com> <1257258596-4556-2-git-send-email-amit.shah@redhat.com> <1257258596-4556-3-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Amit Shah Subject: [Qemu-devel] [PATCH 3/3] char: rename qemu_chr_reset to qemu_chr_generic_open X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This function sends out the OPENED event to backends that have drive the chardevs. The 'reset' is now a historical artifact and we can now just call the function for what it is. Signed-off-by: Amit Shah --- console.c | 2 +- hw/baum.c | 2 +- qemu-char.c | 22 +++++++++++----------- qemu-char.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/console.c b/console.c index 9bbef59..82ddbe4 100644 --- a/console.c +++ b/console.c @@ -1384,7 +1384,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds, QemuOpt s->t_attrib = s->t_attrib_default; text_console_resize(s); - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); if (chr->init) chr->init(chr); } diff --git a/hw/baum.c b/hw/baum.c index 8a12985..fa356ec 100644 --- a/hw/baum.c +++ b/hw/baum.c @@ -614,7 +614,7 @@ CharDriverState *chr_baum_init(QemuOpts *opts) qemu_set_fd_handler(baum->brlapi_fd, baum_chr_read, NULL, baum); - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); return chr; diff --git a/qemu-char.c b/qemu-char.c index d78bae3..5a81e8f 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -112,7 +112,7 @@ static void qemu_chr_event(CharDriverState *s, int event) s->chr_event(s->handler_opaque, event); } -static void qemu_chr_reset_bh(void *opaque) +static void qemu_chr_generic_open_bh(void *opaque) { CharDriverState *s = opaque; qemu_chr_event(s, CHR_EVENT_OPENED); @@ -120,10 +120,10 @@ static void qemu_chr_reset_bh(void *opaque) s->bh = NULL; } -void qemu_chr_reset(CharDriverState *s) +void qemu_chr_generic_open(CharDriverState *s) { if (s->bh == NULL) { - s->bh = qemu_bh_new(qemu_chr_reset_bh, s); + s->bh = qemu_bh_new(qemu_chr_generic_open_bh, s); qemu_bh_schedule(s->bh); } } @@ -610,7 +610,7 @@ static CharDriverState *qemu_chr_open_fd(int fd_in, int fd_out) chr->chr_update_read_handler = fd_chr_update_read_handler; chr->chr_close = fd_chr_close; - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); return chr; } @@ -910,7 +910,7 @@ static void pty_chr_state(CharDriverState *chr, int connected) qemu_mod_timer(s->timer, qemu_get_clock(rt_clock) + 1000); } else { if (!s->connected) - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); s->connected = 1; } } @@ -1184,7 +1184,7 @@ static CharDriverState *qemu_chr_open_tty(QemuOpts *opts) return NULL; } chr->chr_ioctl = tty_serial_ioctl; - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); return chr; } #else /* ! __linux__ && ! __sun__ */ @@ -1330,7 +1330,7 @@ static CharDriverState *qemu_chr_open_pp(QemuOpts *opts) chr->chr_close = pp_close; chr->opaque = drv; - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); return chr; } @@ -1611,7 +1611,7 @@ static CharDriverState *qemu_chr_open_win(QemuOpts *opts) free(chr); return NULL; } - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); return chr; } @@ -1711,7 +1711,7 @@ static CharDriverState *qemu_chr_open_win_pipe(QemuOpts *opts) free(chr); return NULL; } - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); return chr; } @@ -1725,7 +1725,7 @@ static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out) s->hcom = fd_out; chr->opaque = s; chr->chr_write = win_chr_write; - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); return chr; } @@ -2052,7 +2052,7 @@ static void tcp_chr_connect(void *opaque) s->connected = 1; qemu_set_fd_handler2(s->fd, tcp_chr_read_poll, tcp_chr_read, NULL, chr); - qemu_chr_reset(chr); + qemu_chr_generic_open(chr); } #define IACSET(x,a,b,c) x[0] = a; x[1] = b; x[2] = c; diff --git a/qemu-char.h b/qemu-char.h index b420111..9957db1 100644 --- a/qemu-char.h +++ b/qemu-char.h @@ -82,7 +82,7 @@ void qemu_chr_add_handlers(CharDriverState *s, IOEventHandler *fd_event, void *opaque); int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg); -void qemu_chr_reset(CharDriverState *s); +void qemu_chr_generic_open(CharDriverState *s); int qemu_chr_can_read(CharDriverState *s); void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len); int qemu_chr_get_msgfd(CharDriverState *s);