qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] New option for snapshot_blkdev to avoid image creation


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] New option for snapshot_blkdev to avoid image creation
Date: Tue, 4 Oct 2011 11:33:14 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Oct 04, 2011 at 04:27:42AM -0400, Federico Simoncelli wrote:
> ----- Original Message -----
> > From: "Stefan Hajnoczi" <address@hidden>
> > To: "Federico Simoncelli" <address@hidden>
> > Cc: address@hidden, address@hidden, address@hidden
> > Sent: Tuesday, October 4, 2011 9:33:48 AM
> > Subject: Re: [Qemu-devel] New option for snapshot_blkdev to avoid image 
> > creation
> > 
> > On Mon, Oct 03, 2011 at 04:09:01PM +0000, Federico Simoncelli wrote:
> > > In some situations might be useful to let qemu use an image that
> > > was
> > > prepared for a live snapshot.
> > > The advantage is that creating the snapshot file outside of the
> > > qemu
> > > process we can use the whole range of options provided by the
> > > format
> > > (eg for qcow2: encryption, cluster_size and preallocation).
> > > It is also possible to pre-set a relative path to the backing file
> > > (now it is created by default as absolute path).
> > > In the long run it can also avoid the danger of reimplementing
> > > qemu-img
> > > inside qemu (if we wanted to expose such options when a snapshot is
> > > requested).
> > 
> > When the image file is created based on the backing file size:
> > 
> > $ qemu-img create -f qcow2 -o backing_file=master.img vm001.qcow2
> > 
> > It turns out that bdrv_img_create() opens the backing file with
> > read/write permissions.  This is generally a bad idea but especially
> > dangerous when the VM currently has the image file open already since
> > image formats are not designed for multiple initiators (clustering).
> 
> Hi Stefan, are you sure that bdrv_img_create opens the backing file
> with read/write permissions?

You are absolutely right.  BDRV_O_FLAGS does not have BDRV_O_RDWR so it
is opening read-only.  I missed this when reading the code earlier
today.

Stefan



reply via email to

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