block: Add bdrv_has_blk()
authorKevin Wolf <kwolf@redhat.com>
Mon, 29 Feb 2016 09:50:38 +0000 (10:50 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 19 May 2016 14:45:31 +0000 (16:45 +0200)
commitdde33812a83b9c55b180a85411bfc4d6c39e8b11
treee5beba4ece97dcd013bf25b0ad5aaa9a62eb5fd6
parent91c6e4b7bba906cfb8d84481da6340957f876c90
block: Add bdrv_has_blk()

In many cases we just want to know whether a BDS has at least one BB
attached, without needing to know the exact BB that is attached. In
contrast to bs->blk, this is still a valid question when more than one
BB can be attached, so just answer it by checking the parents list.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block/block-backend.c
include/sysemu/block-backend.h