From patchwork Wed Apr 29 15:24:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47730 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 887B72121F for ; Wed, 29 Apr 2015 15:29:15 +0000 (UTC) Received: by wgtl5 with SMTP id l5sf7530259wgt.1 for ; Wed, 29 Apr 2015 08:29:14 -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=u5ZfmEmSkMjkcCqBWtQTdHvL58r7qZHnyVW1HiQE/Qs=; b=iNN59f8f8Qe4OGYn7SnU9TOK5DxK7ZSLPJUXTJsPgUDOVnBCvhk0OBcq88lE2KmOht 5pj6r36bMSNYwf18avSLdd5boXjKDINWzkYBJTodcNhHPigxnuO6DjBkLDb2Qg2DgZ7J 2X54RVd+1VM9PM0JCb/uiW0UOUn+dNmHhfnfNAQGeUStpBUZocr89PwuEDlghVhxeNUY rU+VBdh+Sj2h5GktR0644nB3iTiH93DHaHDoqs1vRu1lZWo4x0eMyhebxQEZAAqDbgLH 1Dv6nY0X5A2/uTQVV4HmF0OKh7nWaOc5vh/TmRPyAoWWEQ5eLPKbZbxOoW/nq3JsLepR BSKg== X-Gm-Message-State: ALoCoQmn89SZPEzQLlSxiEkyZ6LWigOKXbjNpSEB01h18s2IDR+977TD69QvxGHqRmZRA+WbrEXq X-Received: by 10.152.184.73 with SMTP id es9mr13555952lac.4.1430321354633; Wed, 29 Apr 2015 08:29:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls248815lac.43.gmail; Wed, 29 Apr 2015 08:29:14 -0700 (PDT) X-Received: by 10.152.8.46 with SMTP id o14mr3136760laa.77.1430321354493; Wed, 29 Apr 2015 08:29:14 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id 3si13401714lav.0.2015.04.29.08.29.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 08:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbuc2 with SMTP id uc2so23098451lbb.2 for ; Wed, 29 Apr 2015 08:29:14 -0700 (PDT) X-Received: by 10.152.27.98 with SMTP id s2mr19569227lag.106.1430321354357; Wed, 29 Apr 2015 08:29:14 -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.67.65 with SMTP id l1csp2575797lbt; Wed, 29 Apr 2015 08:29:13 -0700 (PDT) X-Received: by 10.55.42.32 with SMTP id q32mr29166830qkh.62.1430321353090; Wed, 29 Apr 2015 08:29:13 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id fm10si21260679qcb.45.2015.04.29.08.29.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Apr 2015 08:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:39664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTvE-0003V9-AQ for patch@linaro.org; Wed, 29 Apr 2015 11:29:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTrc-0006Tz-SI for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnTrY-0004Yk-VI for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:28 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:34423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTrY-0004YW-Gs for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:24 -0400 Received: by pdbqa5 with SMTP id qa5so31260539pdb.1 for ; Wed, 29 Apr 2015 08:25:24 -0700 (PDT) X-Received: by 10.68.164.165 with SMTP id yr5mr43672363pbb.22.1430321124065; Wed, 29 Apr 2015 08:25:24 -0700 (PDT) Received: from localhost.localdomain ([180.150.153.56]) by mx.google.com with ESMTPSA id cu8sm25875045pad.1.2015.04.29.08.25.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Apr 2015 08:25:22 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Wed, 29 Apr 2015 23:24:06 +0800 Message-Id: <1430321049-11859-5-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430321049-11859-1-git-send-email-shannon.zhao@linaro.org> References: <1430321049-11859-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: peter.maydell@linaro.org, hangaohuai@huawei.com, mst@redhat.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org, zhaoshenglong@huawei.com, pbonzini@redhat.com, christoffer.dall@linaro.org Subject: [Qemu-devel] [PATCH 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.217.177 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 --- 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 06e7178..66973b5 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