On Wed, Jul 30, 2014 at 05:39:41PM +0400, Michael Tokarev wrote:
> 23.07.2014 01:11, Bastian Blank wrote:
> > The local 9p support supports readdir.  It does not translate the value
> > of d_type, so the guest always sees a regular file, even in a lstat call
> > describes it correctly as symlink.
> I'm not sure what do you mean by "translate".  It passes d_type from host.
> And it works in guest as is.  Including ldconfig and other stuff.  In
> particular, d_type is 8 for regular files in guest, 10 for symlinks and
> 4 for directories.

The 9p host code uses extended attributes to save the type:

| $ stat ld-linux-x86-64.so.2 
|   File: ‘ld-linux-x86-64.so.2’
|   Size: 32              Blocks: 8          IO Block: 4096   regular file
| Device: 33h/51d Inode: 84315       Links: 1
| Access: (0600/-rw-------)  Uid: ( 1000/ bastian)   Gid: ( 1000/ bastian)
[...]
| $ getfattr -d -e hex ld-linux-x86-64.so.2
| # file: ld-linux-x86-64.so.2
| user.virtfs.gid=0x00000000
| user.virtfs.mode=0xffa10000
| user.virtfs.uid=0x00000000
| $ hexdump -C ld-linux-x86-64.so.2 
| 00000000  2f 6c 69 62 2f 78 38 36  5f 36 34 2d 6c 69 6e 75  |/lib/x86_64-linu|
| 00000010  78 2d 67 6e 75 2f 6c 64  2d 32 2e 31 39 2e 73 6f  |x-gnu/ld-2.19.so|

There is nothing in the host readdir implementation that handles this
extra type information.

Bastian

-- 
The sight of death frightens them [Earthers].
                -- Kras the Klingon, "Friday's Child", stardate 3497.2


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to