From patchwork Thu Mar 16 20:01:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9629271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4569860249 for ; Thu, 16 Mar 2017 20:02:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36A3C2868B for ; Thu, 16 Mar 2017 20:02:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B7BE2868D; Thu, 16 Mar 2017 20:02:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D2B702868B for ; Thu, 16 Mar 2017 20:02:40 +0000 (UTC) Received: from localhost ([::1]:45537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cobbb-0001yO-Pn for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Mar 2017 16:02:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cobbD-0001qj-1G for qemu-devel@nongnu.org; Thu, 16 Mar 2017 16:02:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cobb9-0003BG-HS for qemu-devel@nongnu.org; Thu, 16 Mar 2017 16:02:15 -0400 Received: from mail.kernel.org ([198.145.29.136]:45840) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cobb9-00038s-Ar for qemu-devel@nongnu.org; Thu, 16 Mar 2017 16:02:11 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 68CE9204D6; Thu, 16 Mar 2017 20:02:09 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6DA40204E0; Thu, 16 Mar 2017 20:02:07 +0000 (UTC) From: Stefano Stabellini To: qemu-devel@nongnu.org Date: Thu, 16 Mar 2017 13:01:52 -0700 Message-Id: <1489694518-16978-3-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489694518-16978-1-git-send-email-sstabellini@kernel.org> References: <1489694518-16978-1-git-send-email-sstabellini@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PATCH v3 3/9] 9p: introduce a type for the 9p header 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: jgross@suse.com, sstabellini@kernel.org, groug@kaod.org, Stefano Stabellini , "Aneesh Kumar K.V" , anthony.perard@citrix.com, xen-devel@lists.xenproject.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new type in virtio-9p-device. Signed-off-by: Stefano Stabellini CC: anthony.perard@citrix.com CC: jgross@suse.com CC: Aneesh Kumar K.V CC: Greg Kurz Reviewed-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daudé --- 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; +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, VirtQueue *vq) VirtQueueElement *elem; while ((pdu = pdu_alloc(s))) { - struct { - uint32_t size_le; - uint8_t id; - uint16_t tag_le; - } QEMU_PACKED out; + P9MsgHeader out; elem = virtqueue_pop(vq, sizeof(VirtQueueElement)); if (!elem) {