From nobody Wed Feb 11 02:09:09 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15127302414571004.7228570727069; Fri, 8 Dec 2017 02:50:41 -0800 (PST) Received: from localhost ([::1]:36496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNGEl-0003s6-1a for importer@patchew.org; Fri, 08 Dec 2017 05:50:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNGCj-0002j5-W1 for qemu-devel@nongnu.org; Fri, 08 Dec 2017 05:48:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNGCg-0005lD-22 for qemu-devel@nongnu.org; Fri, 08 Dec 2017 05:48:30 -0500 Received: from 10.mo173.mail-out.ovh.net ([46.105.74.148]:56580) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNGCf-0005l8-RH for qemu-devel@nongnu.org; Fri, 08 Dec 2017 05:48:25 -0500 Received: from player739.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id E82E9924F4 for ; Fri, 8 Dec 2017 11:48:23 +0100 (CET) Received: from bahia.lan (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139]) (Authenticated sender: groug@kaod.org) by player739.ha.ovh.net (Postfix) with ESMTPA id AC7D74A00BB; Fri, 8 Dec 2017 11:48:21 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Fri, 08 Dec 2017 11:48:21 +0100 Message-ID: <151273010147.18940.8992794348746235271.stgit@bahia.lan> In-Reply-To: <151273008711.18940.15284049324681529367.stgit@bahia.lan> References: <151273008711.18940.15284049324681529367.stgit@bahia.lan> User-Agent: StGit/0.17.1-46-g6855-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 7923802070665370033 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtuddrvddtgddujecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.74.148 Subject: [Qemu-devel] [PATCH 1/5] 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: Stefano Stabellini , Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 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 {