diff options
author | Arun R Bharadwaj <arun@linux.vnet.ibm.com> | 2010-07-28 14:10:22 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-09-08 22:58:40 +0530 |
commit | 8f4d1ca58fb7e1b9d6109a93bdab891b92cfd940 (patch) | |
tree | 605c77d3224135a9425c0f55f29a93f0e53b54ae /hw/virtio-9p.c | |
parent | cf03eb2c18019e484ce1f436373e90e18835fb77 (diff) |
[virtio-9p] This patch implements TLERROR/RLERROR on the qemu 9P server.
Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Diffstat (limited to 'hw/virtio-9p.c')
-rw-r--r-- | hw/virtio-9p.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 60a40b9330..4b15ce7197 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -844,17 +844,24 @@ static void complete_pdu(V9fsState *s, V9fsPDU *pdu, ssize_t len) int8_t id = pdu->id + 1; /* Response */ if (len < 0) { - V9fsString str; int err = -len; + len = 7; - str.data = strerror(err); - str.size = strlen(str.data); + if (s->proto_version != V9FS_PROTO_2000L) { + V9fsString str; + + str.data = strerror(err); + str.size = strlen(str.data); + + len += pdu_marshal(pdu, len, "s", &str); + id = P9_RERROR; + } - len = 7; - len += pdu_marshal(pdu, len, "s", &str); len += pdu_marshal(pdu, len, "d", err); - id = P9_RERROR; + if (s->proto_version == V9FS_PROTO_2000L) { + id = P9_RLERROR; + } } /* fill out the header */ |