summaryrefslogtreecommitdiff
path: root/block/vvfat.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2013-08-23 09:14:47 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-09-06 15:25:08 +0200
commit4f6fd3491cf0f768b135ed2e242bd1d1d2a2efec (patch)
treeb5046de0d490c5770087eeaff3f6190f0f6c22a3 /block/vvfat.c
parent9fcb025146676ab376e6159b58f5a5ddb67bf03c (diff)
downloadqemu-4f6fd3491cf0f768b135ed2e242bd1d1d2a2efec.tar.gz
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>
Diffstat (limited to 'block/vvfat.c')
-rw-r--r--block/vvfat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/vvfat.c b/block/vvfat.c
index a827d91cce..2178a13168 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2894,7 +2894,7 @@ static int write_target_commit(BlockDriverState *bs, int64_t sector_num,
static void write_target_close(BlockDriverState *bs) {
BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
- bdrv_delete(s->qcow);
+ bdrv_unref(s->qcow);
g_free(s->qcow_filename);
}
@@ -2935,7 +2935,7 @@ static int enable_write_target(BDRVVVFATState *s)
ret = bdrv_open(s->qcow, s->qcow_filename, NULL,
BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH, bdrv_qcow);
if (ret < 0) {
- bdrv_delete(s->qcow);
+ bdrv_unref(s->qcow);
goto err;
}