Received: from eggs.gnu.org ([2001:4830:134:3::10]:39470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz2MK-0006S8-LM for qemu-devel@nongnu.org; Thu, 11 Dec 2014 06:56:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz2MB-0007O2-Gy for qemu-devel@nongnu.org; Thu, 11 Dec 2014 06:56:40 -0500 Received: from relay.parallels.com ([195.214.232.42]:37023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz2MB-00078H-AQ for qemu-devel@nongnu.org; Thu, 11 Dec 2014 06:56:31 -0500 From: Vladimir Sementsov-Ogievskiy Date: Thu, 11 Dec 2014 14:55:23 +0300 Message-ID: <1418298924-4173-1-git-send-email-vsementsov@parallels.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] Fix block migration bug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, den@openvz.org, stefanha@redhat.com Because of wrong return value of .save_live_pending() in block-migration, migration finishes before the whole disk is transferred. Such situation occures when the migration process is fast enouth, for example when source and dest are on the same host. It's easy to test this with the following: bug.sh ===================================================================== #!/bin/sh size=$1 addr=$2 rm /tmp/fifo-mig /tmp/a /tmp/b /tmp/sock-mig ./qemu-img create -f qcow2 /tmp/a $size ./qemu-img create -f qcow2 /tmp/b $size ./qemu-io -c "write -P 0x22 $addr 512" /tmp/a mkfifo /tmp/fifo-mig ./x86_64-softmmu/qemu-system-x86_64 -drive file=/tmp/b,id=disk\ -qmp unix:/tmp/sock-mig,server,nowait\ -incoming "exec: cat /tmp/fifo-mig" & echo 'migrate -b exec:cat>/tmp/fifo-mig\nquit\n' |\ ./x86_64-softmmu/qemu-system-x86_64 -drive file=/tmp/a,id=disk\ -monitor stdio ./scripts/qmp/qmp --path=/tmp/sock-mig quit sleep 3 echo checking ./qemu-io -c "read -P 0x22 $addr 512" /tmp/b ===================================================================== For './bug.sh 1G 1M' qemu-io check finishes successfully, but for './bug.sh 1G 1022M' it finishes with 'Pattern verification failed' status. The following patch fixes this bug. Vladimir Sementsov-Ogievskiy (1): block-migration: fix pending() return value block-migration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1