All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: arun <arun@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR.
Date: Tue, 13 Jul 2010 16:26:30 +0530	[thread overview]
Message-ID: <20100713105630.GB11854@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100713105441.GA11854@linux.vnet.ibm.com>

* Arun R Bharadwaj <arun@linux.vnet.ibm.com> [2010-07-13 16:24:41]:

This patch implements TLERROR/RLERROR in the qemu 9P server.

Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
---
 hw/virtio-9p.c |   19 +++++++++++++------
 hw/virtio-9p.h |    2 ++
 2 files changed, 15 insertions(+), 6 deletions(-)

Index: qemu/hw/virtio-9p.h
===================================================================
--- qemu.orig/hw/virtio-9p.h
+++ qemu/hw/virtio-9p.h
@@ -13,6 +13,8 @@
 #define VIRTIO_9P_MOUNT_TAG 0
 
 enum {
+    P9_TLERROR = 6,
+    P9_RLERROR,
     P9_TVERSION = 100,
     P9_RVERSION,
     P9_TAUTH = 102,
Index: qemu/hw/virtio-9p.c
===================================================================
--- qemu.orig/hw/virtio-9p.c
+++ qemu/hw/virtio-9p.c
@@ -744,17 +744,24 @@ static void complete_pdu(V9fsState *s, V
     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 */

  reply	other threads:[~2010-07-13 10:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 10:54 [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable Arun R Bharadwaj
2010-07-13 10:56 ` Arun R Bharadwaj [this message]
2010-07-13 12:44   ` [Qemu-devel] Re: [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR Arun R Bharadwaj
2010-07-13 13:11   ` [Qemu-devel] " Aneesh Kumar K.V
2010-07-13 13:27     ` Arun R Bharadwaj
2010-07-14 11:25 ` [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable Venkateswararao Jujjuri (JV)
2010-07-15  4:31   ` Arun R Bharadwaj
2010-07-20 17:00 ` Sripathi Kodi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100713105630.GB11854@linux.vnet.ibm.com \
    --to=arun@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.