From patchwork Tue Jan 26 16:06:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 8124591 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A137FBEEE5 for ; Tue, 26 Jan 2016 16:07:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EED54201CD for ; Tue, 26 Jan 2016 16:07:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2ED54201B9 for ; Tue, 26 Jan 2016 16:07:08 +0000 (UTC) Received: from localhost ([::1]:44871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO695-00028g-Io for patchwork-qemu-devel@patchwork.kernel.org; Tue, 26 Jan 2016 11:07:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO68y-00028M-Fd for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO68u-0004JT-A5 for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:07:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO68u-0004JG-47 for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:06:56 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id CB6CEA3B49; Tue, 26 Jan 2016 16:06:55 +0000 (UTC) Received: from t530wlan.home.berrange.com.com (vpn1-4-241.ams2.redhat.com [10.36.4.241]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0QG6sYj007873; Tue, 26 Jan 2016 11:06:54 -0500 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 26 Jan 2016 16:06:49 +0000 Message-Id: <1453824409-10743-1-git-send-email-berrange@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell Subject: [Qemu-devel] [PATCH] char: make io_channel_send be used unconditionally 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The io_channel_send_full() method was used unconditionally, but the io_channel_send() method was only used from !_WIN32 code paths. Some versions of Mingw toolchain will complain about the method being defined but not used as a result. The io_channel_send() API doesn't really simplify life very much, so get rid of it and rename io_channel_send_full() to just be io_channel_send(). Signed-off-by: Daniel P. Berrange --- qemu-char.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 7ded3c2..4c3daa6 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -887,9 +887,9 @@ static void remove_fd_in_watch(CharDriverState *chr) } -static int io_channel_send_full(QIOChannel *ioc, - const void *buf, size_t len, - int *fds, size_t nfds) +static int io_channel_send(QIOChannel *ioc, + const void *buf, size_t len, + int *fds, size_t nfds) { size_t offset = 0; @@ -920,11 +920,6 @@ static int io_channel_send_full(QIOChannel *ioc, } -static int io_channel_send(QIOChannel *ioc, const void *buf, size_t len) -{ - return io_channel_send_full(ioc, buf, len, NULL, 0); -} - #ifndef _WIN32 typedef struct FDCharDriver { @@ -938,7 +933,7 @@ static int fd_chr_write(CharDriverState *chr, const uint8_t *buf, int len) { FDCharDriver *s = chr->opaque; - return io_channel_send(s->ioc_out, buf, len); + return io_channel_send(s->ioc_out, buf, len, NULL, 0); } static gboolean fd_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque) @@ -1257,7 +1252,7 @@ static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len) return 0; } } - return io_channel_send(s->ioc, buf, len); + return io_channel_send(s->ioc, buf, len, NULL, 0); } static GSource *pty_chr_add_watch(CharDriverState *chr, GIOCondition cond) @@ -2589,9 +2584,9 @@ static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len) { TCPCharDriver *s = chr->opaque; if (s->connected) { - int ret = io_channel_send_full(s->ioc, buf, len, - s->write_msgfds, - s->write_msgfds_num); + int ret = io_channel_send(s->ioc, buf, len, + s->write_msgfds, + s->write_msgfds_num); /* free the written msgfds, no matter what */ if (s->write_msgfds_num) {