From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp3XD-0001uL-Mc for qemu-devel@nongnu.org; Thu, 04 Aug 2011 15:24:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qp3XC-0005BM-6k for qemu-devel@nongnu.org; Thu, 04 Aug 2011 15:24:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp3XB-0005BG-Pw for qemu-devel@nongnu.org; Thu, 04 Aug 2011 15:24:46 -0400 Date: Thu, 4 Aug 2011 16:24:41 -0300 From: Luiz Capitulino Message-ID: <20110804162441.0045215c@doriath> In-Reply-To: <1312383104-9565-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1312383104-9565-1-git-send-email-mjt@msgid.tls.msk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Michael Tokarev Cc: Jan Kiszka , mtosatti@redhat.com, qemu-devel@nongnu.org On Wed, 3 Aug 2011 18:51:44 +0400 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. Are you hitting an specific issue or did you find this by code inspection? IIRC, I asked Marcelo to add the monitor_resume() call in the fix for e447b1a603 because the monitor wasn't being resumed in some cases. Don't remember which though, do you Marcelo? I see two possibilities here: 1. After e447b1a603 there was some change that made the monitor_resume() call in migrate_fd_put_buffer() unnecessary 2. We're calling it in the wrong place Taking a quick look at the code I see that migrate_fd_cleanup() doesn't seem to be called when qemu_savevm_state_iterate() fails, for example. > > Signed-Off-By: Michael Tokarev > Reviewed-By: Jan Kiszka > --- > migration.c | 3 --- > 1 files changed, 0 insertions(+), 3 deletions(-) > > diff --git a/migration.c b/migration.c > index 2a15b98..7ca883f 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, NULL); > }