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 <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Fam Zheng 2013-08-23 09:14:47 +08:00 committed by Stefan Hajnoczi
parent 9fcb025146
commit 4f6fd3491c
19 changed files with 58 additions and 58 deletions

View file

@ -813,7 +813,7 @@ static int blk_connect(struct XenDevice *xendev)
readonly);
if (bdrv_open(blkdev->bs,
blkdev->filename, NULL, qflags, drv) != 0) {
bdrv_delete(blkdev->bs);
bdrv_unref(blkdev->bs);
blkdev->bs = NULL;
}
}
@ -926,7 +926,7 @@ static void blk_disconnect(struct XenDevice *xendev)
/* close/delete only if we created it ourself */
bdrv_close(blkdev->bs);
bdrv_detach_dev(blkdev->bs, blkdev);
bdrv_delete(blkdev->bs);
bdrv_unref(blkdev->bs);
}
blkdev->bs = NULL;
}