From patchwork Wed Jun 10 15:04:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49711 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BC59F245D4 for ; Wed, 10 Jun 2015 15:09:06 +0000 (UTC) Received: by wgez8 with SMTP id z8sf12746593wge.2 for ; Wed, 10 Jun 2015 08:09:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references: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=4UpcATrmXtPSpZTBh8ikRLrVv++TZE8gdnApPRw0FMA=; b=bj3c2CYZvIBEQTIrPG+XCPNQ1ywWs4Vb1Pt1/3OxC40sansqwu++xhwbtwMRDdvgVK P2wk8Ed4LgQEUU8fhTmigtX1f4zKWHDOwv6akexvL9HSCWDY7bd20K/j73OjPL21HlC7 V61qfSdMLsqOlvjq02Y8h0rldUDXNLrQKIhs65sWb1SE0Wr8MNrT+b+68GGh3fLHsioX ieJ1Vv5cTgYZoYq0ZPeEzrr9GqjMwr+EKDXQ8ua88quqTpQsu/uR7x+eBNiAOW6V0gq1 RqqdXIePnhb7zwYQo/aCq+QXguWPXKJtECxvxBd/7/t9/GXb94mYgnwjeucwtv4D0oFk 6YaQ== X-Gm-Message-State: ALoCoQn6+y7R9IAvr0FbYNkkXD6JRkgOobLoDK5orr49IDYli+bOedJ0WGqNrau9SL1s4Ll3x+67 X-Received: by 10.112.171.41 with SMTP id ar9mr3382039lbc.24.1433948945912; Wed, 10 Jun 2015 08:09:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.1 with SMTP id n1ls217960laa.87.gmail; Wed, 10 Jun 2015 08:09:05 -0700 (PDT) X-Received: by 10.152.6.39 with SMTP id x7mr4585953lax.18.1433948945764; Wed, 10 Jun 2015 08:09:05 -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 lc3si9277729lab.50.2015.06.10.08.09.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2015 08:09:05 -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 labpy14 with SMTP id py14so35350631lab.0 for ; Wed, 10 Jun 2015 08:09:05 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr4495994lbc.41.1433948945655; Wed, 10 Jun 2015 08:09:05 -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 hn6csp3396778lbb; Wed, 10 Jun 2015 08:09:04 -0700 (PDT) X-Received: by 10.140.151.200 with SMTP id 191mr4677473qhx.95.1433948944347; Wed, 10 Jun 2015 08:09:04 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 29si8914725qkq.108.2015.06.10.08.09.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 10 Jun 2015 08:09:04 -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]:40907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2hcl-0002Of-Eg for patch@linaro.org; Wed, 10 Jun 2015 11:09:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2hZo-0006do-Q2 for qemu-devel@nongnu.org; Wed, 10 Jun 2015 11:06:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2hZj-0006DN-5I for qemu-devel@nongnu.org; Wed, 10 Jun 2015 11:06:00 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:33209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2hZi-0006DI-UZ for qemu-devel@nongnu.org; Wed, 10 Jun 2015 11:05:55 -0400 Received: by pdjn11 with SMTP id n11so39770774pdj.0 for ; Wed, 10 Jun 2015 08:05:54 -0700 (PDT) X-Received: by 10.68.198.101 with SMTP id jb5mr6592813pbc.84.1433948754396; Wed, 10 Jun 2015 08:05:54 -0700 (PDT) Received: from localhost.localdomain ([167.160.116.93]) by mx.google.com with ESMTPSA id w8sm2687917pbt.45.2015.06.10.08.05.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jun 2015 08:05:52 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Wed, 10 Jun 2015 23:04:33 +0800 Message-Id: <1433948676-14395-5-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1433948676-14395-1-git-send-email-shannon.zhao@linaro.org> References: <1433948676-14395-1-git-send-email-shannon.zhao@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.174 Cc: zhaoshenglong@huawei.com, shannon.zhao@linaro.org, mst@redhat.com Subject: [Qemu-devel] [PATCH v2 4/7] 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: shannon.zhao@linaro.org 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 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 --- hw/virtio/virtio-rng.c | 8 +++++++- include/hw/virtio/virtio-rng.h | 10 ---------- 2 files changed, 7 insertions(+), 11 deletions(-) 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(), }; 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