qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Add readonly flag to -drive command


From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH] Add readonly flag to -drive command
Date: Mon, 12 Oct 2009 16:16:44 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Anthony Liguori wrote:
> Jamie Lokier wrote:
> >Kevin Wolf wrote:
> >  
> >>Am 12.10.2009 14:47, schrieb Naphtali Sprei:
> >>    
> >>>In order to safely share an image between guests (as read only drive), 
> >>>add a 'readonly' flag
> >>>to the -drive command (qemu command line and monitor).
> >>>      
> >
> >Heh.  I've been sharing images between guests for ages - using "chmod -r" 
> >:-)
> >  
> 
> Were it not for backwards compatibility, I would remove that and have it 
> error out.
> 
> I've had multiple people end up with strangely broken guests because 
> they didn't realize the image was read only.

I agree, that's ugly - I've wasted time on a strangely broken guest in
that situation too!

Backward compatibility might be an issue with the idea to change QEMU
to complain if it can't open a file writable.  Not with regular disk
images so much, but floppy/USB images.  Perhaps the answer to that is
'readonly=auto', 'readonly=yes', 'readonly=no'?

Sharing images with -snapshot, and backing images with qcow2, is a
very useful feature for launching multiple test VMs in parallel, and
for making "forked" images for testing different guest OS variations,
so I'm glad to see the 'readonly' flag appearing as an option.

(You can't use qcow2 snapshots to implement "forked" images running in
parallel because you can't safely open different snapshots in the same
qcow2 file at the same time).

Taking a read-only (shared) or writeable (exclusive) lock on the file
would be a useful addition I think, to catch mistakes.

-- Jamie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]