From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VktNz-0005Ly-FT for qemu-devel@nongnu.org; Mon, 25 Nov 2013 05:27:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VktNt-00088y-Ty for qemu-devel@nongnu.org; Mon, 25 Nov 2013 05:27:23 -0500 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:44022 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VktNt-00088r-JI for qemu-devel@nongnu.org; Mon, 25 Nov 2013 05:27:17 -0500 Message-ID: <52932619.9040706@kamp.de> Date: Mon, 25 Nov 2013 11:27:37 +0100 From: Peter Lieven MIME-Version: 1.0 References: <1385124001-3576-1-git-send-email-pbonzini@redhat.com> <1385124001-3576-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1385124001-3576-8-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 07/19] vpc, vhdx: add get_info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, stefanha@redhat.com On 22.11.2013 13:39, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > block/vhdx.c | 10 ++++++++++ > block/vpc.c | 14 ++++++++++++++ > 2 files changed, 24 insertions(+) > > diff --git a/block/vhdx.c b/block/vhdx.c > index 7d1af96..ed6fa53 100644 > --- a/block/vhdx.c > +++ b/block/vhdx.c > @@ -1043,6 +1043,15 @@ static void vhdx_block_translate(BDRVVHDXState *s, int64_t sector_num, > } > > > +static int vhdx_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) > +{ > + BDRVVHDXState *s = bs->opaque; > + > + bdi->cluster_size = s->block_size; > + > + return 0; > +} > + > > static coroutine_fn int vhdx_co_readv(BlockDriverState *bs, int64_t sector_num, > int nb_sectors, QEMUIOVector *qiov) > @@ -1885,6 +1894,7 @@ static BlockDriver bdrv_vhdx = { > .bdrv_co_readv = vhdx_co_readv, > .bdrv_co_writev = vhdx_co_writev, > .bdrv_create = vhdx_create, > + .bdrv_get_info = vhdx_get_info, > > .create_options = vhdx_create_options, > }; > diff --git a/block/vpc.c b/block/vpc.c > index 577cc45..551876f 100644 > --- a/block/vpc.c > +++ b/block/vpc.c > @@ -455,6 +455,18 @@ fail: > return -1; > } > > +static int vpc_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) > +{ > + BDRVVPCState *s = (BDRVVPCState *)bs->opaque; > + VHDFooter *footer = (VHDFooter *) s->footer_buf; > + > + if (cpu_to_be32(footer->type) != VHD_FIXED) { > + bdi->cluster_size = s->block_size; > + } > + > + return 0; > +} > + > static int vpc_read(BlockDriverState *bs, int64_t sector_num, > uint8_t *buf, int nb_sectors) > { > @@ -857,6 +869,8 @@ static BlockDriver bdrv_vpc = { > .bdrv_read = vpc_co_read, > .bdrv_write = vpc_co_write, > > + .bdrv_get_info = vpc_get_info, > + > .create_options = vpc_create_options, > .bdrv_has_zero_init = vpc_has_zero_init, > }; Reviewed-by: Peter Lieven