From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjZjl-00072u-IT for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:35:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjZjh-0001iy-1C for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:35:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjZjg-0001is-FP for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:35:00 -0400 Date: Wed, 20 Jul 2011 13:34:50 -0300 From: Marcelo Tosatti Message-ID: <20110720163450.GA17333@amt.cnet> References: <20110719115511.609C553E5@gandalf.tls.msk.ru> <4E25FBA6.3060803@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E25FBA6.3060803@web.de> Subject: Re: [Qemu-devel] [PATCH] do not call monitor_resume() from migrate_fd_put_buffer() error path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Michael Tokarev , qemu-devel@nongnu.org On Tue, Jul 19, 2011 at 11:48:22PM +0200, Jan Kiszka wrote: > On 2011-07-19 13:46, Michael Tokarev wrote: > > If we do, it results in double monitor_resume() (second being called > > from migrate_fd_cleanup() anyway) and monitor suspend count becoming > > negative. > > > > Cc'ing people from `git blame' list for the lines in question: the > > change fixes the problem but I'm not sure what the original intention > > of this code was in this place. Unfortunately noone replied to two > > my attempts to raise this issue. > > > > Signed-Off-By: Michael Tokarev > > --- > > migration.c | 3 --- > > 1 files changed, 0 insertions(+), 3 deletions(-) > > > > diff --git a/migration.c b/migration.c > > index af3a1f2..115588c 100644 > > --- a/migration.c > > +++ b/migration.c > > @@ -330,9 +330,6 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size) > > if (ret == -EAGAIN) { > > qemu_set_fd_handler2(s->fd, NULL, NULL, migrate_fd_put_notify, s); > > } else if (ret < 0) { > > - if (s->mon) { > > - monitor_resume(s->mon); > > - } > > s->state = MIG_STATE_ERROR; > > notifier_list_notify(&migration_state_notifiers); > > } > > Looks reasonable to me, but Marcelo should comment on this, specifically > which scenario once required the resume. > > Jan If the monitor was suspended (migrate without -d), then this path must resume. Should record that somewhere and check here.