From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1exi-00040v-Vz for qemu-devel@nongnu.org; Fri, 21 Apr 2017 16:15:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1exh-0002hc-Pn for qemu-devel@nongnu.org; Fri, 21 Apr 2017 16:15:26 -0400 Received: from mail.kernel.org ([198.145.29.136]:42892) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d1exh-0002hP-JY for qemu-devel@nongnu.org; Fri, 21 Apr 2017 16:15:25 -0400 From: Stefano Stabellini Date: Fri, 21 Apr 2017 13:14:52 -0700 Message-Id: <1492805702-19690-11-git-send-email-sstabellini@kernel.org> In-Reply-To: <1492805702-19690-1-git-send-email-sstabellini@kernel.org> References: <1492805702-19690-1-git-send-email-sstabellini@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 11/21] 9p: introduce a type for the 9p header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: stefanha@gmail.com, sstabellini@kernel.org, stefanha@redhat.com, anthony.perard@citrix.com, xen-devel@lists.xenproject.org, qemu-devel@nongnu.org, Stefano Stabellini , jgross@suse.com, "Aneesh Kumar K.V" , Greg Kurz Use the new type in virtio-9p-device. Signed-off-by: Stefano Stabellini Reviewed-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daud=C3=A9 CC: anthony.perard@citrix.com CC: jgross@suse.com CC: Aneesh Kumar K.V CC: Greg Kurz --- hw/9pfs/9p.h | 6 ++++++ hw/9pfs/virtio-9p-device.c | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index b7e8362..5312d8a 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -119,6 +119,12 @@ static inline char *rpath(FsContext *ctx, const char= *path) typedef struct V9fsPDU V9fsPDU; struct V9fsState; =20 +typedef struct { + uint32_t size_le; + uint8_t id; + uint16_t tag_le; +} QEMU_PACKED P9MsgHeader; + struct V9fsPDU { uint32_t size; diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index 27a4a32..3782f43 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -46,11 +46,7 @@ static void handle_9p_output(VirtIODevice *vdev, VirtQ= ueue *vq) VirtQueueElement *elem; =20 while ((pdu =3D pdu_alloc(s))) { - struct { - uint32_t size_le; - uint8_t id; - uint16_t tag_le; - } QEMU_PACKED out; + P9MsgHeader out; =20 elem =3D virtqueue_pop(vq, sizeof(VirtQueueElement)); if (!elem) { --=20 1.9.1