From: Naphtali Sprei <nsprei@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH v2 4/4] Disable fall-back to read-only when cannot open drive's file for read-write
Date: Mon, 18 Jan 2010 13:45:32 +0200 [thread overview]
Message-ID: <4B5449DC.20807@redhat.com> (raw)
In-Reply-To: <20100117145859.GB3420@redhat.com>
Michael S. Tsirkin wrote:
> On Sun, Jan 17, 2010 at 04:48:15PM +0200, Naphtali Sprei wrote:
>> Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
>> ---
>> block.c | 6 ------
>> 1 files changed, 0 insertions(+), 6 deletions(-)
>>
>> diff --git a/block.c b/block.c
>> index 8def3c4..f90e983 100644
>> --- a/block.c
>> +++ b/block.c
>> @@ -444,8 +444,6 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
>> if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE))
>> bs->enable_write_cache = 1;
>>
>> - /* Note: for compatibility, we open disk image files as RDWR, and
>> - RDONLY as fallback */
>> bs->read_only = (flags & BDRV_O_RDWR) == 0;
>> if (!(flags & BDRV_O_FILE)) {
>> open_flags = (flags & (BDRV_O_RDWR | BDRV_O_CACHE_MASK|BDRV_O_NATIVE_AIO));
>> @@ -459,10 +457,6 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
>> ret = -ENOTSUP;
>> } else {
>> ret = drv->bdrv_open(bs, filename, open_flags);
>> - if ((ret == -EACCES || ret == -EPERM) && !(flags & BDRV_O_FILE)) {
>> - ret = drv->bdrv_open(bs, filename, open_flags & ~BDRV_O_RDWR);
>> - bs->read_only = 1;
>> - }
>
> Maybe print an error message explaining the problem and
> suggesting the solution?
Printing done in (some of the) callers.
Should add suggestion. How is it done in QMP ?
>
>> }
>> if (ret < 0) {
>> qemu_free(bs->opaque);
>> --
>> 1.6.3.3
>>
>>
next prev parent reply other threads:[~2010-01-18 11:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-17 14:48 [Qemu-devel] [PATCH v2 0/4] Modifications to the drives' readonly attribute Naphtali Sprei
2010-01-17 14:48 ` [Qemu-devel] [PATCH v2 1/4] Make CDROM a read-only drive Naphtali Sprei
2010-01-17 14:48 ` [Qemu-devel] [PATCH v2 2/4] Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE Naphtali Sprei
2010-01-17 14:48 ` [Qemu-devel] [PATCH v2 3/4] Added drives' readonly option Naphtali Sprei
2010-01-17 14:48 ` [Qemu-devel] [PATCH v2 4/4] Disable fall-back to read-only when cannot open drive's file for read-write Naphtali Sprei
2010-01-17 14:59 ` [Qemu-devel] " Michael S. Tsirkin
2010-01-18 11:45 ` Naphtali Sprei [this message]
2010-01-17 15:32 ` [Qemu-devel] Re: [PATCH v2 2/4] Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE Michael S. Tsirkin
2010-01-18 10:34 ` Markus Armbruster
2010-01-18 10:48 ` Michael S. Tsirkin
2010-01-18 12:47 ` Markus Armbruster
2010-01-20 2:05 ` Jamie Lokier
2010-01-20 7:26 ` Markus Armbruster
2010-01-20 10:32 ` Michael S. Tsirkin
2010-01-20 12:09 ` Markus Armbruster
2010-01-20 12:25 ` Michael S. Tsirkin
2010-01-20 13:05 ` Markus Armbruster
2010-01-20 13:37 ` Jamie Lokier
2010-01-18 11:32 ` Naphtali Sprei
2010-01-20 2:06 ` [Qemu-devel] [PATCH v2 1/4] Make CDROM a read-only drive Jamie Lokier
2010-01-20 14:55 ` Anthony Liguori
2010-01-20 17:05 ` [Qemu-devel] [PATCH v2 0/4] Modifications to the drives' readonly attribute Christoph Hellwig
2010-01-21 13:19 ` Naphtali Sprei
2010-01-21 13:37 ` Christoph Hellwig
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=4B5449DC.20807@redhat.com \
--to=nsprei@redhat.com \
--cc=mst@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).