From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] PATCH: v3 Allow control over drive file open mode
Date: Tue, 12 Aug 2008 08:31:21 -0500 [thread overview]
Message-ID: <48A190A9.1070902@codemonkey.ws> (raw)
In-Reply-To: <18592.25422.257378.988970@mariner.uk.xensource.com>
Ian Jackson wrote:
> Anthony Liguori writes ("Re: [Qemu-devel] PATCH: v3 Allow control over drive file open mode"):
>
>> Ian Jackson wrote:
>>
>>> 4. qemu will take steps to try to ensure that bugs and missing
>>> changes in the readonly implementation don't leave a security
>>> hole where the
>>>
>> I'm not at all worried about this FWIW.
>>
>
> Well, in the Xen world we have different priorities I think. Many
> people are depending very heavily on the security properties of Xen
> including the hardware emulations. So for us it is important that we
> take all the measures we can to stop us from accidentally committing
> bugs.
>
Which is fine, but you're missing my fundamental argument. Having a
read-only flag exposed to the user should not translate to "open the
underlying files O_RDONLY". That's an implementation detail. If that's
what ends up happening, great. However, I'll make the argument also
that for certain circumstances that's not actually what we want.
> If this is something that qemu upstream doesn't want then we will have
> to maintain it as a permanent delta in our `Xen' tree (along with the
> mapcache, etc. etc.)
>
> It would be fine if there were in fact only one place where writes
> take place. But actually there are multiple routes at pretty much all
> levels: multiple entrypoints (aio and not, pwrite or not), multiple
> block drivers, in cow devices multiple read/write paths depending on
> whether the block is already present in the diffs and multiple writes
> to the .img for each requested write, etc.
>
All writes end up going through the block-raw-posix write functions.
>> qemu-system-x86_64 -drive file=foo.img -drive file=boo.img,read-only=on
>>
>> Down the road, you do a savevm. savevm has to create a checkpoint in
>> all disk images. The checkpoint will be empty in boo.img but it still
>> needs to create one.
>>
>
> Perhaps I don't understand clearly enough how you imagine this
> scenario. Surely when the snapshot is resumed it is sufficient for
> the file boo.img to be identical ?
>
Not really. When the snapshot is restored, what do you do with
boo.img? Do you just use the main L1 table if no properly named
snapshots are available? That seems quite error prone to me.
Another example is introducing a copy-on-read disk. This would be
useful for image stream. Think a qcow2 file that backs an http block
device. The perfect use-case for something like this is an ISO image
which a user would want to export to the guest read-only. However, we
need to modify the qcow2 image as the guest reads it (to do the
copy-on-read).
N.B. I've said before that there's no reason that a read-only disk
cannot result in the file being opened O_RDONLY (for raw in particular)
but that is a detail of each block device and I don't think it should be
the case for qcow2.
Regards,
Anthony Liguori
next prev parent reply other threads:[~2008-08-12 13:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-01 10:29 [Qemu-devel] PATCH: v3 Allow control over drive file open mode Daniel P. Berrange
2008-08-01 15:10 ` Anthony Liguori
2008-08-01 16:15 ` Daniel P. Berrange
2008-08-01 16:23 ` Andreas Färber
2008-08-01 17:06 ` Jamie Lokier
2008-08-01 16:57 ` Ian Jackson
2008-08-01 17:14 ` Anthony Liguori
2008-08-01 17:27 ` Jamie Lokier
2008-08-11 16:05 ` Ian Jackson
2008-08-12 11:42 ` Kevin Wolf
2008-08-12 13:31 ` Anthony Liguori [this message]
2008-08-12 23:56 ` 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=48A190A9.1070902@codemonkey.ws \
--to=anthony@codemonkey.ws \
--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).