From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Uws-0005JV-Cz for qemu-devel@nongnu.org; Sun, 26 Jan 2014 14:00:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7Uwm-0001P9-E0 for qemu-devel@nongnu.org; Sun, 26 Jan 2014 14:00:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Uwm-0001Os-5F for qemu-devel@nongnu.org; Sun, 26 Jan 2014 14:00:44 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0QJ0g73016049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 26 Jan 2014 14:00:42 -0500 From: Max Reitz Date: Sun, 26 Jan 2014 20:02:33 +0100 Message-Id: <1390762963-25538-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 00/10] block: Integrate bdrv_file_open() into bdrv_open() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz 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