From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCqCb-0005kH-5V for qemu-devel@nongnu.org; Mon, 10 Feb 2014 07:43:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCqCV-0003DI-1Y for qemu-devel@nongnu.org; Mon, 10 Feb 2014 07:43:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCqCU-0003DE-Po for qemu-devel@nongnu.org; Mon, 10 Feb 2014 07:43:02 -0500 Date: Mon, 10 Feb 2014 13:42:50 +0100 From: Kevin Wolf Message-ID: <20140210124250.GC2832@dhcp-200-207.str.redhat.com> References: <1391881159-13585-1-git-send-email-mreitz@redhat.com> <1391881159-13585-2-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1391881159-13585-2-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/8] block: Change BDS parameter of bdrv_open() to ** List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Jeff Cody , qemu-devel@nongnu.org, Stefan Hajnoczi , =?iso-8859-1?Q?Beno=EEt?= Canet Am 08.02.2014 um 18:39 hat Max Reitz geschrieben: > Make bdrv_open() take a pointer to a BDS pointer, similarly to > bdrv_file_open(). If a pointer to a NULL pointer is given, bdrv_open() > will create a new BDS with an empty name; if the BDS pointer is not > NULL, that existing BDS will be reused (in the same way as bdrv_open() > already did). > > Signed-off-by: Max Reitz > --- > block.c | 64 +++++++++++++++++++++++++++++++-------------------- > block/blkdebug.c | 1 + > block/blkverify.c | 2 ++ > block/qcow2.c | 14 +++++++---- > block/vmdk.c | 5 ++-- > block/vvfat.c | 6 ++--- > blockdev.c | 20 ++++++++-------- > hw/block/xen_disk.c | 2 +- > include/block/block.h | 2 +- > qemu-img.c | 10 ++++---- > qemu-io.c | 2 +- > qemu-nbd.c | 2 +- > 12 files changed, 72 insertions(+), 58 deletions(-) > @@ -1160,6 +1158,10 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp) > * BlockdevRef. > * > * The BlockdevRef will be removed from the options QDict. > + * > + * As with bdrv_open(), if *pbs is NULL, a new BDS will be created with a > + * pointer to it stored there. If it is not NULL, the referenced BDS will > + * be reused. > */ > int bdrv_open_image(BlockDriverState **pbs, const char *filename, > QDict *options, const char *bdref_key, int flags, There are no callers that make use of *pbs != NULL. Are you planning to add such users? Otherwise, we could just assert() it here instead of documenting behaviour that is never used. Kevin