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:
Keir Fraser committed 2008-08-04 11:07:17 +01:00
1 parent f06e832088
commit c5c5a83176
1 file changed
+4
+4
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.