WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] vscsi and symlinks

On Mon, 2011-02-07 at 11:28 +0000, James Harper wrote:
> > 
> > On Mon, 2011-02-07 at 09:43 +0000, James Harper wrote:
> > > I think target isn't always a file. It can be a scsi ID like 0:1:2:3.
> > > I think it can be other types of specifier too.
> > 
> > OK. So perhaps:
> > 
> > if os.path.islink(target):
> >     target = os.path.realpath(target)
> > 
> 
> I guess. I know it's a long shot but what if there was a symlink
> called 0:1:2:3? While that is unlikely, there might be other
> incantations used by vscsi that could ambiguously be the filename of a
> symlink or not. I'd be happier if realpath was only used if an
> absolute path was specified. Who's going to want to specify a relative
> path anyway... what would it be relative to?

Yes, good points. I guess we could go with target[0] == '/' but I think
you are right to go with the conservative approach of checking for /dev/
unless/until someone shows up with a bug suggesting we do otherwise.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel