[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RESEND 08/50] block/quorum: Implement bdrv_is_insert
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH RESEND 08/50] block/quorum: Implement bdrv_is_inserted() |
Date: |
Tue, 27 Jan 2015 14:45:41 -0500 |
bdrv_is_inserted() should be invoked recursively on the children of
quorum.
Signed-off-by: Max Reitz <address@hidden>
---
block/quorum.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/block/quorum.c b/block/quorum.c
index 437b122..7811c4a 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1064,6 +1064,20 @@ static void quorum_refresh_filename(BlockDriverState *bs)
bs->full_open_options = opts;
}
+static int 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 0;
+ }
+ }
+
+ return 1;
+}
+
static BlockDriver bdrv_quorum = {
.format_name = "quorum",
.protocol_name = "quorum",
@@ -1087,6 +1101,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.1.0
- [Qemu-devel] [PATCH RESEND 00/50] blockdev: BlockBackend and media, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 04/50] hw/usb-storage: Check whether BB is inserted, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 05/50] block: Fix BB AIOCB AioContext without BDS, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 06/50] block: Add blk_is_available(), Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 07/50] block: Make bdrv_is_inserted() recursive, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 02/50] iotests: Only create BB if necessary, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 08/50] block/quorum: Implement bdrv_is_inserted(),
Max Reitz <=
- [Qemu-devel] [PATCH RESEND 11/50] block: Move BlockAcctStats into BlockBackend, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 12/50] block: Move I/O status and error actions into BB, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 09/50] block: Move guest_block_size into BlockBackend, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 18/50] block: Respect empty BB in bdrv_query_info(), Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 16/50] block: Prepare remaining BB functions for NULL BDS, Max Reitz, 2015/01/27