qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Deepak C Shetty <deepakcs@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: dpkshetty@gmail.com
Subject: [Qemu-devel] [PATCH 2/2] hw/9pfs: Reset server state during TVERSION
Date: Thu, 24 Nov 2011 17:51:17 +0530	[thread overview]
Message-ID: <20111124122117.16532.40290.stgit@deepak-ThinkPad-T60p> (raw)
In-Reply-To: <20111124122105.16532.32764.stgit@deepak-ThinkPad-T60p>

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 <deepakcs@linux.vnet.ibm.com>
---

 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")) {

      reply	other threads:[~2011-11-24 12:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24 12:21 [Qemu-devel] [PATCH 1/2] hw/9pfs: Add 9P2000.L detach operation Deepak C Shetty
2011-11-24 12:21 ` Deepak C Shetty [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111124122117.16532.40290.stgit@deepak-ThinkPad-T60p \
    --to=deepakcs@linux.vnet.ibm.com \
    --cc=dpkshetty@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).