qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/1] Fix block migration bug
@ 2014-12-30 10:04 Vladimir Sementsov-Ogievskiy
  2014-12-30 10:04 ` [Qemu-devel] [PATCH v2 1/1] migration/block: fix pending() return value Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2014-12-30 10:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: amit.shah, den, vsementsov, quintela

v2:
  - rebase to master
  - fix typos in description

Because of wrong return value of .save_live_pending() in
block-migration, migration finishes before the whole disk
is transferred. Such situation occurs when the migration
process is fast enough, 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):
  migration/block: fix pending() return value

 migration/block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-02 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-30 10:04 [Qemu-devel] [PATCH v2 0/1] Fix block migration bug Vladimir Sementsov-Ogievskiy
2014-12-30 10:04 ` [Qemu-devel] [PATCH v2 1/1] migration/block: fix pending() return value Vladimir Sementsov-Ogievskiy
2015-01-02 16:23   ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).