From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43743 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYdD2-0002Ig-SJ for qemu-devel@nongnu.org; Tue, 13 Jul 2010 06:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OYdAD-00089M-NF for qemu-devel@nongnu.org; Tue, 13 Jul 2010 06:56:43 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:36185) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYdAD-000891-6x for qemu-devel@nongnu.org; Tue, 13 Jul 2010 06:56:37 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp01.au.ibm.com (8.14.4/8.13.1) with ESMTP id o6DArtlD003355 for ; Tue, 13 Jul 2010 20:53:55 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o6DAuYwc1396786 for ; Tue, 13 Jul 2010 20:56:34 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o6DAuYCF032677 for ; Tue, 13 Jul 2010 20:56:34 +1000 Date: Tue, 13 Jul 2010 16:26:30 +0530 From: Arun R Bharadwaj Message-ID: <20100713105630.GB11854@linux.vnet.ibm.com> References: <20100713105441.GA11854@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20100713105441.GA11854@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR. Reply-To: arun@linux.vnet.ibm.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: arun * Arun R Bharadwaj [2010-07-13 16:24:41]: This patch implements TLERROR/RLERROR in the qemu 9P server. Signed-off-by: Arun R Bharadwaj --- 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 */