From patchwork Tue Apr 28 08:48:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 20359 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3S8nsdk020229 for ; Tue, 28 Apr 2009 08:49:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753441AbZD1IsZ (ORCPT ); Tue, 28 Apr 2009 04:48:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753482AbZD1IsZ (ORCPT ); Tue, 28 Apr 2009 04:48:25 -0400 Received: from mail08.svc.cra.dublin.eircom.net ([159.134.118.24]:33074 "HELO mail08.svc.cra.dublin.eircom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753407AbZD1IsY (ORCPT ); Tue, 28 Apr 2009 04:48:24 -0400 Received: (qmail 89780 messnum 13070927 invoked from network[83.70.64.178/83-70-64-178-dynamic.b-ras1.srl.dublin.eircom.net]); 28 Apr 2009 08:48:21 -0000 Received: from 83-70-64-178-dynamic.b-ras1.srl.dublin.eircom.net (HELO blaa.localdomain) (83.70.64.178) by mail08.svc.cra.dublin.eircom.net (qp 89780) with SMTP; 28 Apr 2009 08:48:21 -0000 Received: by blaa.localdomain (Postfix, from userid 500) id 8A71A88615; Tue, 28 Apr 2009 09:48:20 +0100 (IST) From: Mark McLoughlin To: avi@redhat.com Cc: kvm@vger.kernel.org, Mark McLoughlin Subject: [PATCH] kvm: qemu: net: unbreak tap networking Date: Tue, 28 Apr 2009 09:48:20 +0100 Message-Id: <1240908500-25598-1-git-send-email-markmc@redhat.com> X-Mailer: git-send-email 1.6.0.6 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org A recent merge broke tap networking because qemu_send_packet() now always returns -EAGAIN causing tap to try and resend the same packet forever. Fix by having qemu_send_packet() return the status from the qemu_deliver_packet() of the packet in question, rather than any packets which happened to have been queued up during the delivery of the original packet. Signed-off-by: Mark McLoughlin --- net.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net.c b/net.c index 16f6e48..b5ebcea 100644 --- a/net.c +++ b/net.c @@ -445,9 +445,9 @@ int qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size) vlan->send_queue = packet; } else { vlan->delivering = 1; - qemu_deliver_packet(vc, buf, size); + ret = qemu_deliver_packet(vc, buf, size); while ((packet = vlan->send_queue) != NULL) { - ret = qemu_deliver_packet(packet->sender, packet->data, packet->size); + qemu_deliver_packet(packet->sender, packet->data, packet->size); vlan->send_queue = packet->next; qemu_free(packet); }