]> git.proxmox.com Git - mirror_qemu.git/commit - linux-user/syscall.c
linux-user: add name_to_handle_at/open_by_handle_at
authorLaurent Vivier <laurent@vivier.eu>
Tue, 1 Sep 2015 20:27:33 +0000 (22:27 +0200)
committerRiku Voipio <riku.voipio@linaro.org>
Mon, 28 Sep 2015 13:44:46 +0000 (16:44 +0300)
commit0f0426f343886fb5c9f137c2830f35cc2dae7327
tree93efd20512ba8c6b38921c28b2a9c91b7dd09f67
parent93b4eff80af9822e4b726dcf21ee61538e088695
linux-user: add name_to_handle_at/open_by_handle_at

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.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c