qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH -V3 32/32] virtio-9p: Handle unknown 9P protocol ver


From: Aneesh Kumar K.V
Subject: [Qemu-devel] [PATCH -V3 32/32] virtio-9p: Handle unknown 9P protocol versions as per the standards.
Date: Thu, 25 Mar 2010 22:13:40 +0530

From: Sripathi Kodi <address@hidden>

Currently the code does BUG_ON if it receives any version other
than 9P2000.u.  However, 9P protocol says:
If the server does not understand the client's version string,
it should respond with an Rversion message (not Rerror) with
the version string the 7 characters "unknown".


Signed-off-by: Sripathi Kodi <address@hidden>
Signed-off-by: M. Mohan Kumar <address@hidden>
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
 hw/virtio-9p.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c
index 1b791ca..e6ddb3a 100644
--- a/hw/virtio-9p.c
+++ b/hw/virtio-9p.c
@@ -725,7 +725,10 @@ static void v9fs_version(V9fsState *s, V9fsPDU *pdu)
     size_t offset = 7;
 
     pdu_unmarshal(pdu, offset, "ds", &msize, &version);
-    BUG_ON(strcmp(version.data, "9P2000.u") != 0);
+
+    if (strcmp(version.data, "9P2000.u")) {
+        v9fs_string_sprintf(&version, "unknown");
+    }
 
     offset += pdu_marshal(pdu, offset, "ds", msize, &version);
     complete_pdu(s, pdu, offset);
-- 
1.7.0.2.323.g0d092





reply via email to

[Prev in Thread] Current Thread [Next in Thread]