[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3] xen-block: scale sector based quantities cor
From: |
Anthony PERARD |
Subject: |
Re: [Qemu-block] [PATCH v3] xen-block: scale sector based quantities correctly |
Date: |
Mon, 1 Apr 2019 17:54:44 +0100 |
User-agent: |
Mutt/1.11.4 (2019-03-13) |
On Mon, Apr 01, 2019 at 01:17:19PM +0100, Paul Durrant wrote:
> The Xen blkif protocol requires that sector based quantities should be
> interpreted strictly as multiples of 512 bytes. Specifically:
>
> "first_sect and last_sect in blkif_request_segment, as well as
> sector_number in blkif_request, are always expressed in 512-byte units."
>
> Commit fcab2b464e06 "xen: add header and build dataplane/xen-block.c"
> incorrectly modified behaviour to use the block device logical_block_size
> property as the scale, instead of correctly shifting values by the
> hardcoded BDRV_SECTOR_BITS (and hence scaling them to 512 byte units).
> This patch undoes that change and restores compliance with the spec.
>
> Furthermore, this patch also restores the original xen_disk behaviour
> of advertizing a hardcoded 'sector-size' value of 512 in xenstore and
> scaling 'sectors' accordingly. The realize() method is also modified to
> fail if logical_block_size is set to anything other than 512.
>
> Signed-off-by: Paul Durrant <address@hidden>
Reviewed-by: Anthony PERARD <address@hidden>
Thanks,
--
Anthony PERARD