qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH -V5 09/21] virtio-9p: Add P9_TVERSION support


From: Aneesh Kumar K.V
Subject: [Qemu-devel] [PATCH -V5 09/21] virtio-9p: Add P9_TVERSION support
Date: Thu, 15 Apr 2010 19:40:59 +0530

From: Anthony Liguori <address@hidden>

Implement P9_TVERSION support.

address@hidden: Handle unknown 9P versions as per the standards]

Signed-off-by: Anthony Liguori <address@hidden>
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
 hw/virtio-9p.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c
index 5dab1d3..ccc45a3 100644
--- a/hw/virtio-9p.c
+++ b/hw/virtio-9p.c
@@ -845,9 +845,20 @@ static void v9fs_dummy(V9fsState *s, V9fsPDU *pdu)
 
 static void v9fs_version(V9fsState *s, V9fsPDU *pdu)
 {
-    if (debug_9p_pdu) {
-        pprint_pdu(pdu);
+    int32_t msize;
+    V9fsString version;
+    size_t offset = 7;
+
+    pdu_unmarshal(pdu, offset, "ds", &msize, &version);
+
+    if (strcmp(version.data, "9P2000.u")) {
+        v9fs_string_sprintf(&version, "unknown");
     }
+
+    offset += pdu_marshal(pdu, offset, "ds", msize, &version);
+    complete_pdu(s, pdu, offset);
+
+    v9fs_string_free(&version);
 }
 
 static void v9fs_attach(V9fsState *s, V9fsPDU *pdu)
-- 
1.7.0.4.360.g11766c





reply via email to

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