aboutsummaryrefslogtreecommitdiff
path: root/block/mirror.c
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2014-04-28 18:29:54 -0400
committerKevin Wolf <kwolf@redhat.com>2014-04-29 11:58:07 +0200
commite855e4fb7b97f7f605e1f44427b98022e39e6f8f (patch)
tree321155c59aa368e5cc8115427e0a89b552a70ddf /block/mirror.c
parent5f6979cba9f63480d38e9deb72b565c6781ac0e8 (diff)
block: Ignore duplicate or NULL format_name in bdrv_iterate_format
Some block drivers have multiple BlockDriver instances with identical format_name fields (e.g. gluster, nbd). Both qemu-img and qemu will use bdrv_iterate_format() to list the supported formats when a help option is invoked. As protocols and formats may register multiple drivers, redundant listings of formats occur (e.g., "Supported formats: ... gluster gluster gluster gluster ... "). Since the list of driver formats will be small, this performs a simple linear search on format_name, and ignores any duplicates. The end result change is that the iterator will no longer receive duplicate string names, nor will it receive NULL pointers. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/mirror.c')
0 files changed, 0 insertions, 0 deletions