Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuqBS-0007UQ-Ow for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:45:26 -0400 Received: from [140.186.70.92] (port=50905 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuqB8-0007L7-8a for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:45:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuqAx-0005HX-Sp for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:45:06 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:45346) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuqAx-0005HB-BC for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:44:55 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp08.au.ibm.com (8.14.3/8.13.1) with ESMTP id o2PGisiB004618 for ; Fri, 26 Mar 2010 03:44:54 +1100 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2PGisAf847980 for ; Fri, 26 Mar 2010 03:44:54 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2PGirAI031915 for ; Fri, 26 Mar 2010 03:44:53 +1100 From: "Aneesh Kumar K.V" Date: Thu, 25 Mar 2010 22:13:40 +0530 Message-Id: <1269535420-31206-33-git-send-email-aneesh.kumar@linux.vnet.ibm.com> In-Reply-To: <1269535420-31206-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1269535420-31206-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V3 32/32] virtio-9p: Handle unknown 9P protocol versions as per the standards. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ericvh@gmail.com, "M. Mohan Kumar" , aliguori@us.ibm.com, Sripathi Kodi , "Aneesh Kumar K.V" From: Sripathi Kodi 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 Signed-off-by: M. Mohan Kumar Signed-off-by: Aneesh Kumar K.V --- 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