[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 22/27] close all the block drivers before the qemu p
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 22/27] close all the block drivers before the qemu process exits |
Date: |
Fri, 4 Jun 2010 18:33:10 +0200 |
From: MORITA Kazutaka <address@hidden>
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 <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 9 +++++++++
block.h | 1 +
vl.c | 1 +
3 files changed, 11 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 */
diff --git a/block.h b/block.h
index 756670d..25744b1 100644
--- a/block.h
+++ b/block.h
@@ -123,6 +123,7 @@ BlockDriverAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
/* Ensure contents are flushed to disk. */
void bdrv_flush(BlockDriverState *bs);
void bdrv_flush_all(void);
+void bdrv_close_all(void);
int bdrv_has_zero_init(BlockDriverState *bs);
int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
diff --git a/vl.c b/vl.c
index 2769d1a..551138f 100644
--- a/vl.c
+++ b/vl.c
@@ -1991,6 +1991,7 @@ static void main_loop(void)
vm_stop(r);
}
}
+ bdrv_close_all();
pause_all_vcpus();
}
--
1.6.6.1
- [Qemu-devel] [PATCH 03/27] Cleanup: raw-posix.c: Be more consistent using BDRV_SECTOR_SIZE instead of 512, (continued)
- [Qemu-devel] [PATCH 03/27] Cleanup: raw-posix.c: Be more consistent using BDRV_SECTOR_SIZE instead of 512, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 09/27] ide: Remove useless IDEDeviceInfo members unit, drive, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 17/27] ide: Fix info qtree for ide-drive.ver, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 18/27] scsi: Turn drive serial into a qdev property scsi-disk.serial, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 19/27] scsi: Fix info qtree for scsi-disk.ver, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 27/27] block: Fix serial number assignment, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 20/27] Fix error message in drive_init, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 24/27] blockdev: Hide QEMUMachine from drive_init(), Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 23/27] block: call the snapshot handlers of the protocol drivers, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 25/27] qdev: Move declaration of qdev_init_bdrv() into qdev.h, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 22/27] close all the block drivers before the qemu process exits,
Kevin Wolf <=
- [Qemu-devel] [PATCH 21/27] block: Assume raw for drives without media, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 26/27] blockdev: Collect block device code in new blockdev.c, Kevin Wolf, 2010/06/04