From: Keir Fraser Date: Mon, 4 Aug 2008 10:08:09 +0000 (+0100) Subject: stubdom: fix read-only disks access X-Git-Tag: xen-3.3.0-rc3~3 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6aab00fe35201f1eaeb349b8148d2af5edb187a2;p=qemu-xen-4.0-testing.git 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 --- diff --git a/block-vbd.c b/block-vbd.c index a3465b74..58015bdf 100644 --- a/block-vbd.c +++ b/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);