From: Sasha Levin Date: Fri, 15 Jun 2012 11:34:17 +0000 (+0200) Subject: kvm tools: support 9p flush command X-Git-Tag: next-20120724~32^2~64^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f974d07ccf9a230f2fd5cffdb11e733a780b4663;p=karo-tx-linux.git kvm tools: support 9p flush command 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 Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c index b4341b91e974..830fc5026d86 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,