From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35711 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBTBQ-0007LY-Qz for qemu-devel@nongnu.org; Thu, 28 Oct 2010 10:10:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PBTBO-0006dF-Ex for qemu-devel@nongnu.org; Thu, 28 Oct 2010 10:10:24 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:59182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PBTBO-0006d6-Bu for qemu-devel@nongnu.org; Thu, 28 Oct 2010 10:10:22 -0400 Received: by iwn36 with SMTP id 36so2434044iwn.4 for ; Thu, 28 Oct 2010 07:10:21 -0700 (PDT) Message-ID: <4CC98456.6060201@codemonkey.ws> Date: Thu, 28 Oct 2010 09:10:30 -0500 From: Anthony Liguori 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> <20101028093502.GC11647@redhat.com> <4CC94746.1040601@redhat.com> <20101028095149.GE11647@redhat.com> In-Reply-To: <20101028095149.GE11647@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , Stefan Hajnoczi , qemu-devel@nongnu.org, Adam Litke On 10/28/2010 04:51 AM, Daniel P. Berrange wrote: >> The problem is that this wouldn't work in the general case. It's rather >> an exception that it makes sense for file: backing files with file: >> images. Consider this: >> >> # qemu-img create -o backing_file=nbd:foo:1234 /tmp/main.img >> >> Without this patch, you'll end up with /tmp/nbd:foo:1234, which is >> probably not what you wanted. With a patch that would work for file: you >> would get a hardly better path nbd:/tmp/foo:1234 >> > Since we know the protocol, there could be a per-protocol function used > for resolving the backing store URI relative to the master URI. That > would avoid needing to special case file: in the shared generic code. > Relative resolution of a backing files makes me very nervous. Any time a disk image can reasonably resolve to something other than what the user expected is potentially a very nasty security issue. The less obvious the resolution, the worse the problem becomes. I think resolution based on current path is probably the most obvious implementation. Regards, Anthony Liguori > Daniel >