From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrpYN-0004YC-L5 for qemu-devel@nongnu.org; Fri, 21 Nov 2014 09:51:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrpYH-0005mz-Gd for qemu-devel@nongnu.org; Fri, 21 Nov 2014 09:51:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrpYH-0005ml-9P for qemu-devel@nongnu.org; Fri, 21 Nov 2014 09:51:13 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sALEpBgj015997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 21 Nov 2014 09:51:12 -0500 Message-ID: <546F515D.8070000@redhat.com> Date: Fri, 21 Nov 2014 15:51:09 +0100 From: Max Reitz MIME-Version: 1.0 References: <1415110763-14586-1-git-send-email-mreitz@redhat.com> In-Reply-To: <1415110763-14586-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 v2 0/5] block: Relative backing files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi On 2014-11-04 at 15:19, Max Reitz wrote: > Technically, this is a v2 to my previous series > "block: JSON filenames and relative backing files", although only patch > 2 and 5 were already part of that series, and also patch 2 has been > changed quite a bit in this version. > > So, first the original cover letter: > > Sometimes, qemu does not have a filename to work with (it then generates > a JSON filename), so it does not know which directory to use for a > backing file specified by a relative filename. > > In this case, qemu should not somehow try to append the backing file's > name to the JSON object, but rather just print an error and bail out. > > And now about why this v2 exists: > > Stefan already applied v1 before realizing that the test added in the > series was actually broken for vmdk (which I somehow missed myself). > This was due to vmdk trying to open the backing file on creation in > order to determine its format; however, normally the backing file path > is interpreted relatively to the backed image's base directory, whereas > in this case vmdk directly used the user-specified filename which was > therefore interpreted relatively to qemu's working directory. > > Patch 4 of this v2 fixes this. A similar issue exists directly in > bdrv_img_create() which opens the backing file in order to determine its > size in case the size of the new image has not been specified. This is > fixed by patch 3. > > The function both patches use is factored out from > bdrv_get_full_backing_filename() (which we cannot use here because it > requires a BDS which does not necessarily exist during image creation) > in patch 1. Patch 2 was then modified so it modifies this new function > (bdrv_get_full_backing_filename_from_filename()) and the old > bdrv_get_full_backing_filename(), which is now more or less just a > wrapper. > > And finally, I added a test to patch 5 which tests creation of a backed > image in another directory only using relative paths while omitting the > image size (which is therefore inferred from the backing file). > > > Max Reitz (5): > block: Get full backing filename from string > block: JSON filenames and relative backing files > block: Relative backing file for image creation > block/vmdk: Relative backing file for creation > iotests: Add test for relative backing file names > > block.c | 50 ++++++++++++++++++------ > block/qapi.c | 7 +++- > block/vmdk.c | 13 ++++++- > include/block/block.h | 6 ++- > tests/qemu-iotests/110 | 94 ++++++++++++++++++++++++++++++++++++++++++++++ > tests/qemu-iotests/110.out | 19 ++++++++++ > tests/qemu-iotests/group | 1 + > 7 files changed, 176 insertions(+), 14 deletions(-) > create mode 100755 tests/qemu-iotests/110 > create mode 100644 tests/qemu-iotests/110.out Ping