bdrv_file_open() is now nearly a subset of bdrv_open(), except for the fact that bdrv_file_open() is for protocols and bdrv_open() for block drivers. It is possible to use bdrv_file_open() with a block driver, but in that case that block driver must be explicitly specified.
Due to these great similarities, bdrv_file_open() can be integrated and made a special case of bdrv_open(). If the flag BDRV_O_PROTOCOL is specified, bdrv_open() will now do what bdrv_file_open() used to do: Auto-detecting a protocol instead of a block driver. This series implements this and changes all calls to bdrv_file_open() to bdrv_open() calls with BDRV_O_PROTOCOL specified. Note that this flag cannot be discerned automatically since it is impossible for bdrv_open() to know by itself whether a given file should be opened with a block driver or through a protocol: Both are valid alternatives. Therefore, it still has to be specified by the user. Max Reitz (10): block: Change BDS parameter of bdrv_open() to ** block: Add reference parameter to bdrv_open() block: Make bdrv_file_open() static block: Reuse NULL options check from bdrv_open() block: Reuse reference handling from bdrv_open() block: Remove bdrv_new() from bdrv_file_open() block: Reuse fail path from bdrv_open() block: Reuse bs->options setting from bdrv_open() block: Reuse success path from bdrv_open() block: Remove bdrv_open_image()'s force_raw option block.c | 191 +++++++++++++++++++++++--------------------------- block/blkdebug.c | 2 +- block/blkverify.c | 4 +- block/cow.c | 6 +- block/qcow.c | 6 +- block/qcow2.c | 19 +++-- block/qed.c | 5 +- block/sheepdog.c | 8 ++- block/vhdx.c | 5 +- block/vmdk.c | 17 +++-- block/vvfat.c | 6 +- blockdev.c | 23 +++--- hw/block/xen_disk.c | 4 +- include/block/block.h | 12 ++-- qemu-img.c | 8 +-- qemu-io.c | 8 ++- qemu-nbd.c | 2 +- 17 files changed, 159 insertions(+), 167 deletions(-) -- 1.8.5.3