qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/6 v11] docs: spec for add-cow file format


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/6 v11] docs: spec for add-cow file format
Date: Thu, 2 Aug 2012 11:44:02 +0100

On Thu, Aug 2, 2012 at 8:09 AM, Dong Xu Wang <address@hidden> wrote:
> On Wed, Aug 1, 2012 at 9:55 PM, Stefan Hajnoczi <address@hidden> wrote:
>> On Tue, Jul 31, 2012 at 5:51 PM, Dong Xu Wang
>> <address@hidden> wrote:
>>> +test.raw may be larger than ubuntu.img, in that case, the size of 
>>> test.add-cow
>>> +will be calculated by the size of ubuntu.img, test.raw will be used from 
>>> the
>>> +1st byte, the rest part can be used for other purpose.
>>
>> This is not how backing files normally work.  With qcow2 or qed a
>> smaller backing file just means that the guest reads zeroes from the
>> areas beyond the end of the backing file.  Is there a special reason
>> why you want to implement the behavior you described in the spec?
>> Otherwise I suggest implementing the same behavior as qcow2/qed.
>
> The size of add-cow will be caclulated by the size of backing_file, if
> backing_file can be smaller, how can I get the size of add-cow while
> being created?
>
> Do you mean like following steps?
> 1) qemu-img create -f qcow2 source.qcow2 *8G*
> 2) qemu-img create -f t.add-cow -o backing_file=source.qcow2,image_file=t 
> *10G*
> And then reading un-allocated bytes from add-cow after 8G will be 0?

Yes.  You could also get the virtual disk size from the size of the
image_file during creation.

Stefan



reply via email to

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