qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/6] libqblock internal used functions


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 4/6] libqblock internal used functions
Date: Tue, 04 Sep 2012 05:38:52 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

On 09/04/2012 01:15 AM, Wenchao Xia wrote:
> 于 2012-9-3 23:18, Paolo Bonzini 写道:
>> Il 03/09/2012 16:28, Eric Blake ha scritto:
>>>>> +/* this file contains helper function used internally. */
>>>>> +#define SECTOR_SIZE (512)
>>> Hard-coding this feels wrong, in this day and age of disks with 4096
>>> sectors.  Why isn't this a per-image property?
>>
>> In this day and age of disks with 4096 sectors, Linux does not provide a
>> way to query the required alignment for O_DIRECT...
>>
>> Paolo
>>
> in block.h:
> #define BDRV_SECTOR_BITS   9
> #define BDRV_SECTOR_SIZE   (1ULL << BDRV_SECTOR_BITS)
> #define BDRV_SECTOR_MASK   ~(BDRV_SECTOR_SIZE - 1)
>   it seems block size is always 512 in qemu block layer, so I can
> ignore the 4096 case, do you think so?

Since qemu does not support it now, yes, you can ignore it for now.  But
please make sure that you aren't hard-coding it into the API - that is,
make sure that the API can someday grow to support larger sector sizes
with minimal impact to library clients (that is, that new clients aware
of the new API can target larger sector size once qemu has been patched
to support larger sector size).

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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