From patchwork Tue Jun 28 06:56:50 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: 923222 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 p5S76AS7012636 for ; Tue, 28 Jun 2011 07:06:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756506Ab1F1G6K (ORCPT ); Tue, 28 Jun 2011 02:58:10 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:50072 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756247Ab1F1G47 (ORCPT ); Tue, 28 Jun 2011 02:56:59 -0400 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp07.in.ibm.com (8.14.4/8.13.1) with ESMTP id p5S6utBq027048 for ; Tue, 28 Jun 2011 12:26:55 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p5S6utba2850888 for ; Tue, 28 Jun 2011 12:26:55 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5S6us61008792 for ; Tue, 28 Jun 2011 16:56:55 +1000 Received: from skywalker.in.ibm.com ([9.79.214.146]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p5S6uqcX008758; Tue, 28 Jun 2011 16:56:54 +1000 From: "Aneesh Kumar K.V" To: penberg@kernel.org, levinsasha928@gmail.com Cc: kvm@vger.kernel.org, "Aneesh Kumar K.V" Subject: [PATCH -V4 2/2] tools/kvm/9p: return EOPNOTSUPP if the handler is not implemented Date: Tue, 28 Jun 2011 12:26:50 +0530 Message-Id: <1309244210-29163-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1309244210-29163-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1309244210-29163-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> 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, 28 Jun 2011 07:06:10 +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 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);