qemu-e2k/hw/block/dataplane
Paul Durrant 2bcd05cf24 xen-block: scale sector based quantities correctly
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 fcab2b464e "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 <paul.durrant@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190401121719.27208-1-paul.durrant@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2019-04-04 18:00:07 +01:00
..
Makefile.objs block: fix recursion in hw/block/dataplane 2019-03-07 21:45:53 +01:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
virtio-blk.c Replace '-enable-kvm' with '-accel kvm' in docs and help texts 2018-06-28 19:05:32 +02:00
virtio-blk.h hw/block: Fix the return type 2017-12-19 09:25:28 +00:00
xen-block.c xen-block: scale sector based quantities correctly 2019-04-04 18:00:07 +01:00
xen-block.h xen: remove 'XenBlkDev' and 'blkdev' names from dataplane/xen-block 2019-01-14 13:45:40 +00:00