> Add driver functions for geometry and blocksize detection > > Signed-off-by: Ekaterina Tumanova <tuman...@linux.vnet.ibm.com> > Reviewed-by: Thomas Huth <th...@linux.vnet.ibm.com> > --- > block.c | 34 ++++++++++++++++++++++++++++++++++ > include/block/block.h | 13 +++++++++++++ > include/block/block_int.h | 15 +++++++++++++++ > 3 files changed, 62 insertions(+) > > diff --git a/block.c b/block.c > index 4165d42..93409f5 100644 > --- a/block.c > +++ b/block.c > @@ -548,6 +548,40 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error > **errp) > } > } > > +/** > + * Get @bs's logical and physical block size, store them in @bsz. > + * @bs must not be empty. > + */ > +void bdrv_probe_blocksizes(BlockDriverState *bs, BlockSizes *bsz) > +{ > + BlockDriver *drv = bs->drv; > + > + assert(drv != NULL); > + if (drv->bdrv_probe_blocksizes && > + !drv->bdrv_probe_blocksizes(bs, bsz)) {
So we want to ignore/drop any error? > + return; > + } Looks good to me. David