diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2010-04-29 17:44:51 +0530 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-05-03 12:17:38 -0500 |
commit | 92c1ad037a4f3081b07ff945eed10a23087866e2 (patch) | |
tree | bf3b1e2324a4dcb40f3e36fd3f6db97607343a18 | |
parent | 1f5a89bf68193012df13dd3eb188783367e489d5 (diff) | |
download | qemu-92c1ad037a4f3081b07ff945eed10a23087866e2.zip qemu-92c1ad037a4f3081b07ff945eed10a23087866e2.tar.gz qemu-92c1ad037a4f3081b07ff945eed10a23087866e2.tar.bz2 |
virtio-9p: Add P9_TVERSION support
Implement P9_TVERSION support.
[sripathik@in.ibm.com: Handle unknown 9P versions as per the standards]
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | 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 c31f48c..c1c7723 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -843,9 +843,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) |