From patchwork Sun Jun 19 10:24:03 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: 894502 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5JAPAUA027998 for ; Sun, 19 Jun 2011 10:25:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753403Ab1FSKZB (ORCPT ); Sun, 19 Jun 2011 06:25:01 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:39494 "EHLO e23smtp07.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753374Ab1FSKY7 (ORCPT ); Sun, 19 Jun 2011 06:24:59 -0400 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp07.au.ibm.com (8.14.4/8.13.1) with ESMTP id p5JAOn5u021077 for ; Sun, 19 Jun 2011 20:24:49 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p5JANiex1429750 for ; Sun, 19 Jun 2011 20:23:44 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5JAOmjG005789 for ; Sun, 19 Jun 2011 20:24:49 +1000 Received: from skywalker.in.ibm.com ([9.124.209.131]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p5JAOkSO005592; Sun, 19 Jun 2011 20:24:47 +1000 From: "Aneesh Kumar K.V" To: penberg@kernel.org, levinsasha928@gmail.com Cc: kvm@vger.kernel.org, "Aneesh Kumar K.V" Subject: [PATCH 1/2] tools/kvm/9p: Make the 9p handler void return Date: Sun, 19 Jun 2011 15:54:03 +0530 Message-Id: <1308479044-14465-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 (demeter1.kernel.org [140.211.167.41]); Sun, 19 Jun 2011 10:25:11 +0000 (UTC) Error is reported via RERROR message. Signed-off-by: Aneesh Kumar K.V --- tools/kvm/virtio/9p.c | 54 ++++++++++++++++++++++++------------------------ 1 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c index 0e885b5..8067e8a 100644 --- a/tools/kvm/virtio/9p.c +++ b/tools/kvm/virtio/9p.c @@ -225,7 +225,7 @@ static void virtio_p9_error_reply(struct p9_dev *p9dev, set_p9msg_hdr(inmsg, *outlen, P9_RERROR, outmsg->tag); } -static bool virtio_p9_version(struct p9_dev *p9dev, +static void virtio_p9_version(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { struct p9_msg *inmsg = pdu->in_iov[0].iov_base; @@ -240,10 +240,10 @@ static bool virtio_p9_version(struct p9_dev *p9dev, rversion->version.len + sizeof(u16) + sizeof(u32); set_p9msg_hdr(inmsg, *outlen, P9_RVERSION, outmsg->tag); - return true; + return; } -static bool virtio_p9_clunk(struct p9_dev *p9dev, +static void virtio_p9_clunk(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { struct p9_msg *inmsg = pdu->in_iov[0].iov_base; @@ -255,10 +255,10 @@ static bool virtio_p9_clunk(struct p9_dev *p9dev, *outlen = VIRTIO_P9_HDR_LEN; set_p9msg_hdr(inmsg, *outlen, P9_RCLUNK, outmsg->tag); - return true; + return; } -static bool virtio_p9_open(struct p9_dev *p9dev, +static void virtio_p9_open(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { struct stat st; @@ -286,13 +286,13 @@ static bool virtio_p9_open(struct p9_dev *p9dev, } *outlen = VIRTIO_P9_HDR_LEN + sizeof(*ropen); set_p9msg_hdr(inmsg, *outlen, P9_ROPEN, outmsg->tag); - return true; + return; err_out: virtio_p9_error_reply(p9dev, pdu, errno, outlen); - return true; + return; } -static bool virtio_p9_create(struct p9_dev *p9dev, +static void virtio_p9_create(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { u8 mode; @@ -324,17 +324,17 @@ static bool virtio_p9_create(struct p9_dev *p9dev, } if (lstat(fid->abs_path, &st) < 0) - return false; + return; st2qid(&st, &rcreate->qid); *outlen = VIRTIO_P9_HDR_LEN + sizeof(*rcreate); set_p9msg_hdr(inmsg, *outlen, P9_RCREATE, outmsg->tag); - return true; + return; } -static bool virtio_p9_walk(struct p9_dev *p9dev, +static void virtio_p9_walk(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { u8 i; @@ -378,10 +378,10 @@ static bool virtio_p9_walk(struct p9_dev *p9dev, sizeof(struct p9_qid)*rwalk->nwqid; set_p9msg_hdr(inmsg, *outlen, P9_RWALK, outmsg->tag); - return true; + return; } -static bool virtio_p9_attach(struct p9_dev *p9dev, +static void virtio_p9_attach(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { u32 i; @@ -397,7 +397,7 @@ static bool virtio_p9_attach(struct p9_dev *p9dev, p9dev->fids[i].fid = P9_NOFID; if (lstat(p9dev->root_dir, &st) < 0) - return false; + return; st2qid(&st, &rattach->qid); @@ -409,7 +409,7 @@ static bool virtio_p9_attach(struct p9_dev *p9dev, *outlen = VIRTIO_P9_HDR_LEN + sizeof(*rattach); set_p9msg_hdr(inmsg, *outlen, P9_RATTACH, outmsg->tag); - return true; + return; } static u32 virtio_p9_fill_stat(struct p9_dev *p9dev, const char *name, @@ -452,7 +452,7 @@ static u32 virtio_p9_fill_stat(struct p9_dev *p9dev, const char *name, return rstat->stat.size + sizeof(u16); } -static bool virtio_p9_read(struct p9_dev *p9dev, +static void virtio_p9_read(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { struct p9_msg *inmsg = pdu->in_iov[0].iov_base; @@ -495,10 +495,10 @@ static bool virtio_p9_read(struct p9_dev *p9dev, *outlen = VIRTIO_P9_HDR_LEN + sizeof(u32) + rread->count; set_p9msg_hdr(inmsg, *outlen, P9_RREAD, outmsg->tag); - return true; + return; } -static bool virtio_p9_stat(struct p9_dev *p9dev, +static void virtio_p9_stat(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { u32 ret; @@ -510,16 +510,16 @@ static bool virtio_p9_stat(struct p9_dev *p9dev, struct p9_fid *fid = &p9dev->fids[tstat->fid]; if (lstat(fid->abs_path, &st) < 0) - return false; + return; ret = virtio_p9_fill_stat(p9dev, fid->path, &st, rstat); *outlen = VIRTIO_P9_HDR_LEN + ret + sizeof(u16); set_p9msg_hdr(inmsg, *outlen, P9_RSTAT, outmsg->tag); - return true; + return; } -static bool virtio_p9_wstat(struct p9_dev *p9dev, +static void virtio_p9_wstat(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { int res = 0; @@ -556,10 +556,10 @@ static bool virtio_p9_wstat(struct p9_dev *p9dev, *outlen = VIRTIO_P9_HDR_LEN; set_p9msg_hdr(inmsg, *outlen, P9_RWSTAT, outmsg->tag); - return res == 0; + return; } -static bool virtio_p9_remove(struct p9_dev *p9dev, +static void virtio_p9_remove(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { struct p9_msg *inmsg = pdu->in_iov[0].iov_base; @@ -575,10 +575,10 @@ static bool virtio_p9_remove(struct p9_dev *p9dev, *outlen = VIRTIO_P9_HDR_LEN; set_p9msg_hdr(inmsg, *outlen, P9_RREMOVE, outmsg->tag); - return true; + return; } -static bool virtio_p9_write(struct p9_dev *p9dev, +static void virtio_p9_write(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen) { struct p9_msg *inmsg = pdu->in_iov[0].iov_base; @@ -597,10 +597,10 @@ static bool virtio_p9_write(struct p9_dev *p9dev, *outlen = VIRTIO_P9_HDR_LEN + sizeof(u32); set_p9msg_hdr(inmsg, *outlen, P9_RWRITE, outmsg->tag); - return true; + return; } -typedef bool p9_handler(struct p9_dev *p9dev, +typedef void p9_handler(struct p9_dev *p9dev, struct p9_pdu *pdu, u32 *outlen); static p9_handler *virtio_9p_handler [] = {