qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [BUG] Regression: readonly raw images no longer work
@ 2010-02-13 21:40 Stefan Weil
  2010-02-13 22:38 ` [Qemu-devel] " Paolo Bonzini
  2010-02-22 14:39 ` [Qemu-devel] " Naphtali Sprei
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Weil @ 2010-02-13 21:40 UTC (permalink / raw)
  To: QEMU Developers

This command used to work, but fails now:

$ i386-softmmu/qemu -snapshot /dev/sda
qemu: could not open disk image /dev/sda: Permission denied

$ ls -l /dev/sda
brw-rw-r-- 1 root disk 8, 0 13. Feb 08:55 /dev/sda

The original file of a snapshot needs only read access,
but QEMU tries read/write access and fails.

Variants of above command using -hda or -drive
also fail with the same error message.

I did not test whether the regression affects other
kinds of images, too. Maybe only raw images trigger
no longer work.

Regards
Stefan Weil

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [BUG] Regression: readonly raw images no longer work
  2010-02-13 21:40 [Qemu-devel] [BUG] Regression: readonly raw images no longer work Stefan Weil
@ 2010-02-13 22:38 ` Paolo Bonzini
  2010-02-15  8:01   ` Markus Armbruster
  2010-02-22 14:39 ` [Qemu-devel] " Naphtali Sprei
  1 sibling, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2010-02-13 22:38 UTC (permalink / raw)
  To: qemu-devel

On 02/13/2010 10:40 PM, Stefan Weil wrote:
> This command used to work, but fails now:
>
> $ i386-softmmu/qemu -snapshot /dev/sda
> qemu: could not open disk image /dev/sda: Permission denied
>
> $ ls -l /dev/sda
> brw-rw-r-- 1 root disk 8, 0 13. Feb 08:55 /dev/sda
>
> The original file of a snapshot needs only read access,
> but QEMU tries read/write access and fails.
>
> Variants of above command using -hda or -drive
> also fail with the same error message.
>
> I did not test whether the regression affects other
> kinds of images, too. Maybe only raw images trigger
> no longer work.

Caused by

commit 03cbdac7efc20994d0a87015e24e835d0139df7b
Author: Naphtali Sprei <nsprei@redhat.com>  2010-01-17 15:48:15
Committer: Anthony Liguori <aliguori@us.ibm.com>  2010-01-20 15:25:22
Follows: v0.12.0-rc0

     Disable fall-back to read-only when cannot open drive's file for
     read-write

     Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
     Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

... because before that it was working like this:

open("/dev/sda", O_RDWR|O_SYNC|O_CLOEXEC) = -1 EACCES
open("/dev/sda", O_RDONLY|O_SYNC|O_CLOEXEC) = 10

BTW, because of other bugs in the middle of the history you need a 
command line "-hda /dev/null -drive file=/dev/sda,snapshot=on" to bisect it.

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Re: [BUG] Regression: readonly raw images no longer work
  2010-02-13 22:38 ` [Qemu-devel] " Paolo Bonzini
@ 2010-02-15  8:01   ` Markus Armbruster
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2010-02-15  8:01 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 02/13/2010 10:40 PM, Stefan Weil wrote:
>> This command used to work, but fails now:
>>
>> $ i386-softmmu/qemu -snapshot /dev/sda
>> qemu: could not open disk image /dev/sda: Permission denied
>>
>> $ ls -l /dev/sda
>> brw-rw-r-- 1 root disk 8, 0 13. Feb 08:55 /dev/sda
>>
>> The original file of a snapshot needs only read access,
>> but QEMU tries read/write access and fails.
>>
>> Variants of above command using -hda or -drive
>> also fail with the same error message.
>>
>> I did not test whether the regression affects other
>> kinds of images, too. Maybe only raw images trigger
>> no longer work.
>
> Caused by
>
> commit 03cbdac7efc20994d0a87015e24e835d0139df7b
> Author: Naphtali Sprei <nsprei@redhat.com>  2010-01-17 15:48:15
> Committer: Anthony Liguori <aliguori@us.ibm.com>  2010-01-20 15:25:22
> Follows: v0.12.0-rc0
>
>     Disable fall-back to read-only when cannot open drive's file for
>     read-write
>
>     Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
>     Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
> ... because before that it was working like this:
>
> open("/dev/sda", O_RDWR|O_SYNC|O_CLOEXEC) = -1 EACCES
> open("/dev/sda", O_RDONLY|O_SYNC|O_CLOEXEC) = 10
>
> BTW, because of other bugs in the middle of the history you need a
> command line "-hda /dev/null -drive file=/dev/sda,snapshot=on" to
> bisect it.

Maybe drive_enable_snapshot() should set readonly in opts as well.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [BUG] Regression: readonly raw images no longer work
  2010-02-13 21:40 [Qemu-devel] [BUG] Regression: readonly raw images no longer work Stefan Weil
  2010-02-13 22:38 ` [Qemu-devel] " Paolo Bonzini
@ 2010-02-22 14:39 ` Naphtali Sprei
  1 sibling, 0 replies; 4+ messages in thread
From: Naphtali Sprei @ 2010-02-22 14:39 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Paolo Bonzini, QEMU Developers, Markus Armbruster

Stefan Weil wrote:
> This command used to work, but fails now:
> 
> $ i386-softmmu/qemu -snapshot /dev/sda
> qemu: could not open disk image /dev/sda: Permission denied
> 
> $ ls -l /dev/sda
> brw-rw-r-- 1 root disk 8, 0 13. Feb 08:55 /dev/sda
> 
> The original file of a snapshot needs only read access,
> but QEMU tries read/write access and fails.
> 
> Variants of above command using -hda or -drive
> also fail with the same error message.
> 
> I did not test whether the regression affects other
> kinds of images, too. Maybe only raw images trigger
> no longer work.
> 
> Regards
> Stefan Weil
> 
> 
> 

Sorry for the late reply,
this is my fault. It will fail for any image format.

It's already fixed with commit 4dca4b639cb20fee38f6eec0a391aecc0ad8848d :
"block: more read-only changes, related to backing files"

Now, since the /dev/sda is the backing-file, it's opened as read-only, no permission problem.

Notice that if you try to commit your changes to the read-only disk (in monitor command), 
it will be silently ignored, no error or warning displayed.
Should I add a warning/error printing ? 

 Naphtali

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-22 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-13 21:40 [Qemu-devel] [BUG] Regression: readonly raw images no longer work Stefan Weil
2010-02-13 22:38 ` [Qemu-devel] " Paolo Bonzini
2010-02-15  8:01   ` Markus Armbruster
2010-02-22 14:39 ` [Qemu-devel] " Naphtali Sprei

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).