[tip:tools/kvm] tools/kvm/9p: return EOPNOTSUPP if the handler is not implemented

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  d49c968065a90afd393d8c452ed29441ed274090
Gitweb:     http://git.kernel.org/tip/d49c968065a90afd393d8c452ed29441ed274090
Author:     Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
AuthorDate: Tue, 28 Jun 2011 12:26:50 +0530
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Thu, 30 Jun 2011 10:45:46 +0300

tools/kvm/9p: return EOPNOTSUPP if the handler is not implemented

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/virtio/9p.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c
index 2727a85..69e534f 100644
--- a/tools/kvm/virtio/9p.c
+++ b/tools/kvm/virtio/9p.c
@@ -609,6 +609,12 @@ static u8 virtio_p9_get_cmd(struct p9_pdu *pdu)
 	return msg->cmd;
 }
 
+static void virtio_p9_eopnotsupp(struct p9_dev *p9dev,
+				 struct p9_pdu *pdu, u32 *outlen)
+{
+	return virtio_p9_error_reply(p9dev, pdu, EOPNOTSUPP, outlen);
+}
+
 static bool virtio_p9_do_io_request(struct kvm *kvm, struct p9_dev_job *job)
 {
 	u8 cmd;
@@ -626,8 +632,7 @@ static bool virtio_p9_do_io_request(struct kvm *kvm, struct p9_dev_job *job)
 
 	if (cmd >= ARRAY_SIZE(virtio_9p_handler) ||
 	    !virtio_9p_handler[cmd]) {
-		printf("Unsupported P9 message type: %u\n", cmd);
-
+		handler = virtio_p9_eopnotsupp;
 	} else {
 		handler = virtio_9p_handler[cmd];
 		handler(p9dev, p9pdu, &len);
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux