qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v9 03/13] qemu-io: Switch 'alloc' command to byt


From: Eric Blake
Subject: Re: [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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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