[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH] rev5: support colon in filenames
From: |
Ram Pai |
Subject: |
Re: [Qemu-devel] Re: [PATCH] rev5: support colon in filenames |
Date: |
Wed, 15 Jul 2009 11:44:34 -0700 |
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
address@hidden
- Re: [Qemu-devel] [PATCH] rev3: support colon in filenames, (continued)
- Re: [Qemu-devel] [PATCH] rev3: support colon in filenames, Kevin Wolf, 2009/07/02
- Re: [Qemu-devel] [PATCH] rev3: support colon in filenames, Anthony Liguori, 2009/07/02
- Re: [Qemu-devel] [PATCH] rev3: support colon in filenames, Kevin Wolf, 2009/07/02
- [Qemu-devel] [PATCH] rev4: support colon in filenames, Ram Pai, 2009/07/08
- [Qemu-devel] Re: [PATCH] rev4: support colon in filenames, Jan Kiszka, 2009/07/08
- [Qemu-devel] Re: [PATCH] rev4: support colon in filenames, Anthony Liguori, 2009/07/10
- [Qemu-devel] [PATCH] rev5: support colon in filenames, Ram Pai, 2009/07/15
- [Qemu-devel] Re: [PATCH] rev5: support colon in filenames, Jan Kiszka, 2009/07/15
- [Qemu-devel] Re: [PATCH] rev5: support colon in filenames, Ram Pai, 2009/07/15
- Re: [Qemu-devel] Re: [PATCH] rev5: support colon in filenames, Jamie Lokier, 2009/07/15
- Re: [Qemu-devel] Re: [PATCH] rev5: support colon in filenames,
Ram Pai <=
- [Qemu-devel] qcow2 relative paths (was: [PATCH] rev5: support colon in filenames), Jamie Lokier, 2009/07/15
- [Qemu-devel] Re: qcow2 relative paths, Jan Kiszka, 2009/07/15
- [Qemu-devel] Re: qcow2 relative paths (was: [PATCH] rev5: support colon in filenames), Ram Pai, 2009/07/15
- [Qemu-devel] Re: qcow2 relative paths, Kevin Wolf, 2009/07/16
- [Qemu-devel] Re: qcow2 relative paths, Ram Pai, 2009/07/16
- [Qemu-devel] [PATCH] rev6: support colon in filenames, Ram Pai, 2009/07/16
- [Qemu-devel] [PATCH] rev7: support colon in filenames, Ram Pai, 2009/07/17
- [Qemu-devel] Re: [PATCH] rev7: support colon in filenames, Kevin Wolf, 2009/07/21
- Re: [Qemu-devel] [PATCH] rev5: support colon in filenames, Blue Swirl, 2009/07/15
- Re: [Qemu-devel] [PATCH] rev5: support colon in filenames, Anthony Liguori, 2009/07/15