From: Kevin Wolf <kwolf@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Naphtali Sprei <nsprei@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Add readonly flag to -drive command
Date: Tue, 13 Oct 2009 09:36:03 +0200 [thread overview]
Message-ID: <4AD42DE3.8000000@redhat.com> (raw)
In-Reply-To: <4AD3562F.8000106@msgid.tls.msk.ru>
Am 12.10.2009 18:15, schrieb Michael Tokarev:
> Anthony Liguori wrote:
>> Jamie Lokier wrote:
>>> Kevin Wolf wrote:
>>>
>>>> Am 12.10.2009 14:47, schrieb Naphtali Sprei:
>>>>
>>>>> In order to safely share an image between guests (as read only
>>>>> drive), add a 'readonly' flag
>>>>> to the -drive command (qemu command line and monitor).
>>>
>>> Heh. I've been sharing images between guests for ages - using "chmod -r" :-)
>>
>> Were it not for backwards compatibility, I would remove that and have it
>> error out.
>>
>> I've had multiple people end up with strangely broken guests because
>> they didn't realize the image was read only.
>
> And I had this issue too.
>
> But for me it's still not clear. Some disk drives out there can be
> switched to read-only mode at runtime by using appropriate command.
> Certain (USB and especially SD) flash drives can be read-only too
> (usually a tiny swith does that). Even old good floppy drives had
> a "write protect" switch. How the system determines if such devices
> are read-only? For a HDD or a flash drive, I *guess* the drive return
> appropriate error message, no?
>
> But qemu - apparently - just ignores writes in this case, which
> results in stalled guest which expects some answer to the write
> command.. I guess, because it was always the stalls.
The qemu block layer returns errors. For good old bdrv_write it's
-EACCES, for bdrv_aio_writev it's NULL (and therefore cannot be
distinguished from other errors). Not sure what the devices make out of
it. Probably not the right thing in all cases.
Kevin
next prev parent reply other threads:[~2009-10-13 7:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 12:47 [Qemu-devel] [PATCH] Add readonly flag to -drive command Naphtali Sprei
2009-10-12 13:24 ` Kevin Wolf
2009-10-12 13:50 ` Jamie Lokier
2009-10-12 14:07 ` Kevin Wolf
2009-10-12 14:30 ` Anthony Liguori
2009-10-12 15:16 ` Jamie Lokier
2009-10-12 16:15 ` Michael Tokarev
2009-10-13 7:36 ` Kevin Wolf [this message]
2009-10-12 14:06 ` Anthony Liguori
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=4AD42DE3.8000000@redhat.com \
--to=kwolf@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=nsprei@redhat.com \
--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).