qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 7/8] block: core copy-on-read logic


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2 7/8] block: core copy-on-read logic
Date: Wed, 23 Nov 2011 08:58:59 +0000

On Wed, Nov 23, 2011 at 4:42 AM, Zhi Yong Wu <address@hidden> wrote:
> On Thu, Nov 17, 2011 at 9:40 PM, Stefan Hajnoczi
> <address@hidden> wrote:
>> +    /* Cover entire cluster so no additional backing file I/O is required 
>> when
>> +     * allocating cluster in the image file.
>> +     */
>> +    round_to_clusters(bs, sector_num, nb_sectors,
>> +                      &cluster_sector_num, &cluster_nb_sectors);
> Why need to round down/up sector_num/nb_sectors in this function? The
> detection of race condition for write request has been done before
> this function.

If we write less than a cluster then the image format will have to
perform additional to populate the regions of the cluster that we did
not touch.  So we touch entire clusters and therefore no extra I/O is
generated.

The comment right above the line you are asking about explains this.

Stefan



reply via email to

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