From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLhr-0006IM-S8 for qemu-devel@nongnu.org; Thu, 24 Oct 2013 10:16:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZLhj-0005Kp-EA for qemu-devel@nongnu.org; Thu, 24 Oct 2013 10:16:11 -0400 Received: from mail-ea0-x231.google.com ([2a00:1450:4013:c01::231]:59359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLhj-0005Kj-78 for qemu-devel@nongnu.org; Thu, 24 Oct 2013 10:16:03 -0400 Received: by mail-ea0-f177.google.com with SMTP id f15so1230629eak.8 for ; Thu, 24 Oct 2013 07:16:02 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <52692B9F.4020909@redhat.com> Date: Thu, 24 Oct 2013 15:15:59 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1382412341-1173-1-git-send-email-lilei@linux.vnet.ibm.com> <1382412341-1173-17-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1382412341-1173-17-git-send-email-lilei@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 16/17] migration: adjust migration_thread() process for page flipping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: aarcange@redhat.com, aliguori@us.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, lagarcia@br.ibm.com, rcj@linux.vnet.ibm.com Il 22/10/2013 04:25, Lei Li ha scritto: > Signed-off-by: Lei Li > --- > migration.c | 10 +++++++--- > 1 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/migration.c b/migration.c > index 4ac466b..568b73a 100644 > --- a/migration.c > +++ b/migration.c > @@ -579,10 +579,11 @@ static void *migration_thread(void *opaque) > pending_size = qemu_savevm_state_pending(s->file, max_size); > DPRINTF("pending size %" PRIu64 " max %" PRIu64 "\n", > pending_size, max_size); > - if (pending_size && pending_size >= max_size) { > + if (pending_size && pending_size >= max_size && > + !migrate_unix_page_flipping()) { This is a bit ugly but I understand the need. Perhaps "&& !runstate_needs_reset()" like below? Paolo > qemu_savevm_state_iterate(s->file); > } else { > - int ret; > + int ret = 0; > > DPRINTF("done iterating\n"); > qemu_mutex_lock_iothread(); > @@ -590,7 +591,10 @@ static void *migration_thread(void *opaque) > qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER); > old_vm_running = runstate_is_running(); > > - ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); > + if (!runstate_needs_reset()) { > + ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); > + } > + > if (ret >= 0) { > qemu_file_set_rate_limit(s->file, INT_MAX); > qemu_savevm_state_complete(s->file); >