Received: from eggs.gnu.org ([2001:4830:134:3::10]:39932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbRar-00071U-4O for qemu-devel@nongnu.org; Fri, 27 Mar 2015 06:34:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbRao-0007h3-BL for qemu-devel@nongnu.org; Fri, 27 Mar 2015 06:34:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbRao-0007gv-3M for qemu-devel@nongnu.org; Fri, 27 Mar 2015 06:34:22 -0400 From: Juan Quintela In-Reply-To: <55151F59.8020000@cn.fujitsu.com> (Wen Congyang's message of "Fri, 27 Mar 2015 17:14:01 +0800") References: <55128084.2040304@huawei.com> <87a8z12yot.fsf@neno.neno> <5513793B.6020909@cn.fujitsu.com> <874mp8xd9k.fsf@neno.neno> <20150327085634.GB3304@stefanha-thinkpad.redhat.com> <55151F59.8020000@cn.fujitsu.com> Date: Fri, 27 Mar 2015 11:34:02 +0100 Message-ID: <87wq22vied.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Migration Bug? ] Occasionally, the content of VM's memory is inconsistent between Source and Destination of migration Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang Cc: Kevin Wolf , hangaohuai@huawei.com, zhanghailiang , Li Zhijian , Michael Tsirkin , qemu-devel@nongnu.org, "Dr. David Alan Gilbert (git)" , "Gonglei (Arei)" , Stefan Hajnoczi , Amit Shah , peter.huangpeng@huawei.com, david@gibson.dropbear.id.au Wen Congyang wrote: > On 03/27/2015 04:56 PM, Stefan Hajnoczi wrote: >> On Thu, Mar 26, 2015 at 11:29:43AM +0100, Juan Quintela wrote: >>> Wen Congyang wrote: >>>> On 03/25/2015 05:50 PM, Juan Quintela wrote: >>>>> zhanghailiang wrote: >>>>>> Hi all, >>>>>> >>>>>> We found that, sometimes, the content of VM's memory is >>>>>> inconsistent between Source side and Destination side >>>>>> when we check it just after finishing migration but before VM >>>>>> continue to Run. >>>>>> >>>>>> We use a patch like bellow to find this issue, you can find it from affix, >>>>>> and Steps to reprduce: >>>>>> >>>>>> (1) Compile QEMU: >>>>>> ./configure --target-list=x86_64-softmmu --extra-ldflags="-lssl" && make >>>>>> >>>>>> (2) Command and output: >>>>>> SRC: # x86_64-softmmu/qemu-system-x86_64 -enable-kvm -cpu >>>>>> qemu64,-kvmclock -netdev tap,id=hn0-device >>>>>> virtio-net-pci,id=net-pci0,netdev=hn0 -boot c -drive >>>>>> file=/mnt/sdb/pure_IMG/sles/sles11_sp3.img,if=none,id=drive-virtio-disk0,cache=unsafe >>>>>> -device >>>>>> virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 >>>>>> -vnc :7 -m 2048 -smp 2 -device piix3-usb-uhci -device usb-tablet >>>>>> -monitor stdio >>>>> >>>>> Could you try to reproduce: >>>>> - without vhost >>>>> - without virtio-net >>>>> - cache=unsafe is going to give you trouble, but trouble should only >>>>> happen after migration of pages have finished. >>>> >>>> If I use ide disk, it doesn't happen. >>>> Even if I use virtio-net with vhost=on, it still doesn't happen. I guess >>>> it is because I migrate the guest when it is booting. The virtio net >>>> device is not used in this case. >>> >>> Kevin, Stefan, Michael, any great idea? >> >> You must use -drive cache=none if you want to use live migration. It >> should not directly affect memory during migration though. > > Otherwise, what will happen? If the user doesn't use cache=none, and > tries to use live migration, qemu doesn't output any message or trigger > an event to notify the user. Problem here is what is your shared storage. Some clustered filesystem got this right and can run without cache=none. But neither NFS, iscsi or FC (FC is by my understanding, not sure) can. And that are the more used ones. So, qemu don't now what FS/storage type the user has, so it can make no real errors. Later, Juan. > > Thanks > Wen Congyang > >> >>>>>> We have done further test and found that some pages has been >>>>>> dirtied but its corresponding migration_bitmap is not set. >>>>>> We can't figure out which modules of QEMU has missed setting bitmap >>>>>> when dirty page of VM, >>>>>> it is very difficult for us to trace all the actions of dirtying VM's pages. >>>>> >>>>> This seems to point to a bug in one of the devices. >> >> I think you'll need to track down which pages are different. If you are >> lucky, their contents will reveal what the page is used for. >> >> Stefan >>