From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgfnB-0002ys-Ft for qemu-devel@nongnu.org; Sun, 04 Sep 2016 18:21:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgfn9-0006RW-Ff for qemu-devel@nongnu.org; Sun, 04 Sep 2016 18:21:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgfn9-0006RS-9j for qemu-devel@nongnu.org; Sun, 04 Sep 2016 18:21:31 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDD6C61E4B for ; Sun, 4 Sep 2016 22:21:30 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 5 Sep 2016 02:20:33 +0400 Message-Id: <20160904222039.11460-13-marcandre.lureau@redhat.com> In-Reply-To: <20160904222039.11460-1-marcandre.lureau@redhat.com> References: <20160904222039.11460-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 12/18] virtio-gpu: save a pointer from virtio_gpu_ctrl_command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: airlied@redhat.com, kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= There is no much point in storing the vq when it can be accessed easily. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/display/virtio-gpu.c | 7 ++++--- include/hw/virtio/virtio-gpu.h | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index ff33d83..5fca1e7 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -233,6 +233,8 @@ void virtio_gpu_ctrl_response(VirtIOGPU *g, struct virtio_gpu_ctrl_hdr *resp, size_t resp_len) { + VirtIODevice *vdev =3D VIRTIO_DEVICE(g); + VirtQueue *vq =3D virtio_get_queue(vdev, 0); size_t s; =20 if (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_FENCE) { @@ -246,8 +248,8 @@ void virtio_gpu_ctrl_response(VirtIOGPU *g, "%s: response size incorrect %zu vs %zu\n", __func__, s, resp_len); } - virtqueue_push(cmd->vq, &cmd->elem, s); - virtio_notify(VIRTIO_DEVICE(g), cmd->vq); + virtqueue_push(vq, &cmd->elem, s); + virtio_notify(VIRTIO_DEVICE(g), vq); cmd->finished =3D true; } =20 @@ -875,7 +877,6 @@ static void virtio_gpu_handle_ctrl(VirtIODevice *vdev= , VirtQueue *vq) =20 cmd =3D virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command)); while (cmd) { - cmd->vq =3D vq; cmd->error =3D 0; cmd->finished =3D false; cmd->waiting =3D false; diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gp= u.h index 8bddc93..d8f9b12 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -75,7 +75,6 @@ struct virtio_gpu_conf { =20 struct virtio_gpu_ctrl_command { VirtQueueElement elem; - VirtQueue *vq; struct virtio_gpu_ctrl_hdr cmd_hdr; uint32_t error; bool waiting; --=20 2.9.0