From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1nnl-0001Nd-2j for qemu-devel@nongnu.org; Sun, 26 Feb 2012 18:46:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1nnk-00076U-5e for qemu-devel@nongnu.org; Sun, 26 Feb 2012 18:46:48 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:37472 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1nnj-00076N-Vq for qemu-devel@nongnu.org; Sun, 26 Feb 2012 18:46:48 -0500 From: Anthony Liguori Date: Sun, 26 Feb 2012 17:46:29 -0600 Message-Id: <1330299995-8688-3-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1330299995-8688-1-git-send-email-aliguori@us.ibm.com> References: <1330299995-8688-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 2/8] chr: check to see if front end has registered a read function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Weil , Anthony Liguori , Alex Graf , Paolo Bonzini Signed-off-by: Anthony Liguori --- qemu-char.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 5b2b35e..22bfb29 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -160,7 +160,9 @@ int qemu_chr_be_can_write(CharDriverState *s) void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len) { - s->chr_read(s->handler_opaque, buf, len); + if (s->chr_read) { + s->chr_read(s->handler_opaque, buf, len); + } } int qemu_chr_fe_get_msgfd(CharDriverState *s) -- 1.7.4.1