Re: [PATCH v1 2/5] virtio-blk: move config space sizing code to virtio-blk-common

2022-08-25 Thread Stefan Hajnoczi
On Thu, Aug 25, 2022 at 12:11:10AM +0300, Daniil Tatianin wrote: > > > On 8/24/22 9:13 PM, Stefan Hajnoczi wrote: > > On Wed, Aug 24, 2022 at 12:18:34PM +0300, Daniil Tatianin wrote: > > > +size_t virtio_blk_common_get_config_size(uint64_t host_features) > > > +{ > > > +size_t config_size = M

Re: [PATCH v1 2/5] virtio-blk: move config space sizing code to virtio-blk-common

2022-08-24 Thread Daniil Tatianin
On 8/24/22 9:13 PM, Stefan Hajnoczi wrote: On Wed, Aug 24, 2022 at 12:18:34PM +0300, Daniil Tatianin wrote: +size_t virtio_blk_common_get_config_size(uint64_t host_features) +{ +size_t config_size = MAX(VIRTIO_BLK_CFG_SIZE, +virtio_feature_get_config_size(feature_sizes, host_featu

Re: [PATCH v1 2/5] virtio-blk: move config space sizing code to virtio-blk-common

2022-08-24 Thread Stefan Hajnoczi
On Wed, Aug 24, 2022 at 12:18:34PM +0300, Daniil Tatianin wrote: > +size_t virtio_blk_common_get_config_size(uint64_t host_features) > +{ > +size_t config_size = MAX(VIRTIO_BLK_CFG_SIZE, > +virtio_feature_get_config_size(feature_sizes, host_features)); > + > +assert(config_size <= s

[PATCH v1 2/5] virtio-blk: move config space sizing code to virtio-blk-common

2022-08-24 Thread Daniil Tatianin
This way we can reuse it for other virtio-blk devices, e.g vhost-user-blk, which currently does not control its config space size dynamically. Signed-off-by: Daniil Tatianin --- MAINTAINERS | 4 +++ hw/block/meson.build | 4 +-- hw/block/virtio-blk-co