qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] I/O in backing file


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] I/O in backing file
Date: Fri, 30 Mar 2012 08:07:01 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Mar 30, 2012 at 09:47:52AM +0530, PANKAJ RAWAT wrote:
> I am currently using backing file.The question of my concern is regarding
> the I/O operation
> Now when we create a external snapshot in qcow2, a new file is created
> leaving the original file as backing file
> *
> Can any one tell,*how the I/O is performed in detail way?.
> 
> Means when the new snapshot is booted which refer to the backing file as
> original file. *How read operation is performed? how it is decided whether
> the file is present in the snapshot image or the backing file.?
> when write operation is performed how it is decided whether the file is
> already present in backing file or we have to create a new one ?*

>From docs/specs/qed_spec.txt:

"Reads to an unallocated area of the image file access the backing file.
If there is no backing file, then zeroes are produced.  The backing file
may be smaller than the image file and reads of unallocated areas beyond
the end of the backing file produce zeroes.

Writes to an unallocated area cause a new data clusters to be allocated,
and a new L2 table if that is also unallocated.  The new data cluster is
populated with data from the backing file (or zeroes if no backing file)
and the data being written."

It's similar for qcow2 and other formats that support backing files.

Stefan



reply via email to

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