qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesystem
Date: Mon, 21 Aug 2006 18:57:22 +0200	[thread overview]
Message-ID: <44E9E5F2.7030008@mail.berlios.de> (raw)

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	other threads:[~2006-08-21 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-21 16:57 Stefan Weil [this message]
2006-08-21 21:02 ` [Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesystem Fabrice Bellard
2006-08-23  9:09   ` Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44E9E5F2.7030008@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).