From 4f6fd3491cf0f768b135ed2e242bd1d1d2a2efec Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 23 Aug 2013 09:14:47 +0800 Subject: block: make bdrv_delete() static Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is no longer public and should be called by bdrv_unref() if refcnt is decreased to 0. This is an identical change because effectively, there's no multiple reference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets bs->refcnt to 1, so all bdrv_unref() now actually delete the BDS. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/blkverify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'block/blkverify.c') diff --git a/block/blkverify.c b/block/blkverify.c index 1d58cc3..c4e961e 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -155,7 +155,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags) s->test_file = bdrv_new(""); ret = bdrv_open(s->test_file, filename, NULL, flags, NULL); if (ret < 0) { - bdrv_delete(s->test_file); + bdrv_unref(s->test_file); s->test_file = NULL; goto fail; } @@ -169,7 +169,7 @@ static void blkverify_close(BlockDriverState *bs) { BDRVBlkverifyState *s = bs->opaque; - bdrv_delete(s->test_file); + bdrv_unref(s->test_file); s->test_file = NULL; } -- cgit v1.1