* [Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesystem
@ 2006-08-21 16:57 Stefan Weil
2006-08-21 21:02 ` Fabrice Bellard
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2006-08-21 16:57 UTC (permalink / raw)
To: qemu-devel
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;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesystem
2006-08-21 16:57 [Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesystem Stefan Weil
@ 2006-08-21 21:02 ` Fabrice Bellard
2006-08-23 9:09 ` Stefan Weil
0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Bellard @ 2006-08-21 21:02 UTC (permalink / raw)
To: qemu-devel
Stefan Weil wrote:
> 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).
Are you sure it is needed ? I made a different fix a few days ago.
Regards,
Fabrice.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesystem
2006-08-21 21:02 ` Fabrice Bellard
@ 2006-08-23 9:09 ` Stefan Weil
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Weil @ 2006-08-23 9:09 UTC (permalink / raw)
To: qemu-devel
> Are you sure it is needed ? I made a different fix a few days ago.
>
> Regards,
>
> Fabrice.
>
>
I wrote my fix before your fix was available.
At least for raw disk images, your fix also works,
so at the moment, there is no need for my patch
(this should be checked with other kinds of disk
images).
Regards,
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-23 9:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-21 16:57 [Qemu-devel][Patch] Fix QEMU failure for disk image on readonly filesystem Stefan Weil
2006-08-21 21:02 ` Fabrice Bellard
2006-08-23 9:09 ` Stefan Weil
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).