From: Keir Fraser Date: Mon, 4 Aug 2008 10:07:17 +0000 (+0100) Subject: stubdom: fix read-only disks access X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14165^2~40 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c5c5a831765f5b18e36543bab1614d7d63b0bbee;p=xen.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/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);