qcow2: Serialize all requestsqcow2-coroutines-rfc-v1
commit8179e8ff20bb3f14f361109afe5b3bf2bac24f0d
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 21 Jan 2011 15:55:00 +0000 (21 15:55 +0000)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 21 Jan 2011 16:58:30 +0000 (21 16:58 +0000)
treeb1d27a674e8f1c772c2a1f663090a77c325e81fb
parentfcdedcf412c66d1e58bef6ea9aed3795b9742657
qcow2: Serialize all requests

QCOW2 with coroutines is not safe because synchronous code paths are no
longer guaranteed to execute without interference from pending requests.
A blocking call like bdrv_pread() causes the coroutine to yield and
another request can be processed during that time, causing to race
conditions or interference between pending requests.

The simple solution is to serialize all requests.  This is bad for
performance and a fine-grained solution needs to be implemented in
future patches.

Using this patch, QCOW2 with coroutines can reliably install a RHEL6 VM
with a virtio-blk disk.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
block/qcow2.c
block/qcow2.h