From patchwork Thu Sep 2 19:39:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [-V5, 27/28, virtio-9p] This patch implements TLERROR/RLERROR on the qemu 9P server. Date: Thu, 02 Sep 2010 09:39:47 -0000 From: jvrao X-Patchwork-Id: 63554 Message-Id: <1283456388-13083-28-git-send-email-jvrao@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Cc: Arun R Bharadwaj , aliguori@us.ibm.com, Venkateswararao Jujjuri From: Arun R Bharadwaj Signed-off-by: Arun R Bharadwaj Signed-off-by: Venkateswararao Jujjuri --- hw/virtio-9p.c | 19 +++++++++++++------ hw/virtio-9p.h | 2 ++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 60a40b9..4b15ce7 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 */ diff --git a/hw/virtio-9p.h b/hw/virtio-9p.h index 016ba1d..0816ad6 100644 --- a/hw/virtio-9p.h +++ b/hw/virtio-9p.h @@ -13,6 +13,8 @@ #define VIRTIO_9P_MOUNT_TAG 0 enum { + P9_TLERROR = 6, + P9_RLERROR, P9_TSTATFS = 8, P9_RSTATFS, P9_TLOPEN = 12,