[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 4/5] block: simplify bdrv_child_user_desc()
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 4/5] block: simplify bdrv_child_user_desc() |
Date: |
Tue, 4 May 2021 12:45:09 +0300 |
All existing parent types (block nodes, block devices, jobs) has the
realization. So, drop unreachable code.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block.c b/block.c
index 54a3da9311..2f73523285 100644
--- a/block.c
+++ b/block.c
@@ -2029,11 +2029,7 @@ bool bdrv_is_writable(BlockDriverState *bs)
static char *bdrv_child_user_desc(BdrvChild *c)
{
- if (c->klass->get_parent_desc) {
- return c->klass->get_parent_desc(c);
- }
-
- return g_strdup("another user");
+ return c->klass->get_parent_desc(c);
}
static bool bdrv_a_allow_b(BdrvChild *a, BdrvChild *b, Error **errp)
--
2.29.2
[PATCH v2 1/5] block: document child argument of bdrv_attach_child_common(), Vladimir Sementsov-Ogievskiy, 2021/05/04