aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>2010-05-28 11:44:57 +0900
committerKevin Wolf <kwolf@redhat.com>2010-06-04 11:43:40 +0200
commit2bc93fed76c89f7adaa0e5bb357dcdc6c2b097a8 (patch)
tree5982353ed7064ff6459e897ff3305b644f5580c5 /block.c
parent08a00559f00975cebcb3f844fe7c708d65b6a3b3 (diff)
downloadqemu-2bc93fed76c89f7adaa0e5bb357dcdc6c2b097a8.zip
qemu-2bc93fed76c89f7adaa0e5bb357dcdc6c2b097a8.tar.gz
qemu-2bc93fed76c89f7adaa0e5bb357dcdc6c2b097a8.tar.bz2
close all the block drivers before the qemu process exits
This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close handler. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block.c b/block.c
index ecd9867..b1ef85c 100644
--- a/block.c
+++ b/block.c
@@ -648,6 +648,15 @@ void bdrv_close(BlockDriverState *bs)
}
}
+void bdrv_close_all(void)
+{
+ BlockDriverState *bs;
+
+ QTAILQ_FOREACH(bs, &bdrv_states, list) {
+ bdrv_close(bs);
+ }
+}
+
void bdrv_delete(BlockDriverState *bs)
{
/* remove from list, if necessary */