qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] linux-user: add name_to_handle_at/open_by_ha


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH v2] linux-user: add name_to_handle_at/open_by_handle_at
Date: Fri, 4 Sep 2015 18:14:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0


Le 04/09/2015 15:45, Peter Maydell a écrit :
> On 1 September 2015 at 21:27, Laurent Vivier <address@hidden> wrote:
>> This patch allows to run example given by open_by_handle_at(2):
>>
>>       The following shell session demonstrates the use of these two programs:
>>
>>            $ echo 'Can you please think about it?' > cecilia.txt
>>            $ ./t_name_to_handle_at cecilia.txt > fh
>>            $ ./t_open_by_handle_at < fh
>>            open_by_handle_at: Operation not permitted
>>            $ sudo ./t_open_by_handle_at < fh      # Need CAP_SYS_ADMIN
>>            Read 31 bytes
>>            $ rm cecilia.txt
>>
>>        Now  we delete and (quickly) re-create the file so that it has the 
>> same
>>        content and (by chance) the  same  inode.[...]
>>
>>            $ stat --printf="%i\n" cecilia.txt     # Display inode number
>>            4072121
>>            $ rm cecilia.txt
>>            $ echo 'Can you please think about it?' > cecilia.txt
>>            $ stat --printf="%i\n" cecilia.txt     # Check inode number
>>            4072121
>>            $ sudo ./t_open_by_handle_at < fh
>>            open_by_handle_at: Stale NFS file handle
>>
>> See the man page for source code.
>>
>> Signed-off-by: Laurent Vivier <address@hidden>
>> ---
>> v2: Rename function parameters, swap fh->handle_type in both functions,
>>     When I have re-tested the patch I have found a bug in the size of
>>     the data, so I fix this too (handle_bytes is the size of f_handle[]
>>     only, not of the whole structure)
> 
> Reviewed-by: Peter Maydell <address@hidden>
> 
> (I guess the signalfd patch needs to be rebased on top of this,
> since this adds another syscall that returns an fd...)

Yes.

Thank you for the reviews. I'll rework the signalfd one.

Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]