From patchwork Fri Apr 8 15:11:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Joshi X-Patchwork-Id: 694851 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 p38FBU7u004648 for ; Fri, 8 Apr 2011 15:11:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757549Ab1DHPL0 (ORCPT ); Fri, 8 Apr 2011 11:11:26 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:34288 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757513Ab1DHPLZ (ORCPT ); Fri, 8 Apr 2011 11:11:25 -0400 Received: by mail-ww0-f44.google.com with SMTP id 36so4366160wwa.1 for ; Fri, 08 Apr 2011 08:11:24 -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; bh=VofuFG02Rp14LNYfEzmlJIMzCS0wB3B72t0pcmJ3pKM=; b=canEcAJsTTWcN2JPw84GxeXJZZC8rm2w+cvgbKTvDKRc2V9sJwAA6L0vEhUBVlputg jBuSZUu9fRDwGGzdoODLtPlt02jWtiqpGBuM9XAInv9tJBHfmC0VIuhyK6Tsd9w2Pghc jPpJj3yVhrBQIJuH9TlW6LVqPo+SQ4GskDx0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=fLF9fdo5gXqijmt/FpSlXBj5v/+fsCdSjHIPw7TKIthXlWl40NsAJsYmGHsHB7kyeC qoZMIZtmMFRHkm3i/UEnHJaDCWkdfoXi9DG5WrW33oJSkJ6fA+L1rKB4yZjJhxktOdaM CRj6hD1hNK9S1S6h+lWZ+/VD7es6ZfXL7oWQ0= Received: by 10.216.195.139 with SMTP id p11mr1996703wen.67.1302275484848; Fri, 08 Apr 2011 08:11:24 -0700 (PDT) Received: from prasad-kvm.localdomain (pineapple.rdg.ac.uk [134.225.206.123]) by mx.google.com with ESMTPS id g32sm1402020wej.27.2011.04.08.08.11.19 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Apr 2011 08:11:21 -0700 (PDT) Received: by prasad-kvm.localdomain (Postfix, from userid 1000) id 65B4026E006E; Fri, 8 Apr 2011 16:11:17 +0100 (BST) From: Prasad Joshi To: prasadjoshi124@gmail.com Cc: mingo@elte.hu, kvm@vger.kernel.org, penberg@kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, oswaldo.cadenas@gmail.com Subject: [PATCH v3 1/4] kvm tool: Generating list of common kvm tool commands Date: Fri, 8 Apr 2011 16:11:12 +0100 Message-Id: <1302275475-3882-1-git-send-email-prasadjoshi124@gmail.com> X-Mailer: git-send-email 1.7.1 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, 08 Apr 2011 15:11:30 +0000 (UTC) - The Documentation/ directory will have a text file for each commmand. The text file should contain the information about the command in manpage format. - command-list.txt: is a list of common commands used with the kvm tool. - util/generate-cmdlist.sh: is a shell script that uses command-list.txt and text files in Documentation/ directory to generate the common-cmds.h file in the include directory. The header file is furthur used to display a usage messgae. Almost the entire script is copied from the tools/perf. Signed-off-by: Prasad Joshi --- tools/kvm/Documentation/kvm-run.txt | 53 +++++++++++++++++++++++++++++++++++ tools/kvm/command-list.txt | 5 +++ tools/kvm/util/generate-cmdlist.sh | 24 ++++++++++++++++ 3 files changed, 82 insertions(+), 0 deletions(-) create mode 100644 tools/kvm/Documentation/kvm-run.txt create mode 100644 tools/kvm/command-list.txt create mode 100755 tools/kvm/util/generate-cmdlist.sh diff --git a/tools/kvm/Documentation/kvm-run.txt b/tools/kvm/Documentation/kvm-run.txt new file mode 100644 index 0000000..c56434f --- /dev/null +++ b/tools/kvm/Documentation/kvm-run.txt @@ -0,0 +1,53 @@ +kvm-run(1) +================ + +NAME +---- +kvm-run - Start the virtual machine + +SYNOPSIS +-------- +[verse] +'kvm run' [-k | --kernel ] + +DESCRIPTION +----------- +The command starts a virtual machine. + +OPTIONS +------- +-m:: +--mem=:: + Virtual machine memory size in MiB. + +-p:: +--params:: + Additional kernel command line arguments. + +-r:: +--initrd=:: + Initial RAM disk image. + +-k:: +--kernel=:: + The virtual machine kernel. +-d +--kvm-dev=:: + KVM device file + +-i:: +--image=:: + A disk image file. + +-s:: +--single-step:: Enable single stepping. + +-g:: +--ioport-debug:: Enable ioport debugging. + +-c:: +--enable-virtio-console:: Enable the virtual IO console + +SEE ALSO +-------- +linkkvm: diff --git a/tools/kvm/command-list.txt b/tools/kvm/command-list.txt new file mode 100644 index 0000000..4eaf399 --- /dev/null +++ b/tools/kvm/command-list.txt @@ -0,0 +1,5 @@ +# +# List of known perf commands. +# command name category [deprecated] [common] +# +kvm-run mainporcelain common diff --git a/tools/kvm/util/generate-cmdlist.sh b/tools/kvm/util/generate-cmdlist.sh new file mode 100755 index 0000000..c3fd172 --- /dev/null +++ b/tools/kvm/util/generate-cmdlist.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +echo "/* Automatically generated by $0 */ +struct cmdname_help +{ + char name[16]; + char help[80]; +}; + +static struct cmdname_help common_cmds[] = {" + +sed -n 's/^kvm-\([^ \t]*\).*common/\1/p' command-list.txt | +sort | +while read cmd +do + # TODO following sed command should be fixed + sed -n '/^NAME/,/^kvm-'"$cmd"'/ { + /NAME/d + /--/d + s/.*kvm-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ + p + }' "Documentation/kvm-$cmd.txt" +done +echo "};"