From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201601980346.32479240257123; Fri, 5 Jan 2018 17:20:01 -0800 (PST) Received: from localhost ([::1]:39906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd9V-0000nH-A3 for importer@patchew.org; Fri, 05 Jan 2018 20:20:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy6-0007Ec-Rm for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy4-0006NY-7P for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:14 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47796 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcy3-0006AV-ST for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:12 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614aDY003784 for ; Fri, 5 Jan 2018 20:07:59 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2faehhnswx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:07:58 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:07:57 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:07:54 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0617sTt54722624; Sat, 6 Jan 2018 01:07:54 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4895A4053; Sat, 6 Jan 2018 01:01:50 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B2F54A404D; Sat, 6 Jan 2018 01:01:50 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:01:50 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 709CA220154; Sat, 6 Jan 2018 02:07:53 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:28 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0040-0000-0000-00000401255B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0041-0000-0000-0000260472B2 Message-Id: <20180106010739.18201-2-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PULL 01/12] virtio-9p: move unrealize/realize after virtio_9p_transport definition X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" And drop the now useless forward declaration of virtio_9p_transport. Signed-off-by: Greg Kurz --- hw/9pfs/virtio-9p-device.c | 60 ++++++++++++++++++++++--------------------= ---- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index 62650b0a6b99..c3ae7de3a2d5 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -20,8 +20,6 @@ #include "hw/virtio/virtio-access.h" #include "qemu/iov.h" =20 -static const struct V9fsTransport virtio_9p_transport; - static void virtio_9p_push_and_notify(V9fsPDU *pdu) { V9fsState *s =3D pdu->s; @@ -104,35 +102,6 @@ static void virtio_9p_get_config(VirtIODevice *vdev, u= int8_t *config) g_free(cfg); } =20 -static void virtio_9p_device_realize(DeviceState *dev, Error **errp) -{ - VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); - V9fsVirtioState *v =3D VIRTIO_9P(dev); - V9fsState *s =3D &v->state; - - if (v9fs_device_realize_common(s, errp)) { - goto out; - } - - v->config_size =3D sizeof(struct virtio_9p_config) + strlen(s->fsconf.= tag); - virtio_init(vdev, "virtio-9p", VIRTIO_ID_9P, v->config_size); - v->vq =3D virtio_add_queue(vdev, MAX_REQ, handle_9p_output); - v9fs_register_transport(s, &virtio_9p_transport); - -out: - return; -} - -static void virtio_9p_device_unrealize(DeviceState *dev, Error **errp) -{ - VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); - V9fsVirtioState *v =3D VIRTIO_9P(dev); - V9fsState *s =3D &v->state; - - virtio_cleanup(vdev); - v9fs_device_unrealize_common(s, errp); -} - static void virtio_9p_reset(VirtIODevice *vdev) { V9fsVirtioState *v =3D (V9fsVirtioState *)vdev; @@ -223,6 +192,35 @@ static const struct V9fsTransport virtio_9p_transport = =3D { .push_and_notify =3D virtio_9p_push_and_notify, }; =20 +static void virtio_9p_device_realize(DeviceState *dev, Error **errp) +{ + VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); + V9fsVirtioState *v =3D VIRTIO_9P(dev); + V9fsState *s =3D &v->state; + + if (v9fs_device_realize_common(s, errp)) { + goto out; + } + + v->config_size =3D sizeof(struct virtio_9p_config) + strlen(s->fsconf.= tag); + virtio_init(vdev, "virtio-9p", VIRTIO_ID_9P, v->config_size); + v->vq =3D virtio_add_queue(vdev, MAX_REQ, handle_9p_output); + v9fs_register_transport(s, &virtio_9p_transport); + +out: + return; +} + +static void virtio_9p_device_unrealize(DeviceState *dev, Error **errp) +{ + VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); + V9fsVirtioState *v =3D VIRTIO_9P(dev); + V9fsState *s =3D &v->state; + + virtio_cleanup(vdev); + v9fs_device_unrealize_common(s, errp); +} + /* virtio-9p device */ =20 static const VMStateDescription vmstate_virtio_9p =3D { --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201016150230.9786132862705; Fri, 5 Jan 2018 17:10:16 -0800 (PST) Received: from localhost ([::1]:39519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd02-00007I-W0 for importer@patchew.org; Fri, 05 Jan 2018 20:10:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy2-0007BM-Bp for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcxz-0006ET-2Y for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:10 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38442) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcxy-0006DN-GK for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:06 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0615fDX118550 for ; Fri, 5 Jan 2018 20:08:05 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fahyumw4j-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:04 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:02 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:00 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0617xJq45023446; Sat, 6 Jan 2018 01:07:59 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A02EAE055; Sat, 6 Jan 2018 01:00:06 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68008AE045; Sat, 6 Jan 2018 01:00:06 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:00:06 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 2654E220154; Sat, 6 Jan 2018 02:07:59 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:29 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0020-0000-0000-000003E70FB4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0021-0000-0000-00004279276B Message-Id: <20180106010739.18201-3-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 02/12] 9pfs: fix XattrOperations typedef X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To comply with the QEMU coding style. Signed-off-by: Greg Kurz --- fsdev/file-op-9p.h | 5 +++-- hw/9pfs/9p-xattr.h | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index 474c79d003f6..05b3ef357462 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -30,7 +30,6 @@ typedef struct FsCred dev_t fc_rdev; } FsCred; =20 -struct xattr_operations; struct FsContext; struct V9fsPath; =20 @@ -67,6 +66,8 @@ typedef struct extended_ops { =20 =20 typedef struct FileOperations FileOperations; +typedef struct XattrOperations XattrOperations; + /* * Structure to store the various fsdev's passed through command line. */ @@ -85,7 +86,7 @@ typedef struct FsContext uid_t uid; char *fs_root; int export_flags; - struct xattr_operations **xops; + XattrOperations **xops; struct extended_ops exops; FsThrottle *fst; /* fs driver specific data */ diff --git a/hw/9pfs/9p-xattr.h b/hw/9pfs/9p-xattr.h index 0d83996575e1..35bcd24f77b1 100644 --- a/hw/9pfs/9p-xattr.h +++ b/hw/9pfs/9p-xattr.h @@ -16,8 +16,7 @@ =20 #include "qemu/xattr.h" =20 -typedef struct xattr_operations -{ +struct XattrOperations { const char *name; ssize_t (*getxattr)(FsContext *ctx, const char *path, const char *name, void *value, size_t size); @@ -27,7 +26,7 @@ typedef struct xattr_operations void *value, size_t size, int flags); int (*removexattr)(FsContext *ctx, const char *path, const char *name); -} XattrOperations; +}; =20 ssize_t local_getxattr_nofollow(FsContext *ctx, const char *path, const char *name, void *value, size_t size= ); --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201017160473.9494366908874; Fri, 5 Jan 2018 17:10:17 -0800 (PST) Received: from localhost ([::1]:39521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd04-00008J-2Z for importer@patchew.org; Fri, 05 Jan 2018 20:10:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy2-0007BP-DY for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcxz-0006EM-1z for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:10 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcxy-0006Cw-GO for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:06 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614eTN115939 for ; Fri, 5 Jan 2018 20:08:04 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fam3y8qkh-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:04 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:02 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:00 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w06180vM38469646; Sat, 6 Jan 2018 01:08:00 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5BFCA4055; Sat, 6 Jan 2018 01:01:56 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D3269A4051; Sat, 6 Jan 2018 01:01:56 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:01:56 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 8F87C2202BB; Sat, 6 Jan 2018 02:07:59 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:30 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0040-0000-0000-00000401255C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0041-0000-0000-0000260472B3 Message-Id: <20180106010739.18201-4-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 03/12] fsdev: fix some type definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To comply with the QEMU coding style. Signed-off-by: Greg Kurz --- fsdev/file-op-9p.h | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index 05b3ef357462..63d19a6dcd0e 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -22,21 +22,19 @@ #define SM_LOCAL_MODE_BITS 0600 #define SM_LOCAL_DIR_MODE_BITS 0700 =20 -typedef struct FsCred -{ +typedef struct FsCred { uid_t fc_uid; gid_t fc_gid; mode_t fc_mode; dev_t fc_rdev; } FsCred; =20 -struct FsContext; -struct V9fsPath; +typedef struct FsContext FsContext; +typedef struct V9fsPath V9fsPath; =20 -typedef struct extended_ops { - int (*get_st_gen)(struct FsContext *, struct V9fsPath *, - mode_t, uint64_t *); -} extended_ops; +typedef struct ExtendedOps { + int (*get_st_gen)(FsContext *, V9fsPath *, mode_t, uint64_t *); +} ExtendedOps; =20 /* export flags */ #define V9FS_IMMEDIATE_WRITEOUT 0x00000001 @@ -81,19 +79,18 @@ typedef struct FsDriverEntry { mode_t dmode; } FsDriverEntry; =20 -typedef struct FsContext -{ +struct FsContext { uid_t uid; char *fs_root; int export_flags; XattrOperations **xops; - struct extended_ops exops; + ExtendedOps exops; FsThrottle *fst; /* fs driver specific data */ void *private; mode_t fmode; mode_t dmode; -} FsContext; +}; =20 typedef struct V9fsPath { uint16_t size; @@ -106,9 +103,9 @@ void cred_init(FsCred *); =20 struct FileOperations { - int (*parse_opts)(QemuOpts *, struct FsDriverEntry *); - int (*init)(struct FsContext *); - void (*cleanup)(struct FsContext *); + int (*parse_opts)(QemuOpts *, FsDriverEntry *); + int (*init)(FsContext *); + void (*cleanup)(FsContext *); int (*lstat)(FsContext *, V9fsPath *, struct stat *); ssize_t (*readlink)(FsContext *, V9fsPath *, char *, size_t); int (*chmod)(FsContext *, V9fsPath *, FsCred *); --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15152011802311014.8385457866391; Fri, 5 Jan 2018 17:13:00 -0800 (PST) Received: from localhost ([::1]:39545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd2h-0002WI-97 for importer@patchew.org; Fri, 05 Jan 2018 20:12:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy2-0007Bm-QK for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcxz-0006F7-I4 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:10 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56784) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcxz-0006Dv-3s for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:07 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0615Afb117626 for ; Fri, 5 Jan 2018 20:08:06 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fam3y8qm1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:05 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:03 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:01 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w06180DM49086684; Sat, 6 Jan 2018 01:08:00 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57221AE045; Sat, 6 Jan 2018 01:00:07 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 44D23AE053; Sat, 6 Jan 2018 01:00:07 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:00:07 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 04B7D220154; Sat, 6 Jan 2018 02:07:59 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:31 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0040-0000-0000-000004212544 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0041-0000-0000-000020C472E6 Message-Id: <20180106010739.18201-5-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 04/12] 9pfs: fix some type definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To comply with the QEMU coding style. Signed-off-by: Greg Kurz --- hw/9pfs/9p.c | 6 +++--- hw/9pfs/9p.h | 12 ++++++------ hw/9pfs/virtio-9p-device.c | 2 +- hw/9pfs/xen-9p-backend.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 52d46632fe15..76f90f2b7863 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -99,10 +99,10 @@ static int omode_to_uflags(int8_t mode) return ret; } =20 -struct dotl_openflag_map { +typedef struct DotlOpenflagMap { int dotl_flag; int open_flag; -}; +} DotlOpenflagMap; =20 static int dotl_to_open_flags(int flags) { @@ -113,7 +113,7 @@ static int dotl_to_open_flags(int flags) */ int oflags =3D flags & O_ACCMODE; =20 - struct dotl_openflag_map dotl_oflag_map[] =3D { + DotlOpenflagMap dotl_oflag_map[] =3D { { P9_DOTL_CREATE, O_CREAT }, { P9_DOTL_EXCL, O_EXCL }, { P9_DOTL_NOCTTY , O_NOCTTY }, diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index cdfc4f4ce787..6e3b48391788 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -94,10 +94,10 @@ enum { P9_QTFILE =3D 0x00, }; =20 -enum p9_proto_version { +typedef enum P9ProtoVersion { V9FS_PROTO_2000U =3D 0x01, V9FS_PROTO_2000L =3D 0x02, -}; +} P9ProtoVersion; =20 #define P9_NOTAG UINT16_MAX #define P9_NOFID UINT32_MAX @@ -118,6 +118,7 @@ static inline char *rpath(FsContext *ctx, const char *p= ath) =20 typedef struct V9fsPDU V9fsPDU; typedef struct V9fsState V9fsState; +typedef struct V9fsTransport V9fsTransport; =20 typedef struct { uint32_t size_le; @@ -238,10 +239,10 @@ struct V9fsState FileOperations *ops; FsContext ctx; char *tag; - enum p9_proto_version proto_version; + P9ProtoVersion proto_version; int32_t msize; V9fsPDU pdus[MAX_REQ]; - const struct V9fsTransport *transport; + const V9fsTransport *transport; /* * lock ensuring atomic path update * on rename. @@ -367,8 +368,7 @@ struct V9fsTransport { void (*push_and_notify)(V9fsPDU *pdu); }; =20 -static inline int v9fs_register_transport(V9fsState *s, - const struct V9fsTransport *t) +static inline int v9fs_register_transport(V9fsState *s, const V9fsTranspor= t *t) { assert(!s->transport); s->transport =3D t; diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index c3ae7de3a2d5..43f4e53f336f 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -184,7 +184,7 @@ static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, = struct iovec **piov, *pniov =3D elem->out_num; } =20 -static const struct V9fsTransport virtio_9p_transport =3D { +static const V9fsTransport virtio_9p_transport =3D { .pdu_vmarshal =3D virtio_pdu_vmarshal, .pdu_vunmarshal =3D virtio_pdu_vunmarshal, .init_in_iov_from_pdu =3D virtio_init_in_iov_from_pdu, diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index ee87f08926a2..df2a4100bf55 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -233,7 +233,7 @@ static void xen_9pfs_push_and_notify(V9fsPDU *pdu) qemu_bh_schedule(ring->bh); } =20 -static const struct V9fsTransport xen_9p_transport =3D { +static const V9fsTransport xen_9p_transport =3D { .pdu_vmarshal =3D xen_9pfs_pdu_vmarshal, .pdu_vunmarshal =3D xen_9pfs_pdu_vunmarshal, .init_in_iov_from_pdu =3D xen_9pfs_init_in_iov_from_pdu, --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201185973333.7643149316111; Fri, 5 Jan 2018 17:13:05 -0800 (PST) Received: from localhost ([::1]:39547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd2n-0002aD-22 for importer@patchew.org; Fri, 05 Jan 2018 20:13:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy3-0007Cd-SA for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy0-0006Fl-8A for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:11 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49704) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcxz-0006Es-V9 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:08 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w06156oN052542 for ; Fri, 5 Jan 2018 20:08:07 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fajpmb9wx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:06 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:03 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:01 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w06181om21823558; Sat, 6 Jan 2018 01:08:01 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E15774C04E; Sat, 6 Jan 2018 01:02:22 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C51234C040; Sat, 6 Jan 2018 01:02:22 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:02:22 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 6B9DB2202BB; Sat, 6 Jan 2018 02:08:00 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:32 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0020-0000-0000-000003E70FB5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0021-0000-0000-00004279276D Message-Id: <20180106010739.18201-6-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 05/12] 9pfs: handle: fix type definition X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To comply with the QEMU coding style. Signed-off-by: Greg Kurz --- hw/9pfs/9p-handle.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/hw/9pfs/9p-handle.c b/hw/9pfs/9p-handle.c index 9875f1894cc5..65b12de230c1 100644 --- a/hw/9pfs/9p-handle.c +++ b/hw/9pfs/9p-handle.c @@ -41,10 +41,10 @@ #define BTRFS_SUPER_MAGIC 0x9123683E #endif =20 -struct handle_data { +typedef struct HandleData { int mountfd; int handle_bytes; -}; +} HandleData; =20 static inline int name_to_handle(int dirfd, const char *name, struct file_handle *fh, int *mnt_id, int = flags) @@ -79,7 +79,7 @@ static int handle_lstat(FsContext *fs_ctx, V9fsPath *fs_p= ath, struct stat *stbuf) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)fs_ctx->private; + HandleData *data =3D (HandleData *) fs_ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_PATH); if (fd < 0) { @@ -94,7 +94,7 @@ static ssize_t handle_readlink(FsContext *fs_ctx, V9fsPat= h *fs_path, char *buf, size_t bufsz) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)fs_ctx->private; + HandleData *data =3D (HandleData *) fs_ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_PATH); if (fd < 0) { @@ -118,7 +118,7 @@ static int handle_closedir(FsContext *ctx, V9fsFidOpenS= tate *fs) static int handle_open(FsContext *ctx, V9fsPath *fs_path, int flags, V9fsFidOpenState *fs) { - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 fs->fd =3D open_by_handle(data->mountfd, fs_path->data, flags); return fs->fd; @@ -207,7 +207,7 @@ static ssize_t handle_pwritev(FsContext *ctx, V9fsFidOp= enState *fs, static int handle_chmod(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *cred= p) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)fs_ctx->private; + HandleData *data =3D (HandleData *) fs_ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { @@ -222,7 +222,7 @@ static int handle_mknod(FsContext *fs_ctx, V9fsPath *di= r_path, const char *name, FsCred *credp) { int dirfd, ret; - struct handle_data *data =3D (struct handle_data *)fs_ctx->private; + HandleData *data =3D (HandleData *) fs_ctx->private; =20 dirfd =3D open_by_handle(data->mountfd, dir_path->data, O_PATH); if (dirfd < 0) { @@ -240,7 +240,7 @@ static int handle_mkdir(FsContext *fs_ctx, V9fsPath *di= r_path, const char *name, FsCred *credp) { int dirfd, ret; - struct handle_data *data =3D (struct handle_data *)fs_ctx->private; + HandleData *data =3D (HandleData *) fs_ctx->private; =20 dirfd =3D open_by_handle(data->mountfd, dir_path->data, O_PATH); if (dirfd < 0) { @@ -272,7 +272,7 @@ static int handle_open2(FsContext *fs_ctx, V9fsPath *di= r_path, const char *name, { int ret; int dirfd, fd; - struct handle_data *data =3D (struct handle_data *)fs_ctx->private; + HandleData *data =3D (HandleData *) fs_ctx->private; =20 dirfd =3D open_by_handle(data->mountfd, dir_path->data, O_PATH); if (dirfd < 0) { @@ -297,7 +297,7 @@ static int handle_symlink(FsContext *fs_ctx, const char= *oldpath, V9fsPath *dir_path, const char *name, FsCred *cr= edp) { int fd, dirfd, ret; - struct handle_data *data =3D (struct handle_data *)fs_ctx->private; + HandleData *data =3D (HandleData *) fs_ctx->private; =20 dirfd =3D open_by_handle(data->mountfd, dir_path->data, O_PATH); if (dirfd < 0) { @@ -322,7 +322,7 @@ static int handle_link(FsContext *ctx, V9fsPath *oldpat= h, V9fsPath *dirpath, const char *name) { int oldfd, newdirfd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 oldfd =3D open_by_handle(data->mountfd, oldpath->data, O_PATH); if (oldfd < 0) { @@ -342,7 +342,7 @@ static int handle_link(FsContext *ctx, V9fsPath *oldpat= h, static int handle_truncate(FsContext *ctx, V9fsPath *fs_path, off_t size) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK | O_WRO= NLY); if (fd < 0) { @@ -363,7 +363,7 @@ static int handle_rename(FsContext *ctx, const char *ol= dpath, static int handle_chown(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *cred= p) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)fs_ctx->private; + HandleData *data =3D (HandleData *) fs_ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_PATH); if (fd < 0) { @@ -379,7 +379,7 @@ static int handle_utimensat(FsContext *ctx, V9fsPath *f= s_path, { int ret; int fd; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { @@ -418,7 +418,7 @@ static int handle_statfs(FsContext *ctx, V9fsPath *fs_p= ath, struct statfs *stbuf) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { @@ -433,7 +433,7 @@ static ssize_t handle_lgetxattr(FsContext *ctx, V9fsPat= h *fs_path, const char *name, void *value, size_t size) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { @@ -448,7 +448,7 @@ static ssize_t handle_llistxattr(FsContext *ctx, V9fsPa= th *fs_path, void *value, size_t size) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { @@ -463,7 +463,7 @@ static int handle_lsetxattr(FsContext *ctx, V9fsPath *f= s_path, const char *name, void *value, size_t size, int flags) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { @@ -478,7 +478,7 @@ static int handle_lremovexattr(FsContext *ctx, V9fsPath= *fs_path, const char *name) { int fd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 fd =3D open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK); if (fd < 0) { @@ -495,7 +495,7 @@ static int handle_name_to_path(FsContext *ctx, V9fsPath= *dir_path, char *buffer; struct file_handle *fh; int dirfd, ret, mnt_id; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 /* "." and ".." are not allowed */ if (!strcmp(name, ".") || !strcmp(name, "..")) { @@ -536,7 +536,7 @@ static int handle_renameat(FsContext *ctx, V9fsPath *ol= ddir, const char *new_name) { int olddirfd, newdirfd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; =20 olddirfd =3D open_by_handle(data->mountfd, olddir->data, O_PATH); if (olddirfd < 0) { @@ -557,7 +557,7 @@ static int handle_unlinkat(FsContext *ctx, V9fsPath *di= r, const char *name, int flags) { int dirfd, ret; - struct handle_data *data =3D (struct handle_data *)ctx->private; + HandleData *data =3D (HandleData *) ctx->private; int rflags; =20 dirfd =3D open_by_handle(data->mountfd, dir->data, O_PATH); @@ -609,7 +609,7 @@ static int handle_init(FsContext *ctx) int ret, mnt_id; struct statfs stbuf; struct file_handle fh; - struct handle_data *data =3D g_malloc(sizeof(struct handle_data)); + HandleData *data =3D g_malloc(sizeof(HandleData)); =20 data->mountfd =3D open(ctx->fs_root, O_DIRECTORY); if (data->mountfd < 0) { @@ -646,7 +646,7 @@ out: =20 static void handle_cleanup(FsContext *ctx) { - struct handle_data *data =3D ctx->private; + HandleData *data =3D ctx->private; =20 close(data->mountfd); g_free(data); --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201213336220.477844538893; Fri, 5 Jan 2018 17:13:33 -0800 (PST) Received: from localhost ([::1]:39548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd3E-00030a-HB for importer@patchew.org; Fri, 05 Jan 2018 20:13:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy4-0007DZ-Sl for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy1-0006HF-Fg for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:12 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcy0-0006FZ-OH for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:09 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614Z4W007579 for ; Fri, 5 Jan 2018 20:08:05 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fam0egw79-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:05 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:03 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:01 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w06181vh66912284; Sat, 6 Jan 2018 01:08:01 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D0D5F52045; Sat, 6 Jan 2018 00:00:42 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id C94B352041; Sat, 6 Jan 2018 00:00:42 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id D34C8220154; Sat, 6 Jan 2018 02:08:00 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:33 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0020-0000-0000-000003E70FB6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0021-0000-0000-00004279276E Message-Id: <20180106010739.18201-7-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 06/12] 9pfs: fix type in *_parse_opts declarations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To comply with the QEMU coding style. Signed-off-by: Greg Kurz Reviewed-by: Eric Blake --- hw/9pfs/9p-handle.c | 2 +- hw/9pfs/9p-local.c | 2 +- hw/9pfs/9p-proxy.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p-handle.c b/hw/9pfs/9p-handle.c index 65b12de230c1..26ac90fc5ce3 100644 --- a/hw/9pfs/9p-handle.c +++ b/hw/9pfs/9p-handle.c @@ -652,7 +652,7 @@ static void handle_cleanup(FsContext *ctx) g_free(data); } =20 -static int handle_parse_opts(QemuOpts *opts, struct FsDriverEntry *fse) +static int handle_parse_opts(QemuOpts *opts, FsDriverEntry *fse) { const char *sec_model =3D qemu_opt_get(opts, "security_model"); const char *path =3D qemu_opt_get(opts, "path"); diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index e51af87309c6..155834db28e1 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1459,7 +1459,7 @@ static void local_cleanup(FsContext *ctx) g_free(data); } =20 -static int local_parse_opts(QemuOpts *opts, struct FsDriverEntry *fse) +static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse) { const char *sec_model =3D qemu_opt_get(opts, "security_model"); const char *path =3D qemu_opt_get(opts, "path"); diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index 28b20a7c3dfa..652940726e72 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -1111,7 +1111,7 @@ static int connect_namedsocket(const char *path) return sockfd; } =20 -static int proxy_parse_opts(QemuOpts *opts, struct FsDriverEntry *fs) +static int proxy_parse_opts(QemuOpts *opts, FsDriverEntry *fs) { const char *socket =3D qemu_opt_get(opts, "socket"); const char *sock_fd =3D qemu_opt_get(opts, "sock_fd"); --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201504863381.95300720079445; Fri, 5 Jan 2018 17:18:24 -0800 (PST) Received: from localhost ([::1]:39756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd7w-00080m-3y for importer@patchew.org; Fri, 05 Jan 2018 20:18:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy4-0007DX-Rc for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy1-0006H8-FS for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:12 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46264 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcy0-0006GG-SD for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:09 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614YJp063040 for ; Fri, 5 Jan 2018 20:08:06 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fajpm32tv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:05 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:04 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:02 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w06181RA49348800; Sat, 6 Jan 2018 01:08:01 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC0CA11C04A; Sat, 6 Jan 2018 01:01:57 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9A2C511C04C; Sat, 6 Jan 2018 01:01:57 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:01:57 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 46FBC2202BB; Sat, 6 Jan 2018 02:08:01 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:34 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0040-0000-0000-000004212545 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0041-0000-0000-000020C472E7 Message-Id: <20180106010739.18201-8-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PULL 07/12] 9pfs: fix error path in pdu_submit() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If we receive an unsupported request id, we first decide to return -ENOTSUPP to the client, but since the request id causes is_read_only_op() to return false, we change the error to be -EROFS if the fsdev is read-only. This doesn't make sense since we don't know what the client asked for. This patch ensures that -EROFS can only be returned if the request id is supported. Signed-off-by: Greg Kurz Reviewed-by: Eric Blake --- hw/9pfs/9p.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 76f90f2b7863..558efb41defd 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3473,14 +3473,12 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr) if (pdu->id >=3D ARRAY_SIZE(pdu_co_handlers) || (pdu_co_handlers[pdu->id] =3D=3D NULL)) { handler =3D v9fs_op_not_supp; + } else if (is_ro_export(&s->ctx) && !is_read_only_op(pdu)) { + handler =3D v9fs_fs_ro; } else { handler =3D pdu_co_handlers[pdu->id]; } =20 - if (is_ro_export(&s->ctx) && !is_read_only_op(pdu)) { - handler =3D v9fs_fs_ro; - } - qemu_co_queue_init(&pdu->complete); co =3D qemu_coroutine_create(handler, pdu); qemu_coroutine_enter(co); --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201499872638.9294985047155; Fri, 5 Jan 2018 17:18:19 -0800 (PST) Received: from localhost ([::1]:39740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd7r-0007vW-2c for importer@patchew.org; Fri, 05 Jan 2018 20:18:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy4-0007Da-TX for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy3-0006Lf-AO for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:12 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44414 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcy3-0006KG-1L for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:11 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614bGF010086 for ; Fri, 5 Jan 2018 20:08:07 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fah5kpjpv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:07 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:05 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:02 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w06182xn49807444; Sat, 6 Jan 2018 01:08:02 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1CD83A404D; Sat, 6 Jan 2018 01:01:59 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09D83A4040; Sat, 6 Jan 2018 01:01:59 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:01:59 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id BA631220154; Sat, 6 Jan 2018 02:08:01 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:35 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0020-0000-0000-000003E70FB7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0021-0000-0000-00004279276F Message-Id: <20180106010739.18201-9-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PULL 08/12] 9pfs: make pdu_marshal() and pdu_unmarshal() static functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" They're only used by the 9p core code. Signed-off-by: Greg Kurz Reviewed-by: Eric Blake --- hw/9pfs/9p.c | 4 ++-- hw/9pfs/9p.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 558efb41defd..1e4ebbe57687 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -41,7 +41,7 @@ enum { Oappend =3D 0x80, }; =20 -ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...) +static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, .= ..) { ssize_t ret; va_list ap; @@ -53,7 +53,7 @@ ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const ch= ar *fmt, ...) return ret; } =20 -ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...) +static ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt,= ...) { ssize_t ret; va_list ap; diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index 6e3b48391788..ffe658ab8975 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -349,8 +349,6 @@ int v9fs_name_to_path(V9fsState *s, V9fsPath *dirpath, int v9fs_device_realize_common(V9fsState *s, Error **errp); void v9fs_device_unrealize_common(V9fsState *s, Error **errp); =20 -ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...); -ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...); V9fsPDU *pdu_alloc(V9fsState *s); void pdu_free(V9fsPDU *pdu); void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr); --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201180755397.71147892053875; Fri, 5 Jan 2018 17:13:00 -0800 (PST) Received: from localhost ([::1]:39546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd2h-0002XD-Sn for importer@patchew.org; Fri, 05 Jan 2018 20:12:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy4-0007DM-NR for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy1-0006H4-FS for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:12 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcy0-0006Fa-Nr for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:09 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614Ywf007529 for ; Fri, 5 Jan 2018 20:08:08 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fam0egw88-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:07 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:05 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:03 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w061824w49807452; Sat, 6 Jan 2018 01:08:02 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 855B2A404D; Sat, 6 Jan 2018 01:01:59 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 734D7A4040; Sat, 6 Jan 2018 01:01:59 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:01:59 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 2F7042202BB; Sat, 6 Jan 2018 02:08:02 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:36 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0012-0000-0000-000005A01BDB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0013-0000-0000-0000191B6F55 Message-Id: <20180106010739.18201-10-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 09/12] tests: virtio-9p: fix ISR dependence X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Like other virtio tests, use the used ring APIs instead of assuming ISR being set means the request has completed. Signed-off-by: Greg Kurz Reviewed-by: Stefan Hajnoczi --- tests/virtio-9p-test.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c index ad33d963876f..ebd24b20f657 100644 --- a/tests/virtio-9p-test.c +++ b/tests/virtio-9p-test.c @@ -18,6 +18,8 @@ #include "standard-headers/linux/virtio_pci.h" #include "hw/9pfs/9p.h" =20 +#define QVIRTIO_9P_TIMEOUT_US (10 * 1000 * 1000) + static const char mount_tag[] =3D "qtest"; =20 typedef struct { @@ -111,6 +113,7 @@ typedef struct { /* No r_size, it is hardcoded to P9_MAX_SIZE */ size_t t_off; size_t r_off; + uint32_t free_head; } P9Req; =20 static void v9fs_memwrite(P9Req *req, const void *addr, size_t len) @@ -124,11 +127,6 @@ static void v9fs_memskip(P9Req *req, size_t len) req->r_off +=3D len; } =20 -static void v9fs_memrewind(P9Req *req, size_t len) -{ - req->r_off -=3D len; -} - static void v9fs_memread(P9Req *req, void *addr, size_t len) { memread(req->r_msg + req->r_off, addr, len); @@ -227,12 +225,12 @@ static P9Req *v9fs_req_init(QVirtIO9P *v9p, uint32_t = size, uint8_t id, static void v9fs_req_send(P9Req *req) { QVirtIO9P *v9p =3D req->v9p; - uint32_t free_head; =20 req->r_msg =3D guest_alloc(v9p->qs->alloc, P9_MAX_SIZE); - free_head =3D qvirtqueue_add(v9p->vq, req->t_msg, req->t_size, false, = true); + req->free_head =3D qvirtqueue_add(v9p->vq, req->t_msg, req->t_size, fa= lse, + true); qvirtqueue_add(v9p->vq, req->r_msg, P9_MAX_SIZE, true, false); - qvirtqueue_kick(v9p->dev, v9p->vq, free_head); + qvirtqueue_kick(v9p->dev, v9p->vq, req->free_head); req->t_off =3D 0; } =20 @@ -250,19 +248,13 @@ static void v9fs_req_recv(P9Req *req, uint8_t id) { QVirtIO9P *v9p =3D req->v9p; P9Hdr hdr; - int i; =20 - for (i =3D 0; i < 10; i++) { - qvirtio_wait_queue_isr(v9p->dev, v9p->vq, 1000 * 1000); + qvirtio_wait_used_elem(v9p->dev, v9p->vq, req->free_head, + QVIRTIO_9P_TIMEOUT_US); =20 - v9fs_memread(req, &hdr, 7); - hdr.size =3D ldl_le_p(&hdr.size); - hdr.tag =3D lduw_le_p(&hdr.tag); - if (hdr.size >=3D 7) { - break; - } - v9fs_memrewind(req, 7); - } + v9fs_memread(req, &hdr, 7); + hdr.size =3D ldl_le_p(&hdr.size); + hdr.tag =3D lduw_le_p(&hdr.tag); =20 g_assert_cmpint(hdr.size, >=3D, 7); g_assert_cmpint(hdr.size, <=3D, P9_MAX_SIZE); --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201336809921.438015824173; Fri, 5 Jan 2018 17:15:36 -0800 (PST) Received: from localhost ([::1]:39617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd59-00055W-9O for importer@patchew.org; Fri, 05 Jan 2018 20:15:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy3-0007Ce-Sv for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy0-0006Ft-CL for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:11 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48272 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcy0-0006FK-59 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:08 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614ZgS003691 for ; Fri, 5 Jan 2018 20:08:07 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2faehhnt1h-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:07 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:05 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:03 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w06183Qg1638676; Sat, 6 Jan 2018 01:08:03 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1825F4C044; Sat, 6 Jan 2018 01:02:25 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0655B4C040; Sat, 6 Jan 2018 01:02:25 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:02:24 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 9886F220154; Sat, 6 Jan 2018 02:08:02 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:37 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0012-0000-0000-000005A01BDC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0013-0000-0000-0000191B6F56 Message-Id: <20180106010739.18201-11-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PULL 10/12] tests: virtio-9p: set DRIVER_OK before using the device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Greg Kurz --- tests/virtio-9p-test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c index ebd24b20f657..00f00f7246e9 100644 --- a/tests/virtio-9p-test.c +++ b/tests/virtio-9p-test.c @@ -75,6 +75,9 @@ static QVirtIO9P *qvirtio_9p_pci_start(void) qvirtio_set_driver(v9p->dev); =20 v9p->vq =3D qvirtqueue_setup(v9p->dev, v9p->qs->alloc, 0); + + qvirtio_set_driver_ok(v9p->dev); + return v9p; } =20 --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201369113866.8783615571459; Fri, 5 Jan 2018 17:16:09 -0800 (PST) Received: from localhost ([::1]:39632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd5h-0005fj-1F for importer@patchew.org; Fri, 05 Jan 2018 20:16:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy6-0007Ef-V0 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy3-0006Lp-A4 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:14 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45674 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcy3-0006K5-1P for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:11 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614Zd1007286 for ; Fri, 5 Jan 2018 20:08:08 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fak5jabm1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:07 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:06 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:04 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w061834f64487654; Sat, 6 Jan 2018 01:08:03 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D140442045; Sat, 6 Jan 2018 01:01:45 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BEB9942041; Sat, 6 Jan 2018 01:01:45 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:01:45 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 14FA22202BB; Sat, 6 Jan 2018 02:08:03 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:38 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0040-0000-0000-00000401255E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0041-0000-0000-0000260472B4 Message-Id: <20180106010739.18201-12-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PULL 11/12] fsdev: improve error handling of backend opts parsing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch changes some error messages in the backend opts parsing code and convert backends to propagate QEMU Error objects instead of calling error_report(). Signed-off-by: Greg Kurz --- fsdev/file-op-9p.h | 2 +- fsdev/qemu-fsdev.c | 4 +++- hw/9pfs/9p-handle.c | 2 +- hw/9pfs/9p-local.c | 33 +++++++++++++++++++-------------- hw/9pfs/9p-proxy.c | 16 +++++++++++++--- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index 63d19a6dcd0e..e7f9e1872129 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -103,7 +103,7 @@ void cred_init(FsCred *); =20 struct FileOperations { - int (*parse_opts)(QemuOpts *, FsDriverEntry *); + int (*parse_opts)(QemuOpts *, FsDriverEntry *, Error **errp); int (*init)(FsContext *); void (*cleanup)(FsContext *); int (*lstat)(FsContext *, V9fsPath *, struct stat *); diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c index 266e442b871a..941e3096574e 100644 --- a/fsdev/qemu-fsdev.c +++ b/fsdev/qemu-fsdev.c @@ -37,6 +37,7 @@ int qemu_fsdev_add(QemuOpts *opts) const char *fsdriver =3D qemu_opt_get(opts, "fsdriver"); const char *writeout =3D qemu_opt_get(opts, "writeout"); bool ro =3D qemu_opt_get_bool(opts, "readonly", 0); + Error *local_err =3D NULL; =20 if (!fsdev_id) { error_report("fsdev: No id specified"); @@ -74,7 +75,8 @@ int qemu_fsdev_add(QemuOpts *opts) } =20 if (fsle->fse.ops->parse_opts) { - if (fsle->fse.ops->parse_opts(opts, &fsle->fse)) { + if (fsle->fse.ops->parse_opts(opts, &fsle->fse, &local_err)) { + error_report_err(local_err); g_free(fsle->fse.fsdev_id); g_free(fsle); return -1; diff --git a/hw/9pfs/9p-handle.c b/hw/9pfs/9p-handle.c index 26ac90fc5ce3..e50941075bda 100644 --- a/hw/9pfs/9p-handle.c +++ b/hw/9pfs/9p-handle.c @@ -652,7 +652,7 @@ static void handle_cleanup(FsContext *ctx) g_free(data); } =20 -static int handle_parse_opts(QemuOpts *opts, FsDriverEntry *fse) +static int handle_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **e= rrp) { const char *sec_model =3D qemu_opt_get(opts, "security_model"); const char *path =3D qemu_opt_get(opts, "path"); diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 155834db28e1..e1a4b844a527 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1459,16 +1459,21 @@ static void local_cleanup(FsContext *ctx) g_free(data); } =20 -static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse) +static void error_append_security_model_hint(Error **errp) +{ + error_append_hint(errp, "Valid options are: security_model=3D" + "[passthrough|mapped-xattr|mapped-file|none]\n"); +} + +static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **er= rp) { const char *sec_model =3D qemu_opt_get(opts, "security_model"); const char *path =3D qemu_opt_get(opts, "path"); - Error *err =3D NULL; + Error *local_err =3D NULL; =20 if (!sec_model) { - error_report("Security model not specified, local fs needs securit= y model"); - error_printf("valid options are:" - "\tsecurity_model=3D[passthrough|mapped-xattr|mapped-= file|none]\n"); + error_setg(errp, "security_model property not set"); + error_append_security_model_hint(errp); return -1; } =20 @@ -1482,20 +1487,20 @@ static int local_parse_opts(QemuOpts *opts, FsDrive= rEntry *fse) } else if (!strcmp(sec_model, "mapped-file")) { fse->export_flags |=3D V9FS_SM_MAPPED_FILE; } else { - error_report("Invalid security model %s specified", sec_model); - error_printf("valid options are:" - "\t[passthrough|mapped-xattr|mapped-file|none]\n"); + error_setg(errp, "invalid security_model property '%s'", sec_model= ); + error_append_security_model_hint(errp); return -1; } =20 if (!path) { - error_report("fsdev: No path specified"); + error_setg(errp, "path property not set"); return -1; } =20 - fsdev_throttle_parse_opts(opts, &fse->fst, &err); - if (err) { - error_reportf_err(err, "Throttle configuration is not valid: "); + fsdev_throttle_parse_opts(opts, &fse->fst, &local_err); + if (local_err) { + error_propagate(errp, local_err); + error_prepend(errp, "invalid throttle configuration: "); return -1; } =20 @@ -1507,11 +1512,11 @@ static int local_parse_opts(QemuOpts *opts, FsDrive= rEntry *fse) qemu_opt_get_number(opts, "dmode", SM_LOCAL_DIR_MODE_BITS) & 0= 777; } else { if (qemu_opt_find(opts, "fmode")) { - error_report("fmode is only valid for mapped 9p modes"); + error_setg(errp, "fmode is only valid for mapped security mode= s"); return -1; } if (qemu_opt_find(opts, "dmode")) { - error_report("dmode is only valid for mapped 9p modes"); + error_setg(errp, "dmode is only valid for mapped security mode= s"); return -1; } } diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index 652940726e72..f6fb7a408fd1 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -1111,17 +1111,27 @@ static int connect_namedsocket(const char *path) return sockfd; } =20 -static int proxy_parse_opts(QemuOpts *opts, FsDriverEntry *fs) +static void error_append_socket_sockfd_hint(Error **errp) +{ + error_append_hint(errp, "Either specify socket=3D/some/path where /som= e/path" + " points to a listening AF_UNIX socket or sock_fd=3D= fd" + " where fd is a file descriptor to a connected AF_UN= IX" + " socket\n"); +} + +static int proxy_parse_opts(QemuOpts *opts, FsDriverEntry *fs, Error **err= p) { const char *socket =3D qemu_opt_get(opts, "socket"); const char *sock_fd =3D qemu_opt_get(opts, "sock_fd"); =20 if (!socket && !sock_fd) { - error_report("Must specify either socket or sock_fd"); + error_setg(errp, "both socket and sock_fd properties are missing"); + error_append_socket_sockfd_hint(errp); return -1; } if (socket && sock_fd) { - error_report("Both socket and sock_fd options specified"); + error_setg(errp, "both socket and sock_fd properties are set"); + error_append_socket_sockfd_hint(errp); return -1; } if (socket) { --=20 2.13.6 From nobody Tue Oct 28 01:56:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515201339673691.2163701596579; Fri, 5 Jan 2018 17:15:39 -0800 (PST) Received: from localhost ([::1]:39625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXd5G-0005By-MK for importer@patchew.org; Fri, 05 Jan 2018 20:15:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXcy5-0007Dt-25 for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXcy3-0006LT-7v for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:12 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50336) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXcy2-0006Im-SM for qemu-devel@nongnu.org; Fri, 05 Jan 2018 20:08:11 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0614a8v051203 for ; Fri, 5 Jan 2018 20:08:10 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fajpmba04-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Jan 2018 20:08:09 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jan 2018 01:08:07 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 6 Jan 2018 01:08:04 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w06184qf49742014; Sat, 6 Jan 2018 01:08:04 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 474C14203F; Sat, 6 Jan 2018 01:01:46 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3393A42049; Sat, 6 Jan 2018 01:01:46 +0000 (GMT) Received: from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 6 Jan 2018 01:01:46 +0000 (GMT) Received: from bahia.lan (icon-9-164-172-212.megacenter.de.ibm.com [9.164.172.212]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 7E41A220154; Sat, 6 Jan 2018 02:08:03 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 02:07:39 +0100 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180106010739.18201-1-groug@kaod.org> References: <20180106010739.18201-1-groug@kaod.org> X-TM-AS-GCONF: 00 x-cbid: 18010601-0040-0000-0000-000004212548 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010601-0041-0000-0000-000020C472EA Message-Id: <20180106010739.18201-13-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-05_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801060011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 12/12] fsdev: improve error handling of backend init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch changes some error messages in the backend init code and convert backends to propagate QEMU Error objects instead of calling error_report(). One notable improvement is that the local backend now provides a more detailed error report when it fails to open the shared directory. Signed-off-by: Greg Kurz --- fsdev/file-op-9p.h | 2 +- hw/9pfs/9p-handle.c | 2 +- hw/9pfs/9p-local.c | 3 ++- hw/9pfs/9p-proxy.c | 14 +++++++------- hw/9pfs/9p-synth.c | 2 +- hw/9pfs/9p.c | 6 +++--- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index e7f9e1872129..f871c963eecb 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -104,7 +104,7 @@ void cred_init(FsCred *); struct FileOperations { int (*parse_opts)(QemuOpts *, FsDriverEntry *, Error **errp); - int (*init)(FsContext *); + int (*init)(FsContext *, Error **errp); void (*cleanup)(FsContext *); int (*lstat)(FsContext *, V9fsPath *, struct stat *); ssize_t (*readlink)(FsContext *, V9fsPath *, char *, size_t); diff --git a/hw/9pfs/9p-handle.c b/hw/9pfs/9p-handle.c index e50941075bda..c5adfe6f3a96 100644 --- a/hw/9pfs/9p-handle.c +++ b/hw/9pfs/9p-handle.c @@ -604,7 +604,7 @@ static int handle_ioc_getversion(FsContext *ctx, V9fsPa= th *path, #endif } =20 -static int handle_init(FsContext *ctx) +static int handle_init(FsContext *ctx, Error **errp) { int ret, mnt_id; struct statfs stbuf; diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index e1a4b844a527..b25c185ff030 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1400,13 +1400,14 @@ static int local_ioc_getversion(FsContext *ctx, V9f= sPath *path, #endif } =20 -static int local_init(FsContext *ctx) +static int local_init(FsContext *ctx, Error **errp) { struct statfs stbuf; LocalData *data =3D g_malloc(sizeof(*data)); =20 data->mountfd =3D open(ctx->fs_root, O_DIRECTORY | O_RDONLY); if (data->mountfd =3D=3D -1) { + error_setg_errno(errp, errno, "failed to open '%s'", ctx->fs_root); goto err; } =20 diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index f6fb7a408fd1..f030c6a42844 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -1083,25 +1083,25 @@ static int proxy_ioc_getversion(FsContext *fs_ctx, = V9fsPath *path, return err; } =20 -static int connect_namedsocket(const char *path) +static int connect_namedsocket(const char *path, Error **errp) { int sockfd, size; struct sockaddr_un helper; =20 if (strlen(path) >=3D sizeof(helper.sun_path)) { - error_report("Socket name too long"); + error_setg(errp, "socket name too long"); return -1; } sockfd =3D socket(AF_UNIX, SOCK_STREAM, 0); if (sockfd < 0) { - error_report("Failed to create socket: %s", strerror(errno)); + error_setg_errno(errp, errno, "failed to create client socket"); return -1; } strcpy(helper.sun_path, path); helper.sun_family =3D AF_UNIX; size =3D strlen(helper.sun_path) + sizeof(helper.sun_family); if (connect(sockfd, (struct sockaddr *)&helper, size) < 0) { - error_report("Failed to connect to %s: %s", path, strerror(errno)); + error_setg_errno(errp, errno, "failed to connect to '%s'", path); close(sockfd); return -1; } @@ -1144,17 +1144,17 @@ static int proxy_parse_opts(QemuOpts *opts, FsDrive= rEntry *fs, Error **errp) return 0; } =20 -static int proxy_init(FsContext *ctx) +static int proxy_init(FsContext *ctx, Error **errp) { V9fsProxy *proxy =3D g_malloc(sizeof(V9fsProxy)); int sock_id; =20 if (ctx->export_flags & V9FS_PROXY_SOCK_NAME) { - sock_id =3D connect_namedsocket(ctx->fs_root); + sock_id =3D connect_namedsocket(ctx->fs_root, errp); } else { sock_id =3D atoi(ctx->fs_root); if (sock_id < 0) { - error_report("Socket descriptor not initialized"); + error_setg(errp, "socket descriptor not initialized"); } } if (sock_id < 0) { diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index df0a8de08aed..8f255e91c00f 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -514,7 +514,7 @@ static int synth_unlinkat(FsContext *ctx, V9fsPath *dir, return -1; } =20 -static int synth_init(FsContext *ctx) +static int synth_init(FsContext *ctx, Error **errp) { QLIST_INIT(&synth_root.child); qemu_mutex_init(&synth_mutex); diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 1e4ebbe57687..909a61139405 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3542,9 +3542,9 @@ int v9fs_device_realize_common(V9fsState *s, Error **= errp) s->fid_list =3D NULL; qemu_co_rwlock_init(&s->rename_lock); =20 - if (s->ops->init(&s->ctx) < 0) { - error_setg(errp, "9pfs Failed to initialize fs-driver with id:%s" - " and export path:%s", s->fsconf.fsdev_id, s->ctx.fs_ro= ot); + if (s->ops->init(&s->ctx, errp) < 0) { + error_prepend(errp, "cannot initialize fsdev '%s': ", + s->fsconf.fsdev_id); goto out; } =20 --=20 2.13.6