All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] PATCH: Control over drive open modes for backing file
Date: Fri, 1 Aug 2008 18:10:53 +0100	[thread overview]
Message-ID: <20080801171053.GB25063@shareable.org> (raw)
In-Reply-To: <18579.15930.393041.733173@mariner.uk.xensource.com>

Ian Jackson wrote:
> > Right, but my point is that ,mode=ro does not have to force QEMU to open 
> > the file O_RDONLY.  It simply needs to prevent writes from happening.
> 
> Well, yes, but actually it's probably most reliable to do it that way.
> Given that this is a security feature we want to avoid accidentally
> `missing' a case.  So we should definitely open the underlying file(s)
> O_RDONLY.

Also, the point about qcow2 metadata.  If you have multiple QEMU
instances using the same qcow2 image, it is not acceptable to have
them both trying to write qcow2 metadata - unless they are interlocked
in some way (as fas as I know they're not).

Personally I use 'chattr +i' on such files.  But it's not very
userspace friendy, e.g. for VM management scripts run by other people.
You need root access to do 'chattr +i'.

> If we do that then the guest definitely won't be able to write as if
> it manages to persuade qemu to try qemu will just get an error.  This
> is fine I think, if we can expose the read-only status to the guest.
> 
> > But it's important to be able to expose this property to the guest, so 
> > ,mode=ro should not be allowed for disks that do not support exposing 
> > their read-only-ness to the guest.
> 
> I agree that it would be an unusual thing to do, to expose a ro disk
> in a way that doesn't support advertising the ro flag.  But I think it
> should still be possible perhaps with some kind of force option.

I would think for environments where a single image is launched many
times, e.g. 'start OS foo and tell it to run my test program', it's
important that the *file* be open read-only regardless of what the
guest can see.

In that usage, -snapshot or creating an explicit qcow2 derived file
would be appropriate.  But it's still important that the base file is
opened read-only, and that 'commit' to it is forbidden.

-- Jamie

      parent reply	other threads:[~2008-08-01 17:10 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
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 [this message]

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=20080801171053.GB25063@shareable.org \
    --to=jamie@shareable.org \
    --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.