From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R61G5-00028Q-E8 for qemu-devel@nongnu.org; Tue, 20 Sep 2011 10:25:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R61G0-0000lU-HF for qemu-devel@nongnu.org; Tue, 20 Sep 2011 10:25:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R61G0-0000kf-A5 for qemu-devel@nongnu.org; Tue, 20 Sep 2011 10:25:08 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8KEP6SB017235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Sep 2011 10:25:06 -0400 Date: Tue, 20 Sep 2011 15:25:01 +0100 From: "Daniel P. Berrange" Message-ID: <20110920142501.GF660@redhat.com> References: <2fb9e253266c4926a168168c854fdf5c68ccfca3.1316524908.git.quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2fb9e253266c4926a168168c854fdf5c68ccfca3.1316524908.git.quintela@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/7] migration: only flush when there are no errors Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On Tue, Sep 20, 2011 at 03:24:41PM +0200, Juan Quintela wrote: > If we have one error while migrating, and then we issuse a > "migrate_cancel" command, guest hang. Fix it for flushing only when > migration is in MIG_STATE_ACTIVE. In case of error of cancellation, > don't flush. > > We had an infinite loop at buffered_close() > > while (!s->has_error && s->buffer_size) { > buffered_flush(s); > if (s->freeze_output) > s->wait_for_unfreeze(s); > } > > There was no errors, there were things to send, and connection was > broken. send() returns -EAGAIN, so we freezed output, but we > unfreeze_output and try again. I posted a couple of alternative approaches to fixing this hang problem http://lists.nongnu.org/archive/html/qemu-devel/2011-08/msg03248.html My second approach of checking the migration state in migrate_fd_put_buffer() seems like it would be worthwhile, even with your patch as an additional safety net against bad code. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|