From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwlyy-0005Mq-1Q for qemu-devel@nongnu.org; Thu, 12 Nov 2015 02:07:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwlyx-00023X-0v for qemu-devel@nongnu.org; Thu, 12 Nov 2015 02:07:43 -0500 Date: Thu, 12 Nov 2015 15:07:32 +0800 From: Fam Zheng Message-ID: <20151112070732.GK4082@ad.usersys.redhat.com> References: <1447108773-6836-1-git-send-email-mreitz@redhat.com> <1447108773-6836-19-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447108773-6836-19-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 18/24] block: Make bdrv_close() static List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Markus Armbruster , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , John Snow On Mon, 11/09 23:39, Max Reitz wrote: > There are no users of bdrv_close() left, except for one of bdrv_open()'s > failure paths, bdrv_close_all() and bdrv_delete(), and that is good. > Make bdrv_close() static so nobody makes the mistake of directly using > bdrv_close() again. > > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake > Reviewed-by: Alberto Garcia > Reviewed-by: Kevin Wolf > --- > block.c | 4 +++- > include/block/block.h | 1 - > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/block.c b/block.c > index 4ee3b01..b5874aa 100644 > --- a/block.c > +++ b/block.c > @@ -92,6 +92,8 @@ static void bdrv_release_all_dirty_bitmaps(BlockDriverState *bs); > /* If non-zero, use only whitelisted block drivers */ > static int use_bdrv_whitelist; > > +static void bdrv_close(BlockDriverState *bs); > + > #ifdef _WIN32 > static int is_windows_drive_prefix(const char *filename) > { > @@ -1894,7 +1896,7 @@ void bdrv_reopen_abort(BDRVReopenState *reopen_state) > } > > > -void bdrv_close(BlockDriverState *bs) > +static void bdrv_close(BlockDriverState *bs) > { > BdrvAioNotifier *ban, *ban_next; > > diff --git a/include/block/block.h b/include/block/block.h > index 8d9a049..03551d3 100644 > --- a/include/block/block.h > +++ b/include/block/block.h > @@ -222,7 +222,6 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, > BlockReopenQueue *queue, Error **errp); > void bdrv_reopen_commit(BDRVReopenState *reopen_state); > void bdrv_reopen_abort(BDRVReopenState *reopen_state); > -void bdrv_close(BlockDriverState *bs); > int bdrv_read(BlockDriverState *bs, int64_t sector_num, > uint8_t *buf, int nb_sectors); > int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num, > -- > 2.6.2 > > Reviewed-by: Fam Zheng