Received: from eggs.gnu.org ([2001:4830:134:3::10]:36174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVBX-0007hQ-Aa for qemu-devel@nongnu.org; Wed, 29 Oct 2014 11:29:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjVBQ-0002Ip-Ur for qemu-devel@nongnu.org; Wed, 29 Oct 2014 11:29:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVBQ-0002IQ-Mv for qemu-devel@nongnu.org; Wed, 29 Oct 2014 11:29:12 -0400 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 s9TFTADg005927 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 29 Oct 2014 11:29:11 -0400 Date: Wed, 29 Oct 2014 16:29:08 +0100 From: Kevin Wolf Message-ID: <20141029152908.GB3719@noname.str.redhat.com> References: <1414076175-17034-1-git-send-email-mreitz@redhat.com> <1414076175-17034-2-git-send-email-mreitz@redhat.com> <54493DFA.6070004@redhat.com> <54494258.9050801@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54494258.9050801@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] block: JSON filenames and relative backing files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, Stefan Hajnoczi Am 23.10.2014 um 20:00 hat Max Reitz geschrieben: > On 23.10.2014 19:42, Eric Blake wrote: > >On 10/23/2014 08:56 AM, Max Reitz wrote: > >>When using a relative backing file name, qemu needs to know the > >>directory of the top image file. For JSON filenames, such a directory > >>cannot be easily determined (e.g. how do you determine the directory of > >>a qcow2 BDS directly on top of a quorum BDS?). Therefore, do not allow > >>relative filenames for the backing file of BDSs only having a JSON > >>filename. > >> > >Are JSON names the only case where we want to do this, or should we > >widen it to all non-file protocol names? > > It'll probably work for HTTP, NFS of course and I can see it working > for NBD, too, if one is crazy enough to do that (and you're > mentioning glusterfs). In general, I think all filenames have some > normal unix-path-like sequence as their tail, so relative filenames > can work there (and maybe there are even people using it already for > all kinds of non-file protocols). Perhaps make path_combine() a BlockDriver callback so that each block driver can implement relative paths the way they make most sense for it, or NULL to forbid them? We can still keep a common implementation for "normal" paths in block.c and reference that in raw-posix, curl, etc. Not sure how tricky it will become to integrate any of this relative file name handling nicely in a future, completely QDict-based bdrv_open()... Kevin