block: Use common driver selection code for bdrv_open_file()
authorKevin Wolf <kwolf@redhat.com>
Tue, 3 Jun 2014 14:44:19 +0000 (16:44 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 26 Jun 2014 11:51:01 +0000 (13:51 +0200)
commitf4788adcb4903e20dadc5455d3d69d0a481f35e4
tree7454fdeedeb699982e48edd48d836d07f3bc113b
parent17b005f1d422d4581f8ce95b75d603deb081f4f3
block: Use common driver selection code for bdrv_open_file()

This moves the bdrv_open_file() call a bit down so that it can use the
bdrv_open() code that selects the right block driver.

The code between the old and the new call site is either common code
(the error message for an unknown driver has been unified now) or
doesn't run with cleared BDRV_O_PROTOCOL (added an if block in one
place, whereas the right path was already asserted in another place)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
block.c