[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/6] block: simplify bdrv_child_user_desc()
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH 5/6] block: simplify bdrv_child_user_desc() |
Date: |
Mon, 3 May 2021 14:34:01 +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 1de2365843..20efd7a7b0 100644
--- a/block.c
+++ b/block.c
@@ -2037,11 +2037,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
- Re: [PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child, (continued)
- [PATCH 2/6] block: bdrv_reopen_multiple(): fix leak of tran object, Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 6/6] block: improve permission conflict error message, Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 3/6] block-backend: improve blk_root_get_parent_desc(), Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 4/6] block: improve bdrv_child_get_parent_desc(), Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 5/6] block: simplify bdrv_child_user_desc(),
Vladimir Sementsov-Ogievskiy <=
- [PATCH 7/6] block: document child argument of bdrv_attach_child_common(), Vladimir Sementsov-Ogievskiy, 2021/05/03