[Qemu-devel] [PATCH 1/4] block: improve blk_root_get_parent_desc

Vladimir Sementsov-Ogievskiy posted 4 patches 7 years, 2 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 1/4] block: improve blk_root_get_parent_desc
Posted by Vladimir Sementsov-Ogievskiy 7 years, 2 months ago
Make blk_root_get_parent_desc return different descriptions for
different blk's in worst case.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/block-backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/block-backend.c b/block/block-backend.c
index fa120630be..e5707a0f8c 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -141,7 +141,7 @@ static char *blk_root_get_parent_desc(BdrvChild *child)
     } else {
         /* TODO Callback into the BB owner for something more detailed */
         g_free(dev_id);
-        return g_strdup("a block device");
+        return g_strdup_printf("a block device %p", blk);
     }
 }
 
-- 
2.11.1


Re: [Qemu-devel] [PATCH 1/4] block: improve blk_root_get_parent_desc
Posted by Vladimir Sementsov-Ogievskiy 7 years, 2 months ago
Hmm, now I think, that instead of this, it is better to use pointer as 
parent id for
nod-bds parents, to be sure they will not intersect. And add special 
field to
qapi block relation info "parent-description" for such parents.

Also I'm afraid that this patch may break iotests..

16.08.2018 20:20, Vladimir Sementsov-Ogievskiy wrote:
> Make blk_root_get_parent_desc return different descriptions for
> different blk's in worst case.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   block/block-backend.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/block-backend.c b/block/block-backend.c
> index fa120630be..e5707a0f8c 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -141,7 +141,7 @@ static char *blk_root_get_parent_desc(BdrvChild *child)
>       } else {
>           /* TODO Callback into the BB owner for something more detailed */
>           g_free(dev_id);
> -        return g_strdup("a block device");
> +        return g_strdup_printf("a block device %p", blk);
>       }
>   }
>   


-- 
Best regards,
Vladimir