From patchwork Wed Aug 17 09:44:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: walimis X-Patchwork-Id: 1073432 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7HA1SoI027608 for ; Wed, 17 Aug 2011 10:01:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435Ab1HQKBY (ORCPT ); Wed, 17 Aug 2011 06:01:24 -0400 Received: from mail.windriver.com ([147.11.1.11]:47876 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752572Ab1HQKBW (ORCPT ); Wed, 17 Aug 2011 06:01:22 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca [147.11.189.40]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id p7HA16R2003439 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 17 Aug 2011 03:01:06 -0700 (PDT) Received: from localhost.localdomain (128.224.162.211) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.1.255.0; Wed, 17 Aug 2011 03:01:05 -0700 From: Liming Wang To: Pekka Enberg CC: Sasha Levin , Ingo Molnar , Subject: [PATCH 2/2] kvm tools: change option type of RNG from increment to boolean Date: Wed, 17 Aug 2011 17:44:54 +0800 Message-ID: <1313574294-23123-2-git-send-email-walimisdev@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1313574294-23123-1-git-send-email-walimisdev@gmail.com> References: <1313574294-23123-1-git-send-email-walimisdev@gmail.com> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 17 Aug 2011 10:01:28 +0000 (UTC) Becasue virtio random generator is a single device, change its option type to boolean. Signed-off-by: Liming Wang --- tools/kvm/builtin-run.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 2816774..646ba21 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -60,7 +60,7 @@ __thread struct kvm_cpu *current_kvm_cpu; static u64 ram_size; static u8 image_count; -static int virtio_rng; +static bool virtio_rng; static const char *kernel_cmdline; static const char *kernel_filename; static const char *vmlinux_filename; @@ -161,7 +161,7 @@ static const struct option options[] = { OPT_BOOLEAN('\0', "balloon", &balloon, "Enable virtio balloon"), OPT_BOOLEAN('\0', "vnc", &vnc, "Enable VNC framebuffer"), OPT_BOOLEAN('\0', "sdl", &sdl, "Enable SDL framebuffer"), - OPT_INCR('\0', "rng", &virtio_rng, "Enable virtio Random Number Generator"), + OPT_BOOLEAN('\0', "rng", &virtio_rng, "Enable virtio Random Number Generator"), OPT_CALLBACK('\0', "9p", NULL, "dir_to_share,tag_name", "Enable virtio 9p to share files between host and guest", virtio_9p_rootdir_parser), OPT_STRING('\0', "console", &console, "serial or virtio", @@ -641,8 +641,7 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix) virtio_console__init(kvm); if (virtio_rng) - while (virtio_rng--) - virtio_rng__init(kvm); + virtio_rng__init(kvm); if (balloon) virtio_bln__init(kvm);