[Sheepdog] VDI locking, migration and qemu

Chris Webb chris at arachsys.com
Mon Nov 30 10:01:57 CET 2009


FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp> writes:

> If bdrv_open tells us the purpose (opens to create a snapshot, opens
> to run a VM, etc), we don't need bdrv_claim? The asymmetric API (open
> vs. close and release) might not be good.

You need to be able to 'change' the lock level on an existing block device
for migration to work, i.e. open without lock then take the lock when we
start the vm. It's also quite handy to do it this way, because qemu has a
habit of calling bdrv_open as it marches along the command line, and then
exiting part way along when it finds an argument it does like. Previously
this always caused a stale vdi lock; now it doesn't because the locking
happens later.

> Anyway, I guess that it would be better to discuss this lock/release
> VDI issue on qemu-devel.

Yes, this is probably right. I'm not sure I completely understand sheepdog's
behaviour with respect to backing devices and snapshots too, so I'll take a
look at that again.

Cheers,

Chris.



More information about the sheepdog mailing list