From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55092 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBOBE-0002s8-W1 for qemu-devel@nongnu.org; Thu, 28 Oct 2010 04:49:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PBOBE-0004nO-0N for qemu-devel@nongnu.org; Thu, 28 Oct 2010 04:49:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PBOBD-0004nF-O8 for qemu-devel@nongnu.org; Thu, 28 Oct 2010 04:49:51 -0400 Message-ID: <4CC93958.9020101@redhat.com> Date: Thu, 28 Oct 2010 10:50:32 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] block: fix the use of protocols in backing files References: <1288203550-23698-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Anthony Liguori , Adam Litke , qemu-devel@nongnu.org, Stefan Hajnoczi Am 28.10.2010 10:30, schrieb Stefan Hajnoczi: > On Wed, Oct 27, 2010 at 7:19 PM, Anthony Liguori wrote: >> Signed-off-by: Anthony Liguori >> >> diff --git a/block.c b/block.c >> index 1a965b2..00b6f21 100644 >> --- a/block.c >> +++ b/block.c >> @@ -603,10 +603,16 @@ 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); >> + back_drv = bdrv_find_protocol(bs->backing_file); >> + if (!back_drv) { >> + 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); >> + } else { >> + pstrcpy(backing_filename, sizeof(backing_filename), >> + bs->backing_file); >> + } >> >> /* backing files always opened read-only */ >> back_flags = >> -- >> 1.7.0.4 > > I think this makes sense. > > Now it is possible to specify backing files that are relative to > QEMU's current working directory using file:filename. I don't see > harm in this. It would be more consistent if it was relative to the image, but there's no meaningful way to do that for arbitrary protocols. It's definitely not worse than before the change. Kevin