[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 07/38] block/quorum: Implement bdrv_is_inserted()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v4 07/38] block/quorum: Implement bdrv_is_inserted() |
Date: |
Mon, 20 Jul 2015 19:45:34 +0200 |
bdrv_is_inserted() should be invoked recursively on the children of
quorum.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block/quorum.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/block/quorum.c b/block/quorum.c
index 4e66221..b7a4c09 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1034,6 +1034,20 @@ static void quorum_refresh_filename(BlockDriverState *bs)
bs->full_open_options = opts;
}
+static bool quorum_is_inserted(BlockDriverState *bs)
+{
+ BDRVQuorumState *s = bs->opaque;
+ int i;
+
+ for (i = 0; i < s->num_children; i++) {
+ if (!bdrv_is_inserted(s->bs[i])) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
static BlockDriver bdrv_quorum = {
.format_name = "quorum",
.protocol_name = "quorum",
@@ -1057,6 +1071,8 @@ static BlockDriver bdrv_quorum = {
.is_filter = true,
.bdrv_recurse_is_first_non_filter = quorum_recurse_is_first_non_filter,
+
+ .bdrv_is_inserted = quorum_is_inserted,
};
static void bdrv_quorum_init(void)
--
2.4.6
- [Qemu-devel] [PATCH v4 00/38] blockdev: BlockBackend and media, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 01/38] block: Remove host floppy support, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 02/38] blockdev: Allow creation of BDS trees without BB, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 03/38] iotests: Only create BB if necessary, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 05/38] block: Add blk_is_available(), Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 06/38] block: Make bdrv_is_inserted() recursive, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 04/38] block: Make bdrv_is_inserted() return a bool, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 07/38] block/quorum: Implement bdrv_is_inserted(),
Max Reitz <=
- [Qemu-devel] [PATCH v4 08/38] block: Invoke change media CB before NULLing drv, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 10/38] hw/usb-storage: Check whether BB is inserted, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 09/38] hw/block/fdc: Implement tray status, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 11/38] block: Fix BB AIOCB AioContext without BDS, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 12/38] block: Move guest_block_size into BlockBackend, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 13/38] block: Remove wr_highest_sector from BlockAcctStats, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 14/38] block: Move BlockAcctStats into BlockBackend, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 16/38] block: Add BlockBackendRootState, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 15/38] block: Move I/O status and error actions into BB, Max Reitz, 2015/07/20
- [Qemu-devel] [PATCH v4 17/38] block: Make some BB functions fall back to BBRS, Max Reitz, 2015/07/20