aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-08-04 11:07:17 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-08-04 11:07:17 +0100
commitc5c5a831765f5b18e36543bab1614d7d63b0bbee (patch)
tree9eb94869131dc26509da91784c035511780e25d6
parentf06e83208866f9e6cccee051704de153a6f97b3a (diff)
downloadxen-c5c5a831765f5b18e36543bab1614d7d63b0bbee.tar.gz
xen-c5c5a831765f5b18e36543bab1614d7d63b0bbee.tar.bz2
xen-c5c5a831765f5b18e36543bab1614d7d63b0bbee.zip
stubdom: fix read-only disks access
There is no need for a flush on read-only disks. It would actually even error out and disturb the guest. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
-rw-r--r--tools/ioemu/block-vbd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/ioemu/block-vbd.c b/tools/ioemu/block-vbd.c
index a3465b748a..58015bdf00 100644
--- a/tools/ioemu/block-vbd.c
+++ b/tools/ioemu/block-vbd.c
@@ -273,6 +273,10 @@ static BlockDriverAIOCB *vbd_aio_flush(BlockDriverState *bs,
BDRVVbdState *s = bs->opaque;
VbdAIOCB *acb = NULL;
+ if (s->info.mode == O_RDONLY) {
+ cb(opaque, 0);
+ return NULL;
+ }
if (s->info.barrier == 1) {
acb = vbd_aio_setup(bs, 0, NULL, 0,
s->info.flush == 1 ? vbd_nop_cb : cb, opaque);