From patchwork Mon Jan 7 18:40:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fred.konrad@greensocs.com X-Patchwork-Id: 210098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 628F22C0086 for ; Tue, 8 Jan 2013 07:11:45 +1100 (EST) Received: from localhost ([::1]:52539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsJ2t-0001gV-HJ for incoming@patchwork.ozlabs.org; Mon, 07 Jan 2013 15:11:43 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsHeb-0005Rb-0W for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:42:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsHeZ-0005xd-Tu for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:42:32 -0500 Received: from greensocs.com ([87.106.252.221]:52982 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsHeZ-0005xZ-Nv for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:42:31 -0500 Received: from localhost (unknown [127.0.0.1]) by s15328186.onlinehome-server.info (Postfix) with ESMTP id B8BAF439E32; Mon, 7 Jan 2013 18:42:30 +0000 (UTC) Received: from s15328186.onlinehome-server.info ([127.0.0.1]) by localhost (s15328186.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TNUtDx6cLkKM; Mon, 7 Jan 2013 19:42:27 +0100 (CET) Received: by s15328186.onlinehome-server.info (Postfix, from userid 491) id 8812E439E48; Mon, 7 Jan 2013 19:42:21 +0100 (CET) Received: from compaq.katmai.xl.cx.katmai.xl.cx (lan31-11-83-155-143-136.fbx.proxad.net [83.155.143.136]) by s15328186.onlinehome-server.info (Postfix) with ESMTPSA id 287E8439E36; Mon, 7 Jan 2013 19:42:20 +0100 (CET) From: fred.konrad@greensocs.com To: qemu-devel@nongnu.org, aliguori@us.ibm.com Date: Mon, 7 Jan 2013 19:40:51 +0100 Message-Id: <1357584074-10852-39-git-send-email-fred.konrad@greensocs.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1357584074-10852-1-git-send-email-fred.konrad@greensocs.com> References: <1357584074-10852-1-git-send-email-fred.konrad@greensocs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 87.106.252.221 Cc: kwolf@redhat.com, peter.maydell@linaro.org, e.voevodin@samsung.com, mst@redhat.com, mark.burton@greensocs.com, agraf@suse.de, amit.shah@redhat.com, aneesh.kumar@linux.vnet.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH 38/61] virtio-rng : show the VirtIORNG structure. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: KONRAD Frederic As we discuss with anthony and andreas, this structure must be showed to avoid two memory allocations for virtio-rng-x. Signed-off-by: KONRAD Frederic --- hw/virtio-rng.c | 19 ------------------- hw/virtio-rng.h | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c index e063127..d79aa46 100644 --- a/hw/virtio-rng.c +++ b/hw/virtio-rng.c @@ -15,25 +15,6 @@ #include "virtio-rng.h" #include "qemu/rng.h" -typedef struct VirtIORNG { - VirtIODevice vdev; - - DeviceState *qdev; - - /* Only one vq - guest puts buffer(s) on it when it needs entropy */ - VirtQueue *vq; - - VirtIORNGConf *conf; - - RngBackend *rng; - - /* We purposefully don't migrate this state. The quota will reset on the - * destination as a result. Rate limiting is host state, not guest state. - */ - QEMUTimer *rate_limit_timer; - int64_t quota_remaining; -} VirtIORNG; - static bool is_guest_ready(VirtIORNG *vrng) { if (virtio_queue_ready(vrng->vq) diff --git a/hw/virtio-rng.h b/hw/virtio-rng.h index f42d748..3711c97 100644 --- a/hw/virtio-rng.h +++ b/hw/virtio-rng.h @@ -25,4 +25,23 @@ struct VirtIORNGConf { RndRandom *default_backend; }; +typedef struct VirtIORNG { + VirtIODevice vdev; + + DeviceState *qdev; + + /* Only one vq - guest puts buffer(s) on it when it needs entropy */ + VirtQueue *vq; + + VirtIORNGConf *conf; + + RngBackend *rng; + + /* We purposefully don't migrate this state. The quota will reset on the + * destination as a result. Rate limiting is host state, not guest state. + */ + QEMUTimer *rate_limit_timer; + int64_t quota_remaining; +} VirtIORNG; + #endif