All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] format=raw,readonly errors
@ 2017-05-08  4:28 Carl Karsten
  2017-05-08  8:51 ` Markus Armbruster
  0 siblings, 1 reply; 11+ messages in thread
From: Carl Karsten @ 2017-05-08  4:28 UTC (permalink / raw)
  To: qemu-devel

juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
file=disk.cow -drive file=boot.img
WARNING: Image format was not specified for 'boot.img' and probing guessed
raw.
         Automatically detecting the format is dangerous for raw images,
write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

This is OK, as I don't want anything writing to that thing anyway.  So to
get rid of the waring:

juser@gator:~/temp$ qemu-system-x86_64 -drive
file=boot.img,format=raw,readonly qemu-system-x86_64: Can't use a read-only
drive
qemu-system-x86_64: Initialization of device ide-hd failed: Device
initialization failed.

hmm... one more try:

juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
file=disk.cow,readonly
qemu-system-x86_64: Can't use a read-only drive
qemu-system-x86_64: Initialization of device ide-hd failed: Device
initialization failed.




-- 
Carl K

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08  4:28 [Qemu-devel] format=raw,readonly errors Carl Karsten
@ 2017-05-08  8:51 ` Markus Armbruster
  2017-05-08 14:15   ` Carl Karsten
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Armbruster @ 2017-05-08  8:51 UTC (permalink / raw)
  To: Carl Karsten; +Cc: qemu-devel

Carl Karsten <carl@personnelware.com> writes:

> juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
> file=disk.cow -drive file=boot.img
> WARNING: Image format was not specified for 'boot.img' and probing guessed
> raw.
>          Automatically detecting the format is dangerous for raw images,
> write operations on block 0 will be restricted.
>          Specify the 'raw' format explicitly to remove the restrictions.
>
> This is OK, as I don't want anything writing to that thing anyway.  So to
> get rid of the waring:
>
> juser@gator:~/temp$ qemu-system-x86_64 -drive
> file=boot.img,format=raw,readonly qemu-system-x86_64: Can't use a read-only
> drive
> qemu-system-x86_64: Initialization of device ide-hd failed: Device
> initialization failed.

-drive without if=... creates an IDE disk[*].  IDE disks can't do
read-only.  Have you tried omitting ",readonly"?

> hmm... one more try:
>
> juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
> file=disk.cow,readonly
> qemu-system-x86_64: Can't use a read-only drive
> qemu-system-x86_64: Initialization of device ide-hd failed: Device
> initialization failed.


[*] It actually depends on the machine, but I figure that's of no
interest to you.

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08  8:51 ` Markus Armbruster
@ 2017-05-08 14:15   ` Carl Karsten
  2017-05-08 15:32     ` John Snow
  0 siblings, 1 reply; 11+ messages in thread
From: Carl Karsten @ 2017-05-08 14:15 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On Mon, May 8, 2017 at 3:51 AM, Markus Armbruster <armbru@redhat.com> wrote:

> Carl Karsten <carl@personnelware.com> writes:
>
> > juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
> > file=disk.cow -drive file=boot.img
> > WARNING: Image format was not specified for 'boot.img' and probing
> guessed
> > raw.
> >          Automatically detecting the format is dangerous for raw images,
> > write operations on block 0 will be restricted.
> >          Specify the 'raw' format explicitly to remove the restrictions.
> >
> > This is OK, as I don't want anything writing to that thing anyway.  So to
> > get rid of the waring:
> >
> > juser@gator:~/temp$ qemu-system-x86_64 -drive
> > file=boot.img,format=raw,readonly qemu-system-x86_64: Can't use a
> read-only
> > drive
> > qemu-system-x86_64: Initialization of device ide-hd failed: Device
> > initialization failed.
>
> -drive without if=... creates an IDE disk[*].  IDE disks can't do
> read-only.  Have you tried omitting ",readonly"?
>


omitting works, but my goal was for the drive to be read only.




>
> > hmm... one more try:
> >
> > juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
> > file=disk.cow,readonly
> > qemu-system-x86_64: Can't use a read-only drive
> > qemu-system-x86_64: Initialization of device ide-hd failed: Device
> > initialization failed.
>
>
> [*] It actually depends on the machine, but I figure that's of no
> interest to you.
>



-- 
Carl K

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08 14:15   ` Carl Karsten
@ 2017-05-08 15:32     ` John Snow
  2017-05-08 15:56       ` Carl Karsten
  2017-05-08 16:00       ` Daniel P. Berrange
  0 siblings, 2 replies; 11+ messages in thread
From: John Snow @ 2017-05-08 15:32 UTC (permalink / raw)
  To: Carl Karsten, Markus Armbruster; +Cc: qemu-devel



On 05/08/2017 10:15 AM, Carl Karsten wrote:
> On Mon, May 8, 2017 at 3:51 AM, Markus Armbruster <armbru@redhat.com> wrote:
> 
>> Carl Karsten <carl@personnelware.com> writes:
>>
>>> juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
>>> file=disk.cow -drive file=boot.img
>>> WARNING: Image format was not specified for 'boot.img' and probing
>> guessed
>>> raw.
>>>          Automatically detecting the format is dangerous for raw images,
>>> write operations on block 0 will be restricted.
>>>          Specify the 'raw' format explicitly to remove the restrictions.
>>>
>>> This is OK, as I don't want anything writing to that thing anyway.  So to
>>> get rid of the waring:
>>>
>>> juser@gator:~/temp$ qemu-system-x86_64 -drive
>>> file=boot.img,format=raw,readonly qemu-system-x86_64: Can't use a
>> read-only
>>> drive
>>> qemu-system-x86_64: Initialization of device ide-hd failed: Device
>>> initialization failed.
>>
>> -drive without if=... creates an IDE disk[*].  IDE disks can't do
>> read-only.  Have you tried omitting ",readonly"?
>>
> 
> 
> omitting works, but my goal was for the drive to be read only.
> 
> 

I don't think there's a way to make physical IDE drives "read only." I
don't think there's any jumper settings or any of the like which can
accomplish this.

Unlike floppy disks (which you could notch the corner of) or SD cards
(which have the write lock), I don't think ATA disks have a method for
being "read only," so this isn't a feature QEMU can support.

What you CAN do, however, is to use -snapshot or otherwise use something
like a qcow2 overlay to trap all writes to a temporary file that you can
discard at a later point in time, effectively keeping your original
image "read only."

I believe that SCSI disks support a read-only mode, though.

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08 15:32     ` John Snow
@ 2017-05-08 15:56       ` Carl Karsten
  2017-05-08 16:29         ` Eric Blake
  2017-05-08 16:00       ` Daniel P. Berrange
  1 sibling, 1 reply; 11+ messages in thread
From: Carl Karsten @ 2017-05-08 15:56 UTC (permalink / raw)
  To: John Snow; +Cc: Markus Armbruster, qemu-devel

On Mon, May 8, 2017 at 10:32 AM, John Snow <jsnow@redhat.com> wrote:

>
>
> On 05/08/2017 10:15 AM, Carl Karsten wrote:
> > On Mon, May 8, 2017 at 3:51 AM, Markus Armbruster <armbru@redhat.com>
> wrote:
> >
> >> Carl Karsten <carl@personnelware.com> writes:
> >>
> >>> juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
> >>> file=disk.cow -drive file=boot.img
> >>> WARNING: Image format was not specified for 'boot.img' and probing
> >> guessed
> >>> raw.
> >>>          Automatically detecting the format is dangerous for raw
> images,
> >>> write operations on block 0 will be restricted.
> >>>          Specify the 'raw' format explicitly to remove the
> restrictions.
> >>>
> >>> This is OK, as I don't want anything writing to that thing anyway.  So
> to
> >>> get rid of the waring:
> >>>
> >>> juser@gator:~/temp$ qemu-system-x86_64 -drive
> >>> file=boot.img,format=raw,readonly qemu-system-x86_64: Can't use a
> >> read-only
> >>> drive
> >>> qemu-system-x86_64: Initialization of device ide-hd failed: Device
> >>> initialization failed.
> >>
> >> -drive without if=... creates an IDE disk[*].  IDE disks can't do
> >> read-only.  Have you tried omitting ",readonly"?
> >>
> >
> >
> > omitting works, but my goal was for the drive to be read only.
> >
> >
>
> I don't think there's a way to make physical IDE drives "read only." I
> don't think there's any jumper settings or any of the like which can
> accomplish this.
>
> Unlike floppy disks (which you could notch the corner of) or SD cards
> (which have the write lock), I don't think ATA disks have a method for
> being "read only," so this isn't a feature QEMU can support.
>
> What you CAN do, however, is to use -snapshot or otherwise use something
> like a qcow2 overlay to trap all writes to a temporary file that you can
> discard at a later point in time, effectively keeping your original
> image "read only."
>
> I believe that SCSI disks support a read-only mode, though.
>


k - that all makes sense.

kinda ;)

 "write operations on block 0 will be restricted."

Is there a way to explicitly enable that?

The installer on the usb stick keeps stepping on itself rendering it
broken, both physical usb drive and a dd image.

I can play with OS permissions too, but that restricted warning made me
think that would be 'best'.

but but, now that I have index/bootindex working I probably won't be
trashing my installer any more, so non-issue.



-- 
Carl K

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08 15:32     ` John Snow
  2017-05-08 15:56       ` Carl Karsten
@ 2017-05-08 16:00       ` Daniel P. Berrange
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel P. Berrange @ 2017-05-08 16:00 UTC (permalink / raw)
  To: John Snow; +Cc: Carl Karsten, Markus Armbruster, qemu-devel

On Mon, May 08, 2017 at 11:32:12AM -0400, John Snow wrote:
> 
> 
> On 05/08/2017 10:15 AM, Carl Karsten wrote:
> > On Mon, May 8, 2017 at 3:51 AM, Markus Armbruster <armbru@redhat.com> wrote:
> > 
> >> Carl Karsten <carl@personnelware.com> writes:
> >>
> >>> juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
> >>> file=disk.cow -drive file=boot.img
> >>> WARNING: Image format was not specified for 'boot.img' and probing
> >> guessed
> >>> raw.
> >>>          Automatically detecting the format is dangerous for raw images,
> >>> write operations on block 0 will be restricted.
> >>>          Specify the 'raw' format explicitly to remove the restrictions.
> >>>
> >>> This is OK, as I don't want anything writing to that thing anyway.  So to
> >>> get rid of the waring:
> >>>
> >>> juser@gator:~/temp$ qemu-system-x86_64 -drive
> >>> file=boot.img,format=raw,readonly qemu-system-x86_64: Can't use a
> >> read-only
> >>> drive
> >>> qemu-system-x86_64: Initialization of device ide-hd failed: Device
> >>> initialization failed.
> >>
> >> -drive without if=... creates an IDE disk[*].  IDE disks can't do
> >> read-only.  Have you tried omitting ",readonly"?
> >>
> > 
> > 
> > omitting works, but my goal was for the drive to be read only.
> > 
> > 
> 
> I don't think there's a way to make physical IDE drives "read only." I
> don't think there's any jumper settings or any of the like which can
> accomplish this.

You could use an IDE cdrom though, rather than an IDE disk, as that's
readonly from guest POV (we don't emulate a cd-writer).

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08 15:56       ` Carl Karsten
@ 2017-05-08 16:29         ` Eric Blake
  2017-05-08 16:33           ` Carl Karsten
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Blake @ 2017-05-08 16:29 UTC (permalink / raw)
  To: Carl Karsten, John Snow; +Cc: Markus Armbruster, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

On 05/08/2017 10:56 AM, Carl Karsten wrote:

>>>>> juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses  -drive
>>>>> file=disk.cow -drive file=boot.img
>>>>> WARNING: Image format was not specified for 'boot.img' and probing
>>>> guessed
>>>>> raw.
>>>>>          Automatically detecting the format is dangerous for raw
>> images,
>>>>> write operations on block 0 will be restricted.
>>>>>          Specify the 'raw' format explicitly to remove the
>> restrictions.

>  "write operations on block 0 will be restricted."
> 
> Is there a way to explicitly enable that?

Yes. Pass format=raw at the right place (in other words, instead of
getting the 'raw' format driver by default, explicitly mentioning that
you KNOW you want the 'raw' format driver is enough to shut up the warning).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08 16:29         ` Eric Blake
@ 2017-05-08 16:33           ` Carl Karsten
  2017-05-08 16:39             ` Eric Blake
  2017-05-08 16:47             ` Max Reitz
  0 siblings, 2 replies; 11+ messages in thread
From: Carl Karsten @ 2017-05-08 16:33 UTC (permalink / raw)
  To: Eric Blake; +Cc: John Snow, Markus Armbruster, qemu-devel

On Mon, May 8, 2017 at 11:29 AM, Eric Blake <eblake@redhat.com> wrote:

> On 05/08/2017 10:56 AM, Carl Karsten wrote:
>
> >>>>> juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses
> -drive
> >>>>> file=disk.cow -drive file=boot.img
> >>>>> WARNING: Image format was not specified for 'boot.img' and probing
> >>>> guessed
> >>>>> raw.
> >>>>>          Automatically detecting the format is dangerous for raw
> >> images,
> >>>>> write operations on block 0 will be restricted.
> >>>>>          Specify the 'raw' format explicitly to remove the
> >> restrictions.
>
> >  "write operations on block 0 will be restricted."
> >
> > Is there a way to explicitly enable that?
>
> Yes. Pass format=raw at the right place (in other words, instead of
> getting the 'raw' format driver by default, explicitly mentioning that
> you KNOW you want the 'raw' format driver is enough to shut up the
> warning).
>

according to the warning: "Specify the 'raw' format explicitly to remove
the restrictions."

I want the restriction.

format=raw, (write operations on block 0)=restricted



>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
>
>


-- 
Carl K

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08 16:33           ` Carl Karsten
@ 2017-05-08 16:39             ` Eric Blake
  2017-05-08 16:43               ` Eric Blake
  2017-05-08 16:47             ` Max Reitz
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Blake @ 2017-05-08 16:39 UTC (permalink / raw)
  To: Carl Karsten; +Cc: John Snow, Markus Armbruster, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

On 05/08/2017 11:33 AM, Carl Karsten wrote:
> according to the warning: "Specify the 'raw' format explicitly to remove
> the restrictions."
> 
> I want the restriction.
> 
> format=raw, (write operations on block 0)=restricted

Then omit format=raw.  (It's an unusual request, though).  Or, as others
mentioned in this thread, you can use -snapshot or any other form of
overlay image to keep the original image read-only while still providing
a read-write image that the guest requires for faithful hardware
emulation; and you can always check your overlay after the fact to learn
whether sector 0 was changed.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08 16:39             ` Eric Blake
@ 2017-05-08 16:43               ` Eric Blake
  0 siblings, 0 replies; 11+ messages in thread
From: Eric Blake @ 2017-05-08 16:43 UTC (permalink / raw)
  To: Carl Karsten; +Cc: John Snow, Markus Armbruster, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

On 05/08/2017 11:39 AM, Eric Blake wrote:
> On 05/08/2017 11:33 AM, Carl Karsten wrote:
>> according to the warning: "Specify the 'raw' format explicitly to remove
>> the restrictions."
>>
>> I want the restriction.
>>
>> format=raw, (write operations on block 0)=restricted
> 
> Then omit format=raw.  (It's an unusual request, though).  Or, as others
> mentioned in this thread, you can use -snapshot or any other form of
> overlay image to keep the original image read-only while still providing
> a read-write image that the guest requires for faithful hardware
> emulation; and you can always check your overlay after the fact to learn
> whether sector 0 was changed.

The only other solution I can think of is using the blkdebug wrapper
with a config-file that causes EIO errors on any time to write anywhere
in the range [0,511]; however, setting up blkdebug is not very-well
documented (best may be to inspect existing files in
tests/qemu-iotests/??? for usage of blkdebug).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: [Qemu-devel] format=raw,readonly errors
  2017-05-08 16:33           ` Carl Karsten
  2017-05-08 16:39             ` Eric Blake
@ 2017-05-08 16:47             ` Max Reitz
  1 sibling, 0 replies; 11+ messages in thread
From: Max Reitz @ 2017-05-08 16:47 UTC (permalink / raw)
  To: Carl Karsten, Eric Blake; +Cc: John Snow, Markus Armbruster, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]

On 08.05.2017 18:33, Carl Karsten wrote:
> On Mon, May 8, 2017 at 11:29 AM, Eric Blake <eblake@redhat.com> wrote:
> 
>> On 05/08/2017 10:56 AM, Carl Karsten wrote:
>>
>>>>>>> juser@gator:~/temp$ qemu-system-x86_64 -m 256 -display curses
>> -drive
>>>>>>> file=disk.cow -drive file=boot.img
>>>>>>> WARNING: Image format was not specified for 'boot.img' and probing
>>>>>> guessed
>>>>>>> raw.
>>>>>>>          Automatically detecting the format is dangerous for raw
>>>> images,
>>>>>>> write operations on block 0 will be restricted.
>>>>>>>          Specify the 'raw' format explicitly to remove the
>>>> restrictions.
>>
>>>  "write operations on block 0 will be restricted."
>>>
>>> Is there a way to explicitly enable that?
>>
>> Yes. Pass format=raw at the right place (in other words, instead of
>> getting the 'raw' format driver by default, explicitly mentioning that
>> you KNOW you want the 'raw' format driver is enough to shut up the
>> warning).
>>
> 
> according to the warning: "Specify the 'raw' format explicitly to remove
> the restrictions."
> 
> I want the restriction.
> 
> format=raw, (write operations on block 0)=restricted

Well, the restriction won't prevent all writes to the first sector,
though; it will only prevent writes which would make the image look like
it was in some non-raw format. So this is probably not what you want anyway.

Unfortunately, I don't know any current way to "soft" write-protect an
image. It sounds like an interesting idea, though, and should be simple
enough to implement e.g. in the raw driver.

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

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

end of thread, other threads:[~2017-05-08 16:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08  4:28 [Qemu-devel] format=raw,readonly errors Carl Karsten
2017-05-08  8:51 ` Markus Armbruster
2017-05-08 14:15   ` Carl Karsten
2017-05-08 15:32     ` John Snow
2017-05-08 15:56       ` Carl Karsten
2017-05-08 16:29         ` Eric Blake
2017-05-08 16:33           ` Carl Karsten
2017-05-08 16:39             ` Eric Blake
2017-05-08 16:43               ` Eric Blake
2017-05-08 16:47             ` Max Reitz
2017-05-08 16:00       ` Daniel P. Berrange

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.