From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1Hem-0001ji-2R for qemu-devel@nongnu.org; Wed, 17 Dec 2014 11:41:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1Hed-0006z6-1w for qemu-devel@nongnu.org; Wed, 17 Dec 2014 11:41:00 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:52377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1Hec-0006yU-P8 for qemu-devel@nongnu.org; Wed, 17 Dec 2014 11:40:50 -0500 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Dec 2014 16:40:48 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 78D8717E7B27 for ; Wed, 17 Dec 2014 15:27:12 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBHFQlkG9568472 for ; Wed, 17 Dec 2014 15:26:47 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBHFQj4A023713 for ; Wed, 17 Dec 2014 08:26:46 -0700 Date: Wed, 17 Dec 2014 16:26:41 +0100 From: David Hildenbrand Message-ID: <20141217162641.1f4dac9d@thinkpad-w530> In-Reply-To: <1418728219-40595-2-git-send-email-tumanova@linux.vnet.ibm.com> References: <1418728219-40595-1-git-send-email-tumanova@linux.vnet.ibm.com> <1418728219-40595-2-git-send-email-tumanova@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 1/5] block: add bdrv functions for geometry and blocksize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ekaterina Tumanova Cc: kwolf@redhat.com, thuth@linux.vnet.ibm.com, Public KVM Mailing List , armbru@redhat.com, borntraeger@de.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, mihajlov@linux.vnet.ibm.com > Add driver functions for geometry and blocksize detection > > Signed-off-by: Ekaterina Tumanova > Reviewed-by: Thomas Huth > --- > 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