qemu-virtio-9p: Implement TREADLINK operation for 9p2000.L
PATCH 1/1 qemu-virtio-9p: Implement TREADLINK operation for 9p2000.L
Synopsis
size[4] TReadlink tag[2] fid[4]
size[4] RReadlink tag[2] target[s]
Description
Readlink is used to return the contents of the symoblic link referred by fid. Contents of symboic link is returned as a response.
target[s] - Contents of the symbolic link referred by fid.
Signed-off-by M. Mohan Kumar <[email protected]>
Reviewed-by Aneesh Kumar K.V <[email protected]>
--- hw/virtio-9p-debug.c | 8 ++++++++ hw/virtio-9p.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ hw/virtio-9p.h | 9 +++++++++ 3 files changed, 61 insertions(+), 0 deletions(-)
hw/virtio-9p-debug.c +8 -0
@@ -502,6 +502,14 @@ void pprint_pdu(V9fsPDU *pdu)fprintf (llogfile,"RMKNOD: )" );pprint_qid (pdu,0 , &offset,"qid" );break ; +case P9_TREADLINK : +fprintf (llogfile,"TREADLINK: (" ); +pprint_int32 (pdu,0 , &offset,"fid" ); +break ; +case P9_RREADLINK : +fprintf (llogfile,"RREADLINK: (" ); +pprint_str (pdu,0 , &offset,"target" ); +break ;case P9_TREAD :fprintf (llogfile,"TREAD: (" );pprint_int32 (pdu,0 , &offset,"fid" );
hw/virtio-9p.c +44 -0
56 lines not on this page · raw message
hw/virtio-9p.h +9 -0
@@ -27,6 +27,8 @@ enum {P9_RMKNOD ,P9_TRENAME =20 ,P9_RRENAME , +P9_TREADLINK =22 , +P9_RREADLINK ,P9_TGETATTR =24 ,P9_RGETATTR , P9_TSETATTR = 26,
@@ -434,6 +436,13 @@ typedef struct V9fsXattrStatevoid *value; } V9fsXattrState; +typedef struct V9fsReadLinkState +{ +V9fsPDU *pdu; +size_t offset; +V9fsString target; +}V9fsReadLinkState ; +extern size_t pdu_packunpack (void *addr,struct iovec *sg,int sg_count,size_t offset,size_t size,int pack);
Signature · 1 line
1.7.0.4