Define and implement TSYMLINK for 9P2000.L
PATCH 1/1 Define and implement TSYMLINK for 9P2000.L
This patch implements creating a symlink for TSYMLINK request and responds with RSYMLINK. In the case of error, we return RERROR.
SYNOPSIS
size[4] Tsymlink tag[2] fid[4] name[s] symtgt[s] gid[4]
size[4] Rsymlink tag[2] qid[13]
DESCRIPTION
Create a symbolic link named 'name' pointing to 'symtgt'. gid represents the effective group id of the caller.
The permissions of a symbolic link are irrelevant hence it is omitted from the protocol.
Signed-off-by Venkateswararao Jujjuri <[email protected]>
--- hw/virtio-9p-debug.c | 11 +++++++ hw/virtio-9p.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++---- hw/virtio-9p.h | 14 +++++++++ 3 files changed, 97 insertions(+), 6 deletions(-)
hw/virtio-9p-debug.c +11 -0
@@ -462,6 +462,17 @@ void pprint_pdu(V9fsPDU *pdu)pprint_qid (pdu,1 , &offset,"qid" );pprint_int32 (pdu,1 , &offset,", iounit" );break ; +case P9_TSYMLINK : +fprintf (llogfile,"TSYMLINK: (" ); +pprint_int32 (pdu,0 , &offset,"fid" ); +pprint_str (pdu,0 , &offset,", name" ); +pprint_str (pdu,0 , &offset,", symname" ); +pprint_int32 (pdu,0 , &offset,", gid" ); +break ; +case P9_RSYMLINK : +fprintf (llogfile,"RSYMLINK: (" ); +pprint_qid (pdu,1 , &offset,"qid" ); +break ;case P9_TREAD :fprintf (llogfile,"TREAD: (" );pprint_int32 (pdu,0 , &offset,"fid" );
hw/virtio-9p.c +72 -6
106 lines not on this page · raw message
hw/virtio-9p.h +14 -0
@@ -15,6 +15,8 @@enum {P9_TSTATFS =8 ,P9_RSTATFS , +P9_TSYMLINK =16 , +P9_RSYMLINK ,P9_TGETATTR =24 ,P9_RGETATTR ,P9_TSETATTR =26 ,
@@ -287,6 +289,18 @@ typedef struct V9fsWstatStateV9fsString nname; } V9fsWstatState; +typedef struct V9fsSymlinkState +{ +V9fsPDU *pdu; +size_t offset; +V9fsString name; +V9fsString symname; +V9fsString fullname; +V9fsFidState *dfidp; +V9fsQID qid; +struct stat stbuf; +}V9fsSymlinkState ; + typedef struct V9fsIattr { int32_t valid;
Signature · 1 line
1.6.5.2