aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-9p-debug.c
diff options
context:
space:
mode:
authorSripathi Kodi <sripathik@in.ibm.com>2010-06-09 14:57:57 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2010-09-08 22:56:39 +0530
commitc18e2f9431dab6ae02195e3b4b8ba61d0dbd2cb8 (patch)
tree8ed84b8a6f6a40c6e8592be3072e4ec4bf3b5116 /hw/virtio-9p-debug.c
parent926487b70be7cfd0303168a68a092bc6faf122ca (diff)
[V4] virtio-9p: readdir implementation for 9p2000.L
This patch implements the server part of readdir() implementation for 9p2000.L SYNOPSIS size[4] Treaddir tag[2] fid[4] offset[8] count[4] size[4] Rreaddir tag[2] count[4] data[count] DESCRIPTION The readdir request asks the server to read the directory specified by 'fid' at an offset specified by 'offset' and return as many dirent structures as possible that fit into count bytes. Each dirent structure is laid out as follows. qid.type[1] the type of the file (directory, etc.), represented as a bit vector corresponding to the high 8 bits of the file's mode word. qid.vers[4] version number for given path qid.path[8] the file server's unique identification for the file offset[8] offset into the next dirent. type[1] type of this directory entry. name[256] name of this directory entry. Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com> Reviewed-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Diffstat (limited to 'hw/virtio-9p-debug.c')
-rw-r--r--hw/virtio-9p-debug.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/virtio-9p-debug.c b/hw/virtio-9p-debug.c
index c1b0e6f066..240bec8985 100644
--- a/hw/virtio-9p-debug.c
+++ b/hw/virtio-9p-debug.c
@@ -330,6 +330,19 @@ void pprint_pdu(V9fsPDU *pdu)
BUG_ON(!llogfile);
switch (pdu->id) {
+ case P9_TREADDIR:
+ fprintf(llogfile, "TREADDIR: (");
+ pprint_int32(pdu, 0, &offset, "fid");
+ pprint_int64(pdu, 0, &offset, ", initial offset");
+ pprint_int32(pdu, 0, &offset, ", max count");
+ break;
+ case P9_RREADDIR:
+ fprintf(llogfile, "RREADDIR: (");
+ pprint_int32(pdu, 1, &offset, "count");
+#ifdef DEBUG_DATA
+ pprint_data(pdu, 1, &offset, ", data");
+#endif
+ break;
case P9_TVERSION:
fprintf(llogfile, "TVERSION: (");
pprint_int32(pdu, 0, &offset, "msize");