From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydejw-0008Qf-Rp for qemu-devel@nongnu.org; Thu, 02 Apr 2015 09:00:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ydejs-0006kX-Iv for qemu-devel@nongnu.org; Thu, 02 Apr 2015 09:00:56 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:34090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydejs-0006kR-CJ for qemu-devel@nongnu.org; Thu, 02 Apr 2015 09:00:52 -0400 Received: by wgbdm7 with SMTP id dm7so84709735wgb.1 for ; Thu, 02 Apr 2015 06:00:51 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <551D3D7C.6000803@redhat.com> Date: Thu, 02 Apr 2015 15:00:44 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <55128084.2040304@huawei.com> <87a8z12yot.fsf@neno.neno> <5513793B.6020909@cn.fujitsu.com> <5513826D.2010505@cn.fujitsu.com> <55152D5B.1090906@huawei.com> <20150327101831.GB2685@work-vm> <55167A60.9030602@huawei.com> <20150330075934.GA2474@work-vm> <551A897E.4090909@huawei.com> <20150331190634.GC7687@work-vm> <551D2D79.90905@huawei.com> In-Reply-To: <551D2D79.90905@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Migration Bug? ] Occasionally, the content of VM's memory is inconsistent between Source and Destination of migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang , "Dr. David Alan Gilbert" Cc: hangaohuai@huawei.com, Li Zhijian , quintela@redhat.com, peter.huangpeng@huawei.com, qemu-devel@nongnu.org, "Gonglei (Arei)" , Amit Shah , david@gibson.dropbear.id.au On 02/04/2015 13:52, zhanghailiang wrote: > diff --git a/exec.c b/exec.c > index 874ecfc..4b1b39b 100644 > --- a/exec.c > +++ b/exec.c > @@ -59,7 +59,7 @@ > //#define DEBUG_SUBPAGE > > #if !defined(CONFIG_USER_ONLY) > -static bool in_migration; > +bool in_migration; > > /* ram_list is read under rcu_read_lock()/rcu_read_unlock(). Writes > * are protected by the ramlist lock. > diff --git a/kvm-all.c b/kvm-all.c > index 335438a..dd75eff 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -128,6 +128,8 @@ bool kvm_allowed; > bool kvm_readonly_mem_allowed; > bool kvm_vm_attributes_allowed; > > +extern bool in_migration; > + > static const KVMCapabilityInfo kvm_required_capabilites[] = { > KVM_CAP_INFO(USER_MEMORY), > KVM_CAP_INFO(DESTROY_MEMORY_REGION_WORKS), > @@ -715,7 +717,7 @@ static void kvm_set_phys_mem(MemoryRegionSection > *section, bool add) > > old = *mem; > > - if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { > + if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES || in_migration) { > kvm_physical_sync_dirty_bitmap(section); > } > Applied for 2.3. Paolo