[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v9 03/13] qemu-io: Switch 'alloc' c
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v9 03/13] qemu-io: Switch 'alloc' command to byte-based length |
Date: |
Tue, 11 Apr 2017 07:11:56 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 04/10/2017 09:37 PM, Philippe Mathieu-Daudé wrote:
> Hi Eric,
>
> On 04/10/2017 10:17 PM, Eric Blake wrote:
>> For the 'alloc' command, accepting an offset in bytes but a length
>> in sectors, and reporting output in sectors, is confusing. Do
>> everything in bytes, and adjust the expected output accordingly.
>>
>> }
>> } else {
>> - nb_sectors = 1;
>> + bytes = BDRV_SECTOR_SIZE;
>> }
>> + if (bytes & 0x1ff) {
>
> This macro is self-explanatory:
>
> if(!QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE))
Indeed; but I was going for copy-and-paste consistency with the rest of
the file that also open-codes this. A separate cleanup patch for all of
them would qualify as trivial.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH for-2.10 v9 00/13] add blkdebug tests, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 02/13] iotests: Add test 179 to cover write zeroes with unmap, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 04/13] qemu-io: Switch 'map' output to byte-based reporting, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 03/13] qemu-io: Switch 'alloc' command to byte-based length, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 01/13] qcow2: Unallocate unmapped zero clusters if no backing file, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 06/13] qcow2: Assert that cluster operations are aligned, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 05/13] qcow2: Optimize write zero of unaligned tail cluster, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 09/13] blkdebug: Refactor error injection, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 11/13] blkdebug: Simplify override logic, Eric Blake, 2017/04/10
- [Qemu-block] [PATCH v9 07/13] qcow2: Discard/zero clusters by byte count, Eric Blake, 2017/04/10