Re: [Qemu-devel] Re: [PATCH] rev5: support colon in filenames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

(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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux