qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v6 17/20] nbd: Switch to byte-based block access


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH v6 17/20] nbd: Switch to byte-based block access
Date: Fri, 6 May 2016 08:19:13 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 05/06/2016 07:08 AM, Kevin Wolf wrote:
> Am 05.05.2016 um 01:55 hat Eric Blake geschrieben:
>> Sector-based blk_read() should die; switch to byte-based
>> blk_pread() instead.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>> ---
>>  qemu-nbd.c | 11 +++++++----
>>  1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/qemu-nbd.c b/qemu-nbd.c
>> index c55b40f..c07ceef 100644
>> --- a/qemu-nbd.c
>> +++ b/qemu-nbd.c
>> @@ -159,12 +159,13 @@ static int find_partition(BlockBackend *blk, int 
>> partition,
>>                            off_t *offset, off_t *size)
>>  {
>>      struct partition_record mbr[4];
>> -    uint8_t data[512];
>> +    uint8_t data[BDRV_SECTOR_SIZE];
> 
> I like 512 better, actually. This is not the size of the arbitrary unit
> that some block layer functions use, but the size of an MBR. If you
> don't like the magic number, a new #define would probably be best.

MBR_SIZE it will be :)

-- 
Eric Blake   eblake redhat com    +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]