From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTYTa-0004ER-0f for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:32:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTYTU-00025j-EO for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:32:25 -0500 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:47603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTYTT-00025X-Hk for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:32:20 -0500 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 24 Nov 2011 17:52:02 +0530 Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAOCLImV3457036 for ; Thu, 24 Nov 2011 17:51:21 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAOCLHnG017047 for ; Thu, 24 Nov 2011 23:21:17 +1100 From: Deepak C Shetty Date: Thu, 24 Nov 2011 17:51:17 +0530 Message-ID: <20111124122117.16532.40290.stgit@deepak-ThinkPad-T60p> In-Reply-To: <20111124122105.16532.32764.stgit@deepak-ThinkPad-T60p> References: <20111124122105.16532.32764.stgit@deepak-ThinkPad-T60p> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 2/2] hw/9pfs: Reset server state during TVERSION List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: dpkshetty@gmail.com As per the 9p rfc, during TVERSION its necessary to clean all the active fids, so that we start the session from a clean state. Its also needed in scenarios where the guest is booting off 9p, and boot fails, and client restarts, without any knowledge of the past, it will issue a TVERSION again so this ensures that we always start from a clean state. Signed-off-by: Deepak C Shetty --- hw/9pfs/virtio-9p.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index ee83d81..b354f52 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -1062,6 +1062,8 @@ static void v9fs_version(void *opaque) pdu_unmarshal(pdu, offset, "ds", &s->msize, &version); trace_v9fs_version(pdu->tag, pdu->id, s->msize, version.data); + virtfs_reset(pdu); + if (!strcmp(version.data, "9P2000.u")) { s->proto_version = V9FS_PROTO_2000U; } else if (!strcmp(version.data, "9P2000.L")) {