Skip to content

Prefer bdrv_lookup_bs() to find BDS nodes

Jeff Cody qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: Use bdrv_lookup_bs() instead of bdrv_find_node()block/block-backend.c block/mirror.c block/write-threshold.c+3 -35 replies
2/3block: make bdrv_find_node() staticblock.c include/block/block.h+15 -162 replies
3/3block: use bdrv_lookup_bs() over blk_by_name() for BDS only resultsblockdev.c migration/block.c+32 -582 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchMax ReitzAlberto Garcia
1/3R-b R-b
2/3R-b R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] Prefer bdrv_lookup_bs() to find BDS nodes

This series is on top of Alberto's "Add 'blockdev-snapshot' command" series

BlockBackend devices and BlockDriverState node-names occupy the same namespace. In addition, there are two methods that can be used in different circumstances to look up a BlockDriverState: blk_by_name() and bdrv_find_node().

There is also a common interface, bdrv_lookup_bs(), that can look up either by blk_by_name() or bdrv_find_node().

This makes bdrv_find_node() redundant for an external interface. And in the cases where we just want the underlying BDS for a BlockBackend device, it is simpler to use bdrv_lookup_bs() instead of blk_by_name().

This series makes bdrv_find_node() static and internal to block.c as a helper function, and attempts to simplify some code when we are looking just for the BDS of a BlockBackend device.

Jeff Cody (3):
block: Use bdrv_lookup_bs() instead of bdrv_find_node()
block: make bdrv_find_node() static
block: use bdrv_lookup_bs() over blk_by_name() for BDS only results

 block.c                 | 30 +++++++++---------
 block/block-backend.c   |  2 +-
 block/mirror.c          |  2 +-
 block/write-threshold.c |  2 +-
 blockdev.c              | 84 ++++++++++++++++++-------------------------------
 include/block/block.h   |  1 -
 migration/block.c       |  6 ++--
 7 files changed, 50 insertions(+), 77 deletions(-)
Signature · 1 line
1.9.3