Re: [PATCH] esx: Fix regression in absolute file name handling

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

 



2011/5/26 Eric Blake <eblake@xxxxxxxxxx>:
> On 05/26/2011 09:45 AM, Matthias Bolte wrote:
>>
>> - Â Â Â Âif (datastorePath == NULL) {
>> + Â Â Â Â/* If it's an absolute path outside of a datastore just use it as is */
>> + Â Â Â Âif (result == NULL && *fileName == '/') {
>> + Â Â Â Â Â Â/* FIXME: need to deal with Windows paths here too */
>
> #include "dosname.h" // from gnulib, already imported into libvirt
>
> if (result == NULL && IS_ABSOLUTE_FILE_NAME(fileName)) {
>
> and that will properly detect '/' on Unix and 'c:\' on Windows paths
> according to what OS that you compiled libvirt to run on. ÂI am assuming
> that the absolute paths in question are residing on the machine where
> libvirt is running.
>
> (I'm not familiar enough with esx, so my assumption might be wrong, with
> this code being a generic situation of trying to recognize a string as
> an absolute path from the point of the view of the machine where the
> guest is running, even though libvirt is running on a different system
> and will never be able to actually probe if such a file exists. ÂIf so,
> then you have to do the parsing work yourself, since
> IS_ABSOLUTE_FILE_NAME compiled on Linux won't recognize Windows-style
> names as absolute - it only recognizes windows names on mingw or cygwin
> - but at least you have dosname.h to give some hints on how to do the
> parsing).

libvirt is not running the the ESX/GSX server and the file names are
local to the ESX/GSX server. Therefore, IS_ABSOLUTE_FILE_NAME won't
work here.

>> +
>> + Â Â Â Âresult = virBufferContentAndReset(&buffer);
>> + Â Â} else if (*fileName == '/') {
>> + Â Â Â Â/* FIXME: need to deal with Windows paths here too */
>
> And again.
>
> But I don't see anything that would prevent using this patch as-is,
> leaving absolute windows names for a subsequent patch; and since it
> fixes a regression:
>
> ACK.
>

Thanks, pushing this patch as is.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]