qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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: Fri, 01 Aug 2008 12:14:52 -0500	[thread overview]
Message-ID: <4893448C.1050508@codemonkey.ws> (raw)
In-Reply-To: <18579.16494.791024.25671@mariner.uk.xensource.com>

Ian Jackson wrote:
> Anthony Liguori writes ("Re: [Qemu-devel] PATCH: v3 Allow control over drive file open mode"):
>   
>> Allowing the user to specify what mode we use to open a file is IMHO not 
>> a good interface for a user.  A user should only be concerned with how 
>> we expose a disk to the guest, not the underlying implementation of how 
>> we support this.  It has subtle side-effects that a user is not going to 
>> expect unless they are intimately familiar with how QEMU is implemented 
>> (like snapshotting breaking).
>>     
>
> I think I agree, but with qualifications:
>
> The user readonly flag ought to mean
>  1. qemu will definitely not permit the guest to write to the object
>     represented (if it is a cow file then even the cow will not be
>     writeable)
>  2. If the emulated device type supports it the guest will be
>     told that it may not write to the device.  If this is not possible
>     and the user has not overridden this check then the entire request
>     will be rejected (rather than exporting the device read/write).
>   

I don't think it should be possible to override the check.  If the 
device doesn't support it, we should reject it.  However, it sounds like 
all the devices we emulate support some form of read-only so this is 
perhaps not going to be a problem.

>  3. qemu will to communicate the consequences for its future use
>     of the underlying host operating system object(s) appropriately
>     to the host system (as this might be relevant for cacheing,
>     concurrent access, etc.)
>   

When possible.

>  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.

>  
>  5. Operations (such as cow commit) that would modify data
>     (either host data or data as seen by the guest or both)
>     are not supported.
>   

I believe commit should work just as it does now.

> I think 3 and 4 mean that it should pass O_RDONLY to the underlying
> filesystem objects where feasible.
>
> I'm afraid I don't understand your point about breaking snapshotting.
> Perhaps you could explain the scenario ?
>   

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.  An alternative scenario would be a read-only root fs:

qemu-system-x86_64 -drive file=rootfs.img,read-only=on

Where you wanted to be able to do a savevm.

Regards,

Anthony Liguori


> Ian.
>
>
>   

  reply	other threads:[~2008-08-01 17:15 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 [this message]
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
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=4893448C.1050508@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).