From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MR9TK-00012E-EW for qemu-devel@nongnu.org; Wed, 15 Jul 2009 14:44:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MR9TG-00011s-Sr for qemu-devel@nongnu.org; Wed, 15 Jul 2009 14:44:54 -0400 Received: from [199.232.76.173] (port=40415 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MR9TG-00011o-MG for qemu-devel@nongnu.org; Wed, 15 Jul 2009 14:44:50 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:36636) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MR9TG-0001ZB-AM for qemu-devel@nongnu.org; Wed, 15 Jul 2009 14:44:50 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n6FIh42B031967 for ; Wed, 15 Jul 2009 12:43:04 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n6FIiaMC220950 for ; Wed, 15 Jul 2009 12:44:37 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n6FIiaNr016082 for ; Wed, 15 Jul 2009 12:44:36 -0600 Subject: Re: [Qemu-devel] Re: [PATCH] rev5: support colon in filenames From: Ram Pai In-Reply-To: <20090715182025.GC3056@shareable.org> References: <4A447C8D.5000104@kevin-wolf.de> <1246063310.6278.115.camel@localhost> <1246511321.6429.31.camel@localhost> <4A4C754D.10109@redhat.com> <4A4CAD86.9020607@us.ibm.com> <4A4CB39F.5070506@redhat.com> <1247041831.6297.12.camel@localhost> <1247644283.14246.3.camel@localhost> <4A5DA1B7.5000204@siemens.com> <1247677395.14246.38.camel@localhost> <20090715182025.GC3056@shareable.org> Content-Type: text/plain Date: Wed, 15 Jul 2009 11:44:34 -0700 Message-Id: <1247683475.14246.90.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: linuxram@us.ibm.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Kevin Wolf , Jan Kiszka , Anthony Liguori , qemu-devel@nongnu.org, kvm-devel On Wed, 2009-07-15 at 19:20 +0100, Jamie Lokier wrote: > Ram Pai wrote: > > I have verified with relative paths and it works. > > > > After analyzing the code, i came to the conclusion that call to > > realpath() adds no real value. > > > > The logic in bdrv_open2() is something like this > > > > bdrv_open2() > > { > > if (snapshot) { > > backup = realpath(filename); > > filename=generate_a_temp_file(); > > } > > drv=parse_and_get_bdrv(filename); > > drv->bdrv_open(filename); > > if (backup) { > > bdrv_open2(backup); > > } > > } > > > > in the above function, the call to realpath() would have been useful had > > it changed the current working directory before calling > > bdrv_open2(backup). It does not. If in case any function within > > drv->bdrv_open change the cwd, then I expect them to restore before > > returning. > > > > Also drv->bdrv_open() can anyway handle relative paths. > > > > Hence I conclude that the call to realpath() adds no value. > > > > Do you see a flaw in this logic? > > I don't know about snapshot, but when a qcow2 file contains a relative > path to it's backing file, QEMU cannot simply open using that relative > path, because it's relative to the directory containing the qcow2 file, > not QEMU's current directory. I have successfully verified qcow2 files. But then I may not be trying out the exact thing that you are talking about. Can you give me a test case that I can verify. I am pretty sure that the patch would work. However i have not accumulated enough flight time on qemu; so i can be wrong :( And one other thing. Let me know if there a test-suite that I can try for regressions. RP > > (That said, I find it quite annoying when renaming qcow2 files that > there's no easy way to rename their backing files, and it's even worse > when moving qcow2 files which refer to backing files in another > directory, and _especially_ when the qcow2 file contains an absolute > path to the backing file and you're asked to move it to another system > which doesn't have those directories.) > > -- Jamie -- Ram Pai System X Device-Driver Enablement Lead Linux Technology Center Beaverton OR-97006 503-5783752 t/l 7753752 linuxram@us.ibm.com