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 --- qemu-io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qemu-io.c') diff --git a/qemu-io.c b/qemu-io.c index d54dc86..71f4ff1 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -32,7 +32,7 @@ static char **cmdline; static int close_f(BlockDriverState *bs, int argc, char **argv) { - bdrv_delete(bs); + bdrv_unref(bs); qemuio_bs = NULL; return 0; } @@ -61,7 +61,7 @@ static int openfile(char *name, int flags, int growable) if (bdrv_open(qemuio_bs, name, NULL, flags, NULL) < 0) { fprintf(stderr, "%s: can't open device %s\n", progname, name); - bdrv_delete(qemuio_bs); + bdrv_unref(qemuio_bs); qemuio_bs = NULL; return 1; } @@ -422,7 +422,7 @@ int main(int argc, char **argv) bdrv_drain_all(); if (qemuio_bs) { - bdrv_delete(qemuio_bs); + bdrv_unref(qemuio_bs); } return 0; } -- cgit v1.1