From patchwork Tue Jul 7 09:00:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 492113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D89DF14028F for ; Tue, 7 Jul 2015 19:01:40 +1000 (AEST) Received: from localhost ([::1]:55959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCOl1-0008Um-5s for incoming@patchwork.ozlabs.org; Tue, 07 Jul 2015 05:01:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCOkR-0007mr-U2 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:01:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCOkO-00070Z-Ma for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:01:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCOkO-00070N-I0 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:01:00 -0400 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 2563296FC for ; Tue, 7 Jul 2015 09:01:00 +0000 (UTC) Received: from jason-ThinkPad-T430s.nay.redhat.com (dhcp-14-122.nay.redhat.com [10.66.14.122]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6790vkU024180; Tue, 7 Jul 2015 05:00:58 -0400 From: Jason Wang To: stefanha@redhat.com, qemu-devel@nongnu.org Date: Tue, 7 Jul 2015 17:00:56 +0800 Message-Id: <1436259656-24263-1-git-send-email-jasowang@redhat.com> 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: Jason Wang , famz@redhat.com Subject: [Qemu-devel] [PATCH 2.4] socket: pass correct size in net_socket_send() 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 We should pass the size of packet instead of the remaining to qemu_send_packet_async(). Fixes: 6e99c631f116221d169ea53953d91b8aa74d297a ("net/socket: Drop net_socket_can_send") Signed-off-by: Jason Wang Reviewed-by: Fam Zheng --- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/socket.c b/net/socket.c index c752696..b1e3b1c 100644 --- a/net/socket.c +++ b/net/socket.c @@ -213,7 +213,7 @@ static void net_socket_send(void *opaque) if (s->index >= s->packet_len) { s->index = 0; s->state = 0; - if (qemu_send_packet_async(&s->nc, s->buf, size, + if (qemu_send_packet_async(&s->nc, s->buf, s->packet_len, net_socket_send_completed) == 0) { net_socket_read_poll(s, false); break;