Skip to contentSkip to conversation

stubdom: fix read-only disks access

PATCH In review Samuel Thibault 2 participants 3 messages Aug 1, 2008 – Aug 3, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stubdom: fix read-only disks access

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.

tools/ioemu/block-vbd.c +4 -0
diff -r 3dedb6209991 tools/ioemu/block-vbd.c
@@ -273,6 +273,10 @@ static BlockDriverAIOCB *vbd_aio_flush(B
     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);
#1 lore raw

Is no patch required for ioemu-remote?

-- Keir

Quoted 27 lines · Samuel Thibault

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.

diff -r 3dedb6209991 tools/ioemu/block-vbd.c

tools/ioemu/block-vbd.c Fri Aug 01 19:16:52 2008 +0100 renamed from tools/ioemu/block-vbd.c Fri Aug 01 12:18:02 2008 +0100 +4 -0
@@ -273,6 +273,10 @@ static BlockDriverAIOCB *vbd_aio_flush(B
     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);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 1 line · Keir Fraser, le Sun 03 Aug 2008 18:13:26 +0100, a écrit :

Is no patch required for ioemu-remote?

The same should apply fine.

Samuel