Received: from [140.186.70.92] (port=51471 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POBOq-0007k8-4f for qemu-devel@nongnu.org; Thu, 02 Dec 2010 10:48:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POBOl-0000dd-Ac for qemu-devel@nongnu.org; Thu, 02 Dec 2010 10:48:48 -0500 Received: from mtagate5.uk.ibm.com ([194.196.100.165]:57458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POBOl-0000cw-30 for qemu-devel@nongnu.org; Thu, 02 Dec 2010 10:48:43 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate5.uk.ibm.com (8.13.1/8.13.1) with ESMTP id oB2Fmfv5009340 for ; Thu, 2 Dec 2010 15:48:41 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oB2Fmi033756180 for ; Thu, 2 Dec 2010 15:48:44 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oB2Fmebp017267 for ; Thu, 2 Dec 2010 08:48:40 -0700 Date: Thu, 2 Dec 2010 15:48:40 +0000 From: Stefan Hajnoczi Message-ID: <20101202154839.GA5435@stefan-thinkpad.transitives.com> References: <1291130056-32441-1-git-send-email-stefanha@linux.vnet.ibm.com> <1291130056-32441-4-git-send-email-stefanha@linux.vnet.ibm.com> <4CF7ADCE.7050704@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CF7ADCE.7050704@redhat.com> Subject: [Qemu-devel] Re: [PATCH 3/3] block: Fix the use of protocols in backing files List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Anthony Liguori , qemu-devel@nongnu.org On Thu, Dec 02, 2010 at 03:31:42PM +0100, Kevin Wolf wrote: > Am 30.11.2010 16:14, schrieb Stefan Hajnoczi: > > diff --git a/block.c b/block.c > > index 59b69e4..c9a6720 100644 > > --- a/block.c > > +++ b/block.c > > @@ -611,10 +611,17 @@ int bdrv_open(BlockDriverState *bs, const char *filename, int flags, > > BlockDriver *back_drv = NULL; > > > > bs->backing_hd = bdrv_new(""); > > - path_combine(backing_filename, sizeof(backing_filename), > > - filename, bs->backing_file); > > - if (bs->backing_format[0] != '\0') > > - back_drv = bdrv_find_format(bs->backing_format); > > + if (path_has_protocol(bs->backing_file)) { > > + back_drv = bdrv_find_protocol(bs->backing_file); > > + pstrcpy(backing_filename, sizeof(backing_filename), > > + bs->backing_file); > > + } else { > > + path_combine(backing_filename, sizeof(backing_filename), > > + filename, bs->backing_file); > > + if (bs->backing_format[0] != '\0') { > > + back_drv = bdrv_find_format(bs->backing_format); > > + } > > + } > > Now we ignore bs->backing_format when a protocol is used. We don't even > allow using anything on top of that protocol any more, so for example > qcow2 over sheepdog would be broken. Maybe a use case that you like > better would be QED over http or something. > > It might still not be a very common use case, but this doesn't look > right to me. Probably only the pstrcpy/path_combine should be conditional. True, I'll take a look at that. This reminds me of the write-up that Markus did on block driver trees and formats vs protocols. Stefan