From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIJKZ-000469-HX for qemu-devel@nongnu.org; Fri, 15 Aug 2014 11:22:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIJKS-0007sC-W4 for qemu-devel@nongnu.org; Fri, 15 Aug 2014 11:22:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIJKS-0007s3-Na for qemu-devel@nongnu.org; Fri, 15 Aug 2014 11:22:08 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7FFM704011141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 15 Aug 2014 11:22:07 -0400 Message-ID: <53EE259B.5040403@redhat.com> Date: Fri, 15 Aug 2014 17:22:03 +0200 From: Max Reitz MIME-Version: 1.0 References: <1405707901-8253-1-git-send-email-mreitz@redhat.com> In-Reply-To: <1405707901-8253-1-git-send-email-mreitz@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/6] block: Let drivers reconstruct the filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi On 18.07.2014 20:24, Max Reitz wrote: > We may sometimes want a filename for BDSs which do not have one because > they weren't opened using a simple filename (but rather just through > options, for example). > > Some block drivers are always capable of reconstructing a valid filename > (e.g. NBD), even if the BDS has been opened using the options QDict > only. For others (e.g. Quorum) this is impossible. To accommodate this > case, the function which reconstructs ("refreshes") the filename for a > BDS also generates an options QDict (which should always work). If some > layer cannot generate a plain filename (e.g. a Quorum instance), we can > still generate a QDict which contains all options necessary for opening > the block device in (basically) the same state. > > If a filename can be generated, the one stored in the BDS is > overwritten. Otherwise, the QDict is converted to JSON, prefixed with > "json:" and then used as the filename (making use of the JSON > pseudo-protocol). > > > Block drivers which probably need to implement bdrv_refresh_filename() > besides blkdebug, blkverify, NBD and Quorum but which this series does > not cover, are the following: curl, ssh and vvfat. > > > This series supersedes my previous 'block: Fix unset "filename" for > certain drivers'. > > > Max Reitz (6): > block: Add bdrv_refresh_filename() > blkdebug: Implement bdrv_refresh_filename() > blkverify: Implement bdrv_refresh_filename() > nbd: Implement bdrv_refresh_filename() > quorum: Implement bdrv_refresh_filename() > iotests: Add test for image filename construction > > block.c | 135 +++++++++++++++++++++++++++++++++++++++++++++ > block/blkdebug.c | 97 ++++++++++++++++++++++++++++++++ > block/blkverify.c | 29 ++++++++++ > block/nbd.c | 36 ++++++++++++ > block/quorum.c | 39 +++++++++++++ > include/block/block.h | 1 + > include/block/block_int.h | 6 ++ > tests/qemu-iotests/099 | 116 ++++++++++++++++++++++++++++++++++++++ > tests/qemu-iotests/099.out | 20 +++++++ > tests/qemu-iotests/group | 1 + > 10 files changed, 480 insertions(+) > create mode 100755 tests/qemu-iotests/099 > create mode 100644 tests/qemu-iotests/099.out Ping