[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 32/42] block: Make bdrv_get_cumulative_perm() pub
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v6 32/42] block: Make bdrv_get_cumulative_perm() public |
Date: |
Fri, 9 Aug 2019 18:13:57 +0200 |
This is useful in other files like blockdev.c to determine for example
whether a node can be written to or not.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
include/block/block_int.h | 3 +++
block.c | 6 ++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 786801c32f..c17df3808a 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -1205,6 +1205,9 @@ int bdrv_child_try_set_perm(BdrvChild *c, uint64_t perm,
uint64_t shared,
*/
int bdrv_child_refresh_perms(BlockDriverState *bs, BdrvChild *c, Error **errp);
+void bdrv_get_cumulative_perm(BlockDriverState *bs,
+ uint64_t *perm, uint64_t *shared_perm);
+
/* Default implementation for BlockDriver.bdrv_child_perm() that can be used by
* block filters: Forward CONSISTENT_READ, WRITE, WRITE_UNCHANGED and RESIZE to
* all children */
diff --git a/block.c b/block.c
index 6e1ddab056..915b80153c 100644
--- a/block.c
+++ b/block.c
@@ -1713,8 +1713,6 @@ static int bdrv_child_check_perm(BdrvChild *c,
BlockReopenQueue *q,
bool *tighten_restrictions, Error **errp);
static void bdrv_child_abort_perm_update(BdrvChild *c);
static void bdrv_child_set_perm(BdrvChild *c, uint64_t perm, uint64_t shared);
-static void bdrv_get_cumulative_perm(BlockDriverState *bs, uint64_t *perm,
- uint64_t *shared_perm);
typedef struct BlockReopenQueueEntry {
bool prepared;
@@ -1938,8 +1936,8 @@ static void bdrv_set_perm(BlockDriverState *bs, uint64_t
cumulative_perms,
}
}
-static void bdrv_get_cumulative_perm(BlockDriverState *bs, uint64_t *perm,
- uint64_t *shared_perm)
+void bdrv_get_cumulative_perm(BlockDriverState *bs,
+ uint64_t *perm, uint64_t *shared_perm)
{
BdrvChild *c;
uint64_t cumulative_perms = 0;
--
2.21.0
- Re: [Qemu-devel] [PATCH v6 25/42] mirror: Deal with filters, (continued)
- [Qemu-devel] [PATCH v6 27/42] commit: Deal with filters, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 28/42] stream: Deal with filters, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 29/42] nbd: Use CAF when looking for dirty bitmap, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 30/42] qemu-img: Use child access functions, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 31/42] block: Drop backing_bs(), Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 32/42] block: Make bdrv_get_cumulative_perm() public,
Max Reitz <=
- [Qemu-devel] [PATCH v6 33/42] blockdev: Fix active commit choice, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 38/42] iotests: Let complete_and_wait() work with commit, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 34/42] block: Inline bdrv_co_block_status_from_*(), Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 36/42] iotests: Add tests for mirror @replaces loops, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 35/42] block: Fix check_to_replace_node(), Max Reitz, 2019/08/09