From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOlZ6-0008HP-Se for qemu-devel@nongnu.org; Thu, 18 Oct 2012 04:35:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOlZ5-0001hx-V0 for qemu-devel@nongnu.org; Thu, 18 Oct 2012 04:34:52 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:38244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOlZ5-0001hp-Oc for qemu-devel@nongnu.org; Thu, 18 Oct 2012 04:34:51 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so8151693pad.4 for ; Thu, 18 Oct 2012 01:34:51 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <507FBF24.8060100@redhat.com> Date: Thu, 18 Oct 2012 10:34:44 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1350545426-23172-1-git-send-email-quintela@redhat.com> <1350545426-23172-22-git-send-email-quintela@redhat.com> In-Reply-To: <1350545426-23172-22-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 21/30] migration: move exit condition to migration thread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org Il 18/10/2012 09:30, Juan Quintela ha scritto: > - if (s->migration_state->complete) { > + qemu_mutex_lock_iothread(); So, was it a bug that we were accessing ->complete without the BQL? > + if (m->state != MIG_STATE_ACTIVE) { > + DPRINTF("put_ready returning because of non-active state\n"); The contents of the debug message obsolete. Besides, I would just put the two branches in the same "if (m->state != MIG_STATE_ACTIVE || m->complete)". > + qemu_mutex_unlock_iothread(); > break; > } > + if (m->complete) { > + qemu_mutex_unlock_iothread(); > + break; > + } > + qemu_mutex_unlock_iothread(); > + Paolo