From patchwork Thu Jun 11 12:01:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 49764 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 90B3B20C81 for ; Thu, 11 Jun 2015 12:22:28 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf1542633lbb.1 for ; Thu, 11 Jun 2015 05:22:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:message-id:references :mime-version:content-type:content-disposition:in-reply-to:cc :subject:precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=WiLXlN3E3zK0c1oF1B2t2/GbMSU4U/yuYRtxMSBfKWE=; b=LvIpgURlXVrdGfKJ8aiPSkd1F5wSx4oc7J+desVdOHWxAfBXJNnUK8wAzYx3aXQKFT AUzOarRsUdfZX0Iruqt0en2d4CNLh19Exs+12JRsanr7/tSvd+7gpO5pDj3buq/IBLg2 Se70vMM1RYsEn1t21POGRkuWW42GPet/Arc9fay5qQVPy7N8RzAeIWycawNPYuhzcSkO VYypk2Z+pO2Ttb/c8d6Q4kppAbRgBUKTpPp5CgygbobRtYq3QtzZH175OKXC43Su8UnG g4rB9Sd0ptRJ0GDFShQK0rUd/x+dsERwC7RGvr/dAgE9h51esQmVeovUuxQqSuXFf9iM T+JA== X-Gm-Message-State: ALoCoQnux5QrSIOr7KNgbIa1bwVefRI+N+8jDAOYh8D2AW9xEFDW5AAzfIk8ajhv0dwzRhntdTiM X-Received: by 10.180.83.72 with SMTP id o8mr27241206wiy.3.1434025347520; Thu, 11 Jun 2015 05:22:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.18 with SMTP id s18ls403626lal.63.gmail; Thu, 11 Jun 2015 05:22:27 -0700 (PDT) X-Received: by 10.152.198.135 with SMTP id jc7mr9531193lac.48.1434025347319; Thu, 11 Jun 2015 05:22:27 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id x10si451703lbo.118.2015.06.11.05.22.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 05:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lazv15 with SMTP id v15so3482088laz.3 for ; Thu, 11 Jun 2015 05:22:27 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr9487050lak.29.1434025347184; Thu, 11 Jun 2015 05:22:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp4003429lbb; Thu, 11 Jun 2015 05:22:26 -0700 (PDT) X-Received: by 10.55.16.33 with SMTP id a33mr17957241qkh.51.1434025344939; Thu, 11 Jun 2015 05:22:24 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 72si390444qkr.115.2015.06.11.05.22.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Jun 2015 05:22:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:45981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z31V2-0008LX-0F for patch@linaro.org; Thu, 11 Jun 2015 08:22:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z31Ao-0002J9-Jk for qemu-devel@nongnu.org; Thu, 11 Jun 2015 08:01:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z31Aj-0008Gj-Mo for qemu-devel@nongnu.org; Thu, 11 Jun 2015 08:01:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z31Aj-0008Gd-IM for qemu-devel@nongnu.org; Thu, 11 Jun 2015 08:01:25 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 267052DC3D0; Thu, 11 Jun 2015 12:01:25 +0000 (UTC) Received: from redhat.com (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t5BC1FoU020223; Thu, 11 Jun 2015 08:01:22 -0400 Date: Thu, 11 Jun 2015 14:01:03 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1434023714-30366-38-git-send-email-mst@redhat.com> References: <1434023714-30366-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1434023714-30366-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Amit Shah , Shannon Zhao , Shannon Zhao , Cornelia Huck , Paolo Bonzini Subject: [Qemu-devel] [PULL 37/42] virtio-rng: move qdev properties into virtio-rng.c 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mst@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao As only one place in virtio-rng.c uses DEFINE_VIRTIO_RNG_PROPERTIES, there is no need to expose it. Inline it into virtio-rng.c to avoid wrongly use. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Paolo Bonzini Acked-by: Cornelia Huck Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-rng.h | 10 ---------- hw/virtio/virtio-rng.c | 8 +++++++- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h index 7702ff4..0316488 100644 --- a/include/hw/virtio/virtio-rng.h +++ b/include/hw/virtio/virtio-rng.h @@ -46,14 +46,4 @@ typedef struct VirtIORNG { int64_t quota_remaining; } VirtIORNG; -/* Set a default rate limit of 2^47 bytes per minute or roughly 2TB/s. If - you have an entropy source capable of generating more entropy than this - and you can pass it through via virtio-rng, then hats off to you. Until - then, this is unlimited for all practical purposes. -*/ -#define DEFINE_VIRTIO_RNG_PROPERTIES(_state, _conf_field) \ - DEFINE_PROP_UINT64("max-bytes", _state, _conf_field.max_bytes, \ - INT64_MAX), \ - DEFINE_PROP_UINT32("period", _state, _conf_field.period_ms, 1 << 16) - #endif diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 420c39f..22b1d87 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -219,7 +219,13 @@ static void virtio_rng_device_unrealize(DeviceState *dev, Error **errp) } static Property virtio_rng_properties[] = { - DEFINE_VIRTIO_RNG_PROPERTIES(VirtIORNG, conf), + /* Set a default rate limit of 2^47 bytes per minute or roughly 2TB/s. If + * you have an entropy source capable of generating more entropy than this + * and you can pass it through via virtio-rng, then hats off to you. Until + * then, this is unlimited for all practical purposes. + */ + DEFINE_PROP_UINT64("max-bytes", VirtIORNG, conf.max_bytes, INT64_MAX), + DEFINE_PROP_UINT32("period", VirtIORNG, conf.period_ms, 1 << 16), DEFINE_PROP_END_OF_LIST(), };