From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qe8GL-0006N3-9U for qemu-devel@nongnu.org; Tue, 05 Jul 2011 12:14:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qe8GJ-0005y7-Nu for qemu-devel@nongnu.org; Tue, 05 Jul 2011 12:14:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qe8GJ-0005y0-8B for qemu-devel@nongnu.org; Tue, 05 Jul 2011 12:14:11 -0400 Message-ID: <4E1338FF.7050109@redhat.com> Date: Tue, 05 Jul 2011 18:17:03 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1309840884-32409-1-git-send-email-devin122@gmail.com> <1309840884-32409-2-git-send-email-devin122@gmail.com> In-Reply-To: <1309840884-32409-2-git-send-email-devin122@gmail.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/5] block: add bdrv_open_conversion_target List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Devin Nakamura Cc: qemu-devel@nongnu.org Am 05.07.2011 06:41, schrieb Devin Nakamura: > Signed-off-by: Devin Nakamura > --- > block.c | 19 +++++++++++++++++++ > block.h | 2 ++ > 2 files changed, 21 insertions(+), 0 deletions(-) > > diff --git a/block.c b/block.c > index 24a25d5..e7699a6 100644 > --- a/block.c > +++ b/block.c > @@ -3018,3 +3018,22 @@ out: > > return ret; > } > + > + > +int bdrv_open_conversion_target(BlockDriverState **bs, > + char *filename, char *target_fmt, QEMUOptionParameter *options) > +{ > + BlockDriver *drv; > + > + drv = bdrv_find_format(target_fmt); > + if(!drv){ I'll comment on it here, but you need to fix the coding style in the whole series. You may want to try scripts/checkpatch.pl. > + return -ENOENT; > + } > + > + if(!drv->bdrv_open_conversion_target){ > + return -ENOTSUP; > + } > + *bs = bdrv_new(""); > + (*bs)->opaque = qemu_malloc(drv->instance_size); > + return drv->bdrv_open_conversion_target(*bs, filename, options); Is this actually enough? The normal bdrv_open() sets much more fields of the BlockDriverState, and I would expect that the block drivers rely on at least some of them. Kevin