From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Cc: Paul Brook <paul@codesourcery.com>
Subject: Re: [Qemu-devel] PATCH: Control over drive open modes for backing file
Date: Thu, 31 Jul 2008 17:01:13 +0100 [thread overview]
Message-ID: <20080731160113.GA22997@shareable.org> (raw)
In-Reply-To: <f43fc5580807310805p10c284c7s22940f801f8f1784@mail.gmail.com>
Blue Swirl wrote:
> On 7/31/08, Daniel P. Berrange <berrange@redhat.com> wrote:
> > On Thu, Jul 31, 2008 at 02:46:55PM +0100, Paul Brook wrote:
> > > > +#define BDRV_O_RDONLY 0x0001 /* Force read-only */
> > > > +#define BDRV_O_WRONLY 0x0002 /* Force writeable, no fallback */
> > > > +#define BDRV_O_RDWR 0x0003 /* Try writeable, fallback to read-only
> > > > */
> > >
> > > This is IMHO really misleading. Normal O_* are not bitflags. The code uses
> > > these as bitflags sometimes, which means your descriptions are contradictory.
> >
> >
> > One alternative approach I considered would be to not have an explicit
> > flag for writable, and instead have a flag to explicitly indicate that
> > fallback to read-only shouldn't be attempted.
> >
> >
> > #define BDRV_O_RDONLY 0x0001
> >
> > #define BDRV_O_NO_RO_FALLBACK 0x0002
> >
> > This would probably make the patch smaller because I won't need to update
> > all the callers which assume flags of '0' gives a writable file, falling
> > back to RO.
> >
> > Other suggestions welcome too...
>
> Write-only should mean that only writing is allowed, read access
> should not be needed.
You can't write to most formats unless you can read the metadata.
Flat is the exception, but WRONLY doesn't seem particularly useful.
Whereas read-only floppy images, for example, resemble real hardware.
I would suggest: read-only, read-write, and try-write (traditional behaviour).
Or maybe get rid of the last one.
-- Jamie
next prev parent reply other threads:[~2008-07-31 16:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-31 11:31 [Qemu-devel] PATCH: Control over drive open modes for backing file Daniel P. Berrange
2008-07-31 12:15 ` Jamie Lokier
2008-07-31 13:08 ` Daniel P. Berrange
2008-07-31 13:34 ` Daniel P. Berrange
2008-07-31 13:46 ` Paul Brook
2008-07-31 13:55 ` Daniel P. Berrange
2008-07-31 15:05 ` Blue Swirl
2008-07-31 16:01 ` Jamie Lokier [this message]
2008-07-31 16:10 ` Daniel P. Berrange
2008-07-31 18:07 ` Blue Swirl
2008-07-31 14:58 ` Chris Wedgwood
2008-07-31 18:26 ` Anthony Liguori
2008-07-31 18:59 ` Jamie Lokier
2008-07-31 19:37 ` Anthony Liguori
2008-08-01 7:46 ` Jamie Lokier
2008-08-01 15:14 ` Anthony Liguori
2008-08-01 9:18 ` Daniel P. Berrange
2008-08-01 14:48 ` Anthony Liguori
2008-08-01 16:47 ` Ian Jackson
2008-08-01 17:09 ` Anthony Liguori
2008-08-01 17:10 ` Jamie Lokier
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=20080731160113.GA22997@shareable.org \
--to=jamie@shareable.org \
--cc=paul@codesourcery.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 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.