From patchwork Fri May 13 02:40:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 781642 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4D2g4ZG010786 for ; Fri, 13 May 2011 02:42:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752129Ab1EMCmB (ORCPT ); Thu, 12 May 2011 22:42:01 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:50334 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026Ab1EMCmA (ORCPT ); Thu, 12 May 2011 22:42:00 -0400 Received: by pwi15 with SMTP id 15so990084pwi.19 for ; Thu, 12 May 2011 19:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=q4D/uat6MngS5Cl2cF2KbzhtXlXBzGuao1z80HSCQmE=; b=xxGI0t31CBGglUlmZqm+SSc9zSPJjOZifJo5cD9ZGJUGSwdRSyjL6OXC1feiGmZ70/ eY3RQdVOOla0Vgar+VaukMKpojbZzUSo1eJODWFWf/2odHtfoioFWnvhLRezRU626MTQ xNx2lnAxVfEhBosMmpX7avAfZNyBgP24UTg6U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=evP8LUi5i5VfziT8jvRBevA8S7B16ZInTNKbETFqasA+sXGLPQR9WmYDCSZvHhRpux rDCDcNVPS8UDAgv8Kxmg4bCWDDz3MMEh0tNL4FRkSu/rSfGO9ayuHbMyyNhH8SGxAYyz y3LWGSYmJrQbEZCrJ0HxND55IpWofBFWDx3No= Received: by 10.68.54.65 with SMTP id h1mr1401262pbp.44.1305254520061; Thu, 12 May 2011 19:42:00 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id y5sm1034417pbb.99.2011.05.12.19.41.54 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 May 2011 19:41:59 -0700 (PDT) From: Asias He To: Pekka Enberg Cc: Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org, Asias He Subject: [PATCH 2/2] kvm tools: Tune the command-line option Date: Fri, 13 May 2011 10:40:09 +0800 Message-Id: <1305254409-9079-2-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1305254409-9079-1-git-send-email-asias.hejun@gmail.com> References: <1305254409-9079-1-git-send-email-asias.hejun@gmail.com> 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]); Fri, 13 May 2011 02:42:04 +0000 (UTC) With this patch we can have -c --cpus -m --mem -d --disk -k --kernel -i --initrd which is more consistent and easy to remember. The patch also frees up -s, -g option. Ingo suggestied ''' The debug options should probably be concentrated under a --debug option anyway, to allow things like: --debug single-step,ioport Even if the debug options are kept they should be streamlined along the same pattern: >> --debug-single-step Enable single stepping >> --debug-ioport Enable ioport debugging But having a --debug option that recognizes all the debug flags would be nicer. It would also allow future enhancements to group debug features, like: --debug all # turn on everything and the kitchen sink for early hangs --debug all,-single-step # turn on everything except single-step debugging --debug nonverbose # turn on all non-noisy debug options we have Maybe even: --debug memcheck ... could run kvm under valgrind automatically - that way we can hide any secondary tool complexities from the user and turn those tools into simple debug options :-) ''' Let's do this --debug option consolidation later. Signed-off-by: Asias He --- tools/kvm/kvm-run.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/kvm/kvm-run.c b/tools/kvm/kvm-run.c index 91a194e..ba8e5ce 100644 --- a/tools/kvm/kvm-run.c +++ b/tools/kvm/kvm-run.c @@ -101,16 +101,17 @@ static const struct option options[] = { OPT_GROUP("Basic options:"), OPT_INTEGER('c', "cpus", &nrcpus, "Number of CPUs"), OPT_U64('m', "mem", &ram_size, "Virtual machine memory size in MiB."), - OPT_CALLBACK('i', "image", NULL, "image", "Disk image", img_name_parser), + OPT_CALLBACK('d', "disk", NULL, "image", "Disk image", img_name_parser), OPT_STRING('\0', "console", &console, "serial or virtio", "Console to use"), - OPT_BOOLEAN('\0', "virtio-rng", &virtio_rng, + OPT_BOOLEAN('\0', "rng", &virtio_rng, "Enable virtio Random Number Generator"), + OPT_STRING('\0', "kvm-dev", &kvm_dev, "kvm-dev", "KVM device file"), OPT_GROUP("Kernel options:"), OPT_STRING('k', "kernel", &kernel_filename, "kernel", "Kernel to boot in virtual machine"), - OPT_STRING('r', "initrd", &initrd_filename, "initrd", + OPT_STRING('i', "initrd", &initrd_filename, "initrd", "Initial RAM disk image"), OPT_STRING('p', "params", &kernel_cmdline, "params", "Kernel command line arguments"), @@ -124,14 +125,14 @@ static const struct option options[] = { "Assign this address to the guest side NIC"), OPT_STRING('\0', "tapscript", &script, "Script path", "Assign a script to process created tap device"), + OPT_GROUP("Debug options:"), - OPT_STRING('d', "kvm-dev", &kvm_dev, "kvm-dev", "KVM device file"), - OPT_BOOLEAN('s', "single-step", &single_step, - "Enable single stepping"), - OPT_BOOLEAN('g', "ioport-debug", &ioport_debug, - "Enable ioport debugging"), OPT_BOOLEAN('\0', "debug", &do_debug_print, "Enable debug messages"), + OPT_BOOLEAN('\0', "debug-single-step", &single_step, + "Enable single stepping"), + OPT_BOOLEAN('\0', "debug-ioport-debug", &ioport_debug, + "Enable ioport debugging"), OPT_END() };