[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 17/17] block: Move request_alignment into Blo
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH v2 17/17] block: Move request_alignment into BlockLimit |
Date: |
Tue, 21 Jun 2016 16:26:42 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 06/21/2016 08:16 AM, Kevin Wolf wrote:
> Am 14.06.2016 um 23:30 hat Eric Blake geschrieben:
>> It makes more sense to have ALL block size limit constraints
>> in the same struct. Improve the documentation while at it.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>>
>> ---
>> struct BlockLimits {
>> + /* Alignment requirement, in bytes, for offset/length of I/O
>> + * requests. Must be a power of 2 less than INT_MAX. A value of 0
>> + * defaults to 1 for drivers with modern byte interfaces, and to
>> + * 512 otherwise. */
>
> No, a value of zero probably crashes qemu. The defaults apply when they
> aren't overridden by the driver, but this field is always non-zero.
>
Then why does block.c have:
--- a/block.c
+++ b/block.c
@@ -1016,7 +1016,7 @@ static int bdrv_open_common(BlockDriverState *bs,
BdrvChild *file,
assert(bdrv_opt_mem_align(bs) != 0);
assert(bdrv_min_mem_align(bs) != 0);
- assert(is_power_of_2(bs->request_alignment) || bdrv_is_sg(bs));
+ assert(is_power_of_2(bs->bl.request_alignment) || bdrv_is_sg(bs));
That says that if bdrv_is_sg(bs), we can indeed have request_alignment
be 0. Should I track that down and fix it first, so that
request_alignment is always nonzero? If so, is using '1' for
bdrv_is_sg(bs) the ideal solution?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature