qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesyst


From: Stefan Weil
Subject: [Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesystem
Date: Mon, 21 Aug 2006 18:57:22 +0200
User-agent: Thunderbird 1.5.0.5 (X11/20060812)

Hello,

qemu fails when the disk image file is writable but on
a readonly filesystem (so it is not really writable).

The patch below fixes this. It also declares a local
function "static" (maybe this part of the patch is a
matter of taste).

Regards,
Stefan


--- block.c     19 Aug 2006 11:45:59 -0000      1.34
+++ block.c     21 Aug 2006 16:46:21 -0000
@@ -110,7 +110,7 @@
 }


-void bdrv_register(BlockDriver *bdrv)
+static void bdrv_register(BlockDriver *bdrv)
 {
     if (!bdrv->bdrv_aio_read) {
         /* add AIO emulation layer */
@@ -359,7 +359,7 @@
     else
         open_flags = flags & ~(BDRV_O_FILE | BDRV_O_SNAPSHOT);
     ret = drv->bdrv_open(bs, filename, open_flags);
-    if (ret == -EACCES && !(flags & BDRV_O_FILE)) {
+    if ((ret == -EACCES || ret == -EROFS) && !(flags & BDRV_O_FILE)) {
         ret = drv->bdrv_open(bs, filename, BDRV_O_RDONLY);
         bs->read_only = 1;
     }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]