From patchwork Tue Jun 21 10:55:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 901112 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5LAuMFj018266 for ; Tue, 21 Jun 2011 10:56:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755960Ab1FUK4K (ORCPT ); Tue, 21 Jun 2011 06:56:10 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:37386 "EHLO e23smtp08.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755923Ab1FUK4J (ORCPT ); Tue, 21 Jun 2011 06:56:09 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp08.au.ibm.com (8.14.4/8.13.1) with ESMTP id p5LAorZU006953 for ; Tue, 21 Jun 2011 20:50:53 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p5LAu1sF876602 for ; Tue, 21 Jun 2011 20:56:01 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5LAu0mi025839 for ; Tue, 21 Jun 2011 20:56:01 +1000 Received: from skywalker.in.ibm.com ([9.124.35.19]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p5LAtxk6025821; Tue, 21 Jun 2011 20:55:59 +1000 From: "Aneesh Kumar K.V" To: penberg@kernel.org, levinsasha928@gmail.com Cc: kvm@vger.kernel.org, "Aneesh Kumar K.V" Subject: [PATCH] tools/kvm/9p: return EOPNOTSUPP if the handler is not implemented Date: Tue, 21 Jun 2011 16:25:56 +0530 Message-Id: <1308653756-17177-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 21 Jun 2011 10:56:22 +0000 (UTC) Signed-off-by: Aneesh Kumar K.V --- 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 7bc6c95..7ccb838 100644 --- a/tools/kvm/virtio/9p.c +++ b/tools/kvm/virtio/9p.c @@ -590,6 +590,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; @@ -607,8 +613,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);