mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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>
This commit is contained in:
1 parent
f06e832088
commit
c5c5a83176
1 file changed
+4
@@ -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);
|
||||
|
||||