From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6Ji6-00008Q-LZ for qemu-devel@nongnu.org; Mon, 05 Aug 2013 08:16:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6Ji1-0006eI-Os for qemu-devel@nongnu.org; Mon, 05 Aug 2013 08:16:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6Ji1-0006dl-IB for qemu-devel@nongnu.org; Mon, 05 Aug 2013 08:16:21 -0400 From: Stefan Hajnoczi Date: Mon, 5 Aug 2013 14:16:15 +0200 Message-Id: <1375704975-19128-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1375704975-19128-1-git-send-email-stefanha@redhat.com> References: <1375704975-19128-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 1/1] pcnet: Flush queued packets on end of STOP state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka , Anthony Liguori , Stefan Hajnoczi From: Jan Kiszka Analogously to other NICs, we have to inform the network layer when the can_receive handler will no longer report 0. Without this, we may get stuck waiting on queued incoming packets. Signed-off-by: Jan Kiszka Signed-off-by: Stefan Hajnoczi --- hw/net/pcnet.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c index b606d2b..63aa73a 100644 --- a/hw/net/pcnet.c +++ b/hw/net/pcnet.c @@ -861,6 +861,8 @@ static void pcnet_init(PCNetState *s) s->csr[0] |= 0x0101; s->csr[0] &= ~0x0004; /* clear STOP bit */ + + qemu_flush_queued_packets(qemu_get_queue(s->nic)); } static void pcnet_start(PCNetState *s) @@ -878,6 +880,8 @@ static void pcnet_start(PCNetState *s) s->csr[0] &= ~0x0004; /* clear STOP bit */ s->csr[0] |= 0x0002; pcnet_poll_timer(s); + + qemu_flush_queued_packets(qemu_get_queue(s->nic)); } static void pcnet_stop(PCNetState *s) -- 1.8.1.4