From: Sasha Levin <levinsasha928@gmail.com>
To: penberg@kernel.org, mingo@elte.hu, gorcunov@gmail.com,
asias.hejun@gmail.com
Cc: kvm@vger.kernel.org, Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH 2/2] kvm tools: support 9p flush command
Date: Fri, 15 Jun 2012 13:34:17 +0200 [thread overview]
Message-ID: <1339760057-17969-2-git-send-email-levinsasha928@gmail.com> (raw)
In-Reply-To: <1339760057-17969-1-git-send-email-levinsasha928@gmail.com>
While we process 9p requests serially, so there's no point for implementing
flush, we still need to answer it to prevent guest kernel from hanging waiting
for it.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
tools/kvm/virtio/9p.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c
index b4341b9..830fc50 100644
--- a/tools/kvm/virtio/9p.c
+++ b/tools/kvm/virtio/9p.c
@@ -1071,6 +1071,19 @@ err_out:
return;
}
+static void virtio_p9_flush(struct p9_dev *p9dev,
+ struct p9_pdu *pdu, u32 *outlen)
+{
+ u16 tag, oldtag;
+
+ virtio_p9_pdu_readf(pdu, "ww", &tag, &oldtag);
+ virtio_p9_pdu_writef(pdu, "w", tag);
+ *outlen = pdu->write_offset;
+ virtio_p9_set_reply_header(pdu, *outlen);
+
+ return;
+}
+
static void virtio_p9_eopnotsupp(struct p9_dev *p9dev,
struct p9_pdu *pdu, u32 *outlen)
{
@@ -1105,7 +1118,7 @@ static p9_handler *virtio_9p_dotl_handler [] = {
[P9_TCLUNK] = virtio_p9_clunk,
[P9_TFSYNC] = virtio_p9_fsync,
[P9_TREAD] = virtio_p9_read,
- [P9_TFLUSH] = virtio_p9_eopnotsupp,
+ [P9_TFLUSH] = virtio_p9_flush,
[P9_TLINK] = virtio_p9_link,
[P9_TSYMLINK] = virtio_p9_symlink,
[P9_TLCREATE] = virtio_p9_create,
--
1.7.8.6
next prev parent reply other threads:[~2012-06-15 11:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 11:34 [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid Sasha Levin
2012-06-15 11:34 ` Sasha Levin [this message]
2012-06-20 7:23 ` [PATCH 2/2] kvm tools: support 9p flush command Pekka Enberg
2012-06-15 11:38 ` [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid Cyrill Gorcunov
2012-06-20 7:23 ` Pekka Enberg
2012-06-20 7:37 ` Cyrill Gorcunov
2012-06-20 7:59 ` Pekka Enberg
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=1339760057-17969-2-git-send-email-levinsasha928@gmail.com \
--to=levinsasha928@gmail.com \
--cc=asias.hejun@gmail.com \
--cc=gorcunov@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penberg@kernel.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