Re: [PATCH] block/export: improve vu_blk_sect_range_ok()

2021-05-12 Thread Kevin Wolf
Am 11.05.2021 um 10:25 hat Stefan Hajnoczi geschrieben: > On Wed, Mar 31, 2021 at 03:27:27PM +0100, Stefan Hajnoczi wrote: > > The checks in vu_blk_sect_range_ok() assume VIRTIO_BLK_SECTOR_SIZE is > > equal to BDRV_SECTOR_SIZE. This is true, but let's add a > > QEMU_BUILD_BUG_ON() to make it explic

Re: [PATCH] block/export: improve vu_blk_sect_range_ok()

2021-05-11 Thread Stefan Hajnoczi
On Wed, Mar 31, 2021 at 03:27:27PM +0100, Stefan Hajnoczi wrote: > The checks in vu_blk_sect_range_ok() assume VIRTIO_BLK_SECTOR_SIZE is > equal to BDRV_SECTOR_SIZE. This is true, but let's add a > QEMU_BUILD_BUG_ON() to make it explicit. > > We might as well check that the request buffer size is

Re: [PATCH] block/export: improve vu_blk_sect_range_ok()

2021-03-31 Thread Eric Blake
On 3/31/21 9:27 AM, Stefan Hajnoczi wrote: > The checks in vu_blk_sect_range_ok() assume VIRTIO_BLK_SECTOR_SIZE is > equal to BDRV_SECTOR_SIZE. This is true, but let's add a > QEMU_BUILD_BUG_ON() to make it explicit. > > We might as well check that the request buffer size is a multiple of > VIRTIO

[PATCH] block/export: improve vu_blk_sect_range_ok()

2021-03-31 Thread Stefan Hajnoczi
The checks in vu_blk_sect_range_ok() assume VIRTIO_BLK_SECTOR_SIZE is equal to BDRV_SECTOR_SIZE. This is true, but let's add a QEMU_BUILD_BUG_ON() to make it explicit. We might as well check that the request buffer size is a multiple of VIRTIO_BLK_SECTOR_SIZE while we're at it. Suggested-by: Max