From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxUL-0002Dl-TN for qemu-devel@nongnu.org; Fri, 16 Sep 2016 14:03:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkxUI-00004q-G1 for qemu-devel@nongnu.org; Fri, 16 Sep 2016 14:03:49 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxUI-0008W6-7q for qemu-devel@nongnu.org; Fri, 16 Sep 2016 14:03:46 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8GI3JrF099717 for ; Fri, 16 Sep 2016 14:03:45 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 25fr813jh9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 16 Sep 2016 14:03:44 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Sep 2016 19:03:42 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1D46D2190023 for ; Fri, 16 Sep 2016 19:03:00 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8GI3dK84719030 for ; Fri, 16 Sep 2016 18:03:39 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8GI3cA5018003 for ; Fri, 16 Sep 2016 12:03:38 -0600 From: Greg Kurz Date: Fri, 16 Sep 2016 20:03:23 +0200 In-Reply-To: <1474049010-13533-1-git-send-email-groug@kaod.org> References: <1474049010-13533-1-git-send-email-groug@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Message-Id: <1474049010-13533-2-git-send-email-groug@kaod.org> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL v2 1/8] 9pfs: drop unused fmt strings in the proxy backend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , "Aneesh Kumar K.V" , Greg Kurz The v9fs_request() function doesn't use its fmt argument: it passes liter= al format strings to proxy_marshal() for all commands. This patch simply drops the unused fmt argument and updates all callers accordingly. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/9pfs/9p-proxy.c | 67 ++++++++++++++++++++++++------------------------= ------ 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index f265501eac1d..52bbf4f1b37c 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -294,8 +294,7 @@ static int v9fs_receive_status(V9fsProxy *proxy, * This request read by proxy helper process * returns 0 on success and -errno on error */ -static int v9fs_request(V9fsProxy *proxy, int type, - void *response, const char *fmt, ...) +static int v9fs_request(V9fsProxy *proxy, int type, void *response, ...) { dev_t rdev; va_list ap; @@ -317,7 +316,7 @@ static int v9fs_request(V9fsProxy *proxy, int type, } iovec =3D &proxy->out_iovec; reply =3D &proxy->in_iovec; - va_start(ap, fmt); + va_start(ap, response); switch (type) { case T_OPEN: path =3D va_arg(ap, V9fsString *); @@ -605,7 +604,7 @@ close_error: static int proxy_lstat(FsContext *fs_ctx, V9fsPath *fs_path, struct stat= *stbuf) { int retval; - retval =3D v9fs_request(fs_ctx->private, T_LSTAT, stbuf, "s", fs_pat= h); + retval =3D v9fs_request(fs_ctx->private, T_LSTAT, stbuf, fs_path); if (retval < 0) { errno =3D -retval; return -1; @@ -617,8 +616,7 @@ static ssize_t proxy_readlink(FsContext *fs_ctx, V9fs= Path *fs_path, char *buf, size_t bufsz) { int retval; - retval =3D v9fs_request(fs_ctx->private, T_READLINK, buf, "sd", - fs_path, bufsz); + retval =3D v9fs_request(fs_ctx->private, T_READLINK, buf, fs_path, b= ufsz); if (retval < 0) { errno =3D -retval; return -1; @@ -639,7 +637,7 @@ static int proxy_closedir(FsContext *ctx, V9fsFidOpen= State *fs) static int proxy_open(FsContext *ctx, V9fsPath *fs_path, int flags, V9fsFidOpenState *fs) { - fs->fd =3D v9fs_request(ctx->private, T_OPEN, NULL, "sd", fs_path, f= lags); + fs->fd =3D v9fs_request(ctx->private, T_OPEN, NULL, fs_path, flags); if (fs->fd < 0) { errno =3D -fs->fd; fs->fd =3D -1; @@ -653,7 +651,7 @@ static int proxy_opendir(FsContext *ctx, int serrno, fd; =20 fs->dir.stream =3D NULL; - fd =3D v9fs_request(ctx->private, T_OPEN, NULL, "sd", fs_path, O_DIR= ECTORY); + fd =3D v9fs_request(ctx->private, T_OPEN, NULL, fs_path, O_DIRECTORY= ); if (fd < 0) { errno =3D -fd; return -1; @@ -735,8 +733,8 @@ static ssize_t proxy_pwritev(FsContext *ctx, V9fsFidO= penState *fs, static int proxy_chmod(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *cre= dp) { int retval; - retval =3D v9fs_request(fs_ctx->private, T_CHMOD, NULL, "sd", - fs_path, credp->fc_mode); + retval =3D v9fs_request(fs_ctx->private, T_CHMOD, NULL, fs_path, + credp->fc_mode); if (retval < 0) { errno =3D -retval; } @@ -752,8 +750,8 @@ static int proxy_mknod(FsContext *fs_ctx, V9fsPath *d= ir_path, v9fs_string_init(&fullname); v9fs_string_sprintf(&fullname, "%s/%s", dir_path->data, name); =20 - retval =3D v9fs_request(fs_ctx->private, T_MKNOD, NULL, "sdqdd", - &fullname, credp->fc_mode, credp->fc_rdev, + retval =3D v9fs_request(fs_ctx->private, T_MKNOD, NULL, &fullname, + credp->fc_mode, credp->fc_rdev, credp->fc_uid, credp->fc_gid); v9fs_string_free(&fullname); if (retval < 0) { @@ -772,7 +770,7 @@ static int proxy_mkdir(FsContext *fs_ctx, V9fsPath *d= ir_path, v9fs_string_init(&fullname); v9fs_string_sprintf(&fullname, "%s/%s", dir_path->data, name); =20 - retval =3D v9fs_request(fs_ctx->private, T_MKDIR, NULL, "sddd", &ful= lname, + retval =3D v9fs_request(fs_ctx->private, T_MKDIR, NULL, &fullname, credp->fc_mode, credp->fc_uid, credp->fc_gid); v9fs_string_free(&fullname); if (retval < 0) { @@ -804,9 +802,8 @@ static int proxy_open2(FsContext *fs_ctx, V9fsPath *d= ir_path, const char *name, v9fs_string_init(&fullname); v9fs_string_sprintf(&fullname, "%s/%s", dir_path->data, name); =20 - fs->fd =3D v9fs_request(fs_ctx->private, T_CREATE, NULL, "sdddd", - &fullname, flags, credp->fc_mode, - credp->fc_uid, credp->fc_gid); + fs->fd =3D v9fs_request(fs_ctx->private, T_CREATE, NULL, &fullname, = flags, + credp->fc_mode, credp->fc_uid, credp->fc_gid); v9fs_string_free(&fullname); if (fs->fd < 0) { errno =3D -fs->fd; @@ -827,8 +824,8 @@ static int proxy_symlink(FsContext *fs_ctx, const cha= r *oldpath, v9fs_string_sprintf(&fullname, "%s/%s", dir_path->data, name); v9fs_string_sprintf(&target, "%s", oldpath); =20 - retval =3D v9fs_request(fs_ctx->private, T_SYMLINK, NULL, "ssdd", - &target, &fullname, credp->fc_uid, credp->fc_g= id); + retval =3D v9fs_request(fs_ctx->private, T_SYMLINK, NULL, &target, &= fullname, + credp->fc_uid, credp->fc_gid); v9fs_string_free(&fullname); v9fs_string_free(&target); if (retval < 0) { @@ -847,7 +844,7 @@ static int proxy_link(FsContext *ctx, V9fsPath *oldpa= th, v9fs_string_init(&newpath); v9fs_string_sprintf(&newpath, "%s/%s", dirpath->data, name); =20 - retval =3D v9fs_request(ctx->private, T_LINK, NULL, "ss", oldpath, &= newpath); + retval =3D v9fs_request(ctx->private, T_LINK, NULL, oldpath, &newpat= h); v9fs_string_free(&newpath); if (retval < 0) { errno =3D -retval; @@ -860,7 +857,7 @@ static int proxy_truncate(FsContext *ctx, V9fsPath *f= s_path, off_t size) { int retval; =20 - retval =3D v9fs_request(ctx->private, T_TRUNCATE, NULL, "sq", fs_pat= h, size); + retval =3D v9fs_request(ctx->private, T_TRUNCATE, NULL, fs_path, siz= e); if (retval < 0) { errno =3D -retval; return -1; @@ -879,8 +876,7 @@ static int proxy_rename(FsContext *ctx, const char *o= ldpath, =20 v9fs_string_sprintf(&oldname, "%s", oldpath); v9fs_string_sprintf(&newname, "%s", newpath); - retval =3D v9fs_request(ctx->private, T_RENAME, NULL, "ss", - &oldname, &newname); + retval =3D v9fs_request(ctx->private, T_RENAME, NULL, &oldname, &new= name); v9fs_string_free(&oldname); v9fs_string_free(&newname); if (retval < 0) { @@ -892,8 +888,8 @@ static int proxy_rename(FsContext *ctx, const char *o= ldpath, static int proxy_chown(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *cre= dp) { int retval; - retval =3D v9fs_request(fs_ctx->private, T_CHOWN, NULL, "sdd", - fs_path, credp->fc_uid, credp->fc_gid); + retval =3D v9fs_request(fs_ctx->private, T_CHOWN, NULL, fs_path, + credp->fc_uid, credp->fc_gid); if (retval < 0) { errno =3D -retval; } @@ -904,8 +900,7 @@ static int proxy_utimensat(FsContext *s, V9fsPath *fs= _path, const struct timespec *buf) { int retval; - retval =3D v9fs_request(s->private, T_UTIME, NULL, "sqqqq", - fs_path, + retval =3D v9fs_request(s->private, T_UTIME, NULL, fs_path, buf[0].tv_sec, buf[0].tv_nsec, buf[1].tv_sec, buf[1].tv_nsec); if (retval < 0) { @@ -920,7 +915,7 @@ static int proxy_remove(FsContext *ctx, const char *p= ath) V9fsString name; v9fs_string_init(&name); v9fs_string_sprintf(&name, "%s", path); - retval =3D v9fs_request(ctx->private, T_REMOVE, NULL, "s", &name); + retval =3D v9fs_request(ctx->private, T_REMOVE, NULL, &name); v9fs_string_free(&name); if (retval < 0) { errno =3D -retval; @@ -949,7 +944,7 @@ static int proxy_fsync(FsContext *ctx, int fid_type, static int proxy_statfs(FsContext *s, V9fsPath *fs_path, struct statfs *= stbuf) { int retval; - retval =3D v9fs_request(s->private, T_STATFS, stbuf, "s", fs_path); + retval =3D v9fs_request(s->private, T_STATFS, stbuf, fs_path); if (retval < 0) { errno =3D -retval; return -1; @@ -965,8 +960,8 @@ static ssize_t proxy_lgetxattr(FsContext *ctx, V9fsPa= th *fs_path, =20 v9fs_string_init(&xname); v9fs_string_sprintf(&xname, "%s", name); - retval =3D v9fs_request(ctx->private, T_LGETXATTR, value, "dss", siz= e, - fs_path, &xname); + retval =3D v9fs_request(ctx->private, T_LGETXATTR, value, size, fs_p= ath, + &xname); v9fs_string_free(&xname); if (retval < 0) { errno =3D -retval; @@ -978,8 +973,7 @@ static ssize_t proxy_llistxattr(FsContext *ctx, V9fsP= ath *fs_path, void *value, size_t size) { int retval; - retval =3D v9fs_request(ctx->private, T_LLISTXATTR, value, "ds", siz= e, - fs_path); + retval =3D v9fs_request(ctx->private, T_LLISTXATTR, value, size, fs_= path); if (retval < 0) { errno =3D -retval; } @@ -1000,8 +994,8 @@ static int proxy_lsetxattr(FsContext *ctx, V9fsPath = *fs_path, const char *name, xvalue.data =3D g_malloc(size); memcpy(xvalue.data, value, size); =20 - retval =3D v9fs_request(ctx->private, T_LSETXATTR, value, "sssdd", - fs_path, &xname, &xvalue, size, flags); + retval =3D v9fs_request(ctx->private, T_LSETXATTR, value, fs_path, &= xname, + &xvalue, size, flags); v9fs_string_free(&xname); v9fs_string_free(&xvalue); if (retval < 0) { @@ -1018,8 +1012,7 @@ static int proxy_lremovexattr(FsContext *ctx, V9fsP= ath *fs_path, =20 v9fs_string_init(&xname); v9fs_string_sprintf(&xname, "%s", name); - retval =3D v9fs_request(ctx->private, T_LREMOVEXATTR, NULL, "ss", - fs_path, &xname); + retval =3D v9fs_request(ctx->private, T_LREMOVEXATTR, NULL, fs_path,= &xname); v9fs_string_free(&xname); if (retval < 0) { errno =3D -retval; @@ -1086,7 +1079,7 @@ static int proxy_ioc_getversion(FsContext *fs_ctx, = V9fsPath *path, errno =3D ENOTTY; return -1; } - err =3D v9fs_request(fs_ctx->private, T_GETVERSION, st_gen, "s", pat= h); + err =3D v9fs_request(fs_ctx->private, T_GETVERSION, st_gen, path); if (err < 0) { errno =3D -err; err =3D -1; --=20 2.5.5