From patchwork Thu Apr 7 19:47:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Joshi X-Patchwork-Id: 693431 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 p388EDrV003611 for ; Fri, 8 Apr 2011 08:14:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756849Ab1DGTrk (ORCPT ); Thu, 7 Apr 2011 15:47:40 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:48906 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756565Ab1DGTrj (ORCPT ); Thu, 7 Apr 2011 15:47:39 -0400 Received: by wya21 with SMTP id 21so2526010wya.19 for ; Thu, 07 Apr 2011 12:47:38 -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=UMR+G0LtJa8fHMFJnhtDW1RCrPuzdnvwpb+wYURXic8=; b=t/NSIzvf7S1uy9+jeY8Ysm1CYNmBoJaljl1UPMi79SkoYuhk52Qc60WBumb78tQ7Hf uxqCwllQ2BgWzCE5/2CZeP7itIh4dzQ2wAQIV5At8IqjJCzSIHK6axoIJ/yvPzsHreqj td1SA0OLnDCKFLmGH1L4Nz5bAmQzsokIxb8jo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=CfvP7xdt3vUSuq0NGBavDxbs0ikLRHqvhN+QTOT4AfAo98Zp4Wi1vgYu8lOJiFXB41 xJzImROACFwpCFuod89FLl8lFkdVK7ohRwibr3cbLYVB4hjBnkF6hGsRSp4+kjULMJUy sEMDwSnrx5+NtMETdkllsKf4AWXfY/0wNtT60= Received: by 10.227.13.135 with SMTP id c7mr1334961wba.111.1302205658195; Thu, 07 Apr 2011 12:47:38 -0700 (PDT) Received: from prasad-kvm.localdomain (pineapple.rdg.ac.uk [134.225.206.123]) by mx.google.com with ESMTPS id u9sm1259304wbg.17.2011.04.07.12.47.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Apr 2011 12:47:37 -0700 (PDT) Received: by prasad-kvm.localdomain (Postfix, from userid 1000) id C510D26E006E; Thu, 7 Apr 2011 20:47:35 +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 1/4] Generating list of common kvm tool commands Date: Thu, 7 Apr 2011 20:47:23 +0100 Message-Id: <1302205647-7435-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 08:14:23 +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. Signed-off-by: Prasad Joshi --- tools/kvm/Documentation/kvm-run.txt | 48 +++++++++++++++++++++++++++++++++++ tools/kvm/command-list.txt | 5 +++ tools/kvm/util/generate-cmdlist.sh | 24 +++++++++++++++++ 3 files changed, 77 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..f563898 --- /dev/null +++ b/tools/kvm/Documentation/kvm-run.txt @@ -0,0 +1,48 @@ +kvm-run(1) +================ + +NAME +---- +kvm-run - Start the virtual machine + +SYNOPSIS +-------- +[verse] +'kvm run' [-k | --kernel ] + [-d | --image ] + +DESCRIPTION +----------- +The command starts a virtual machine. + +OPTIONS +------- +-m:: +--mem=:: + Virtual machine memory size in MiB. + +-p:: +--params:: + Additional kernel command line arguments. + +-i:: +--initrd=:: + Initial RAM disk image. + +-k:: +--kernel=:: + The virtual machine kernel. + +-d:: +--image=:: + A disk image file. + +-s:: +--single-step:: Enable single stepping. + +-g:: +--ioport-debug:: Enable ioport debugging. + +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 "};"