Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F7BEV-00065P-7J for qemu-devel@nongnu.org; Thu, 09 Feb 2006 07:49:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F7BC7-0005LJ-1S for qemu-devel@nongnu.org; Thu, 09 Feb 2006 07:46:44 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F7AbC-0007OR-9A for qemu-devel@nongnu.org; Thu, 09 Feb 2006 07:08:35 -0500 Received: from [212.227.126.171] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F7Aej-0003hD-Dd for qemu-devel@nongnu.org; Thu, 09 Feb 2006 07:12:13 -0500 Received: from alpha9.centauri.home ([10.21.2.7]) by alpha0.centauri.home with esmtp (Exim 4.54) id 1F7AbA-0002JH-0S for qemu-devel@nongnu.org; Thu, 09 Feb 2006 13:08:32 +0100 From: Juergen Pfennig Date: Thu, 9 Feb 2006 13:08:30 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602091308.30349.info@j-pfennig.de> Subject: [Qemu-devel] [FIX] ne2000 when vm stopped - network hangs after loadvm Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, there is still a little problem with ne2000: (1) when the vm is in stopped state packets are still received (2) this can fill the receive buffer before savevm ... (3) when restarting qemu with loadvm the buffer is still full (4) the guest OS does not get an int, so it does not know that data is in the buffer (5) new data will be discarded (buffer full) - the guest OS waits forever. (6) this make windows (users) unhappy. One possible solution (but not a perfect one) is to block receiving when the vm is stopped: 8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--- static void ne2000_receive(void *opaque, const uint8_t *buf, int size) { // ... some lines skipped if (s->cmd & E8390_STOP || ne2000_buffer_full(s) || vm_running == 0) return; // ... some lines skipped } >8--->8--->8--->8--->8--->8--->8--->8--->8--->8--->8--->8--->8--->8--- Juergen