From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ky6oc-0001cZ-0Y for qemu-devel@nongnu.org; Thu, 06 Nov 2008 10:30:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ky6ob-0001bz-AF for qemu-devel@nongnu.org; Thu, 06 Nov 2008 10:30:33 -0500 Received: from [199.232.76.173] (port=38914 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ky6oa-0001bc-Q9 for qemu-devel@nongnu.org; Thu, 06 Nov 2008 10:30:32 -0500 Received: from savannah.gnu.org ([199.232.41.3]:56062 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ky6oa-0007a5-KJ for qemu-devel@nongnu.org; Thu, 06 Nov 2008 10:30:32 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Ky6oW-00060Y-1s for qemu-devel@nongnu.org; Thu, 06 Nov 2008 15:30:28 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Ky6oT-00060H-7u for qemu-devel@nongnu.org; Thu, 06 Nov 2008 15:30:26 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 06 Nov 2008 15:30:25 +0000 Subject: [Qemu-devel] [5640] Make sure to resume the monitor only after flushing out outstanding 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 Revision: 5640 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5640 Author: aliguori Date: 2008-11-06 15:30:22 +0000 (Thu, 06 Nov 2008) Log Message: ----------- Make sure to resume the monitor only after flushing out outstanding network traffic. This was bug was reported by Chris Lalancette. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/migration-tcp.c Modified: trunk/migration-tcp.c =================================================================== --- trunk/migration-tcp.c 2008-11-06 09:38:51 UTC (rev 5639) +++ trunk/migration-tcp.c 2008-11-06 15:30:22 UTC (rev 5640) @@ -40,19 +40,11 @@ do { } while (0) #endif -int debug_me = 0; - static void tcp_cleanup(FdMigrationState *s) { - if (s->detach == 2) { - monitor_resume(); - s->detach = 0; - } - qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL); if (s->file) { - debug_me = 1; dprintf("closing file\n"); qemu_fclose(s->file); } @@ -60,6 +52,12 @@ if (s->fd != -1) close(s->fd); + /* Don't resume monitor until we've flushed all of the buffers */ + if (s->detach == 2) { + monitor_resume(); + s->detach = 0; + } + s->fd = -1; }