public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] kvm tools: Add 'kvm version' command
@ 2011-07-08 21:56 Sasha Levin
  2011-07-08 21:56 ` [PATCH 2/7] kvm tools: Properly add 'kvm list' to command list Sasha Levin
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Sasha Levin @ 2011-07-08 21:56 UTC (permalink / raw)
  To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124, Sasha Levin

Add a 'kvm version' command which prints the version of the kernel
used to build kvm tools.

Part of the code is based on and was loaned from perf.

Suggested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/Documentation/kvm-version.txt |   21 +++++++++++++++
 tools/kvm/Makefile                      |    7 +++++
 tools/kvm/command-list.txt              |    1 +
 tools/kvm/include/kvm/kvm-version.h     |    6 ++++
 tools/kvm/kvm-cmd.c                     |    2 +
 tools/kvm/kvm-version.c                 |   15 +++++++++++
 tools/kvm/util/KVMTOOLS-VERSION-GEN     |   42 +++++++++++++++++++++++++++++++
 7 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 tools/kvm/Documentation/kvm-version.txt
 create mode 100644 tools/kvm/include/kvm/kvm-version.h
 create mode 100644 tools/kvm/kvm-version.c
 create mode 100755 tools/kvm/util/KVMTOOLS-VERSION-GEN

diff --git a/tools/kvm/Documentation/kvm-version.txt b/tools/kvm/Documentation/kvm-version.txt
new file mode 100644
index 0000000..bf51540
--- /dev/null
+++ b/tools/kvm/Documentation/kvm-version.txt
@@ -0,0 +1,21 @@
+kvm-version(1)
+================
+
+NAME
+----
+kvm-version - Print the version of the kernel tree kvm tools
+was built on.
+
+SYNOPSIS
+--------
+[verse]
+'kvm version'
+
+DESCRIPTION
+-----------
+The command prints the version of the kernel that was used to build
+kvm tools.
+
+Note that the version is not the version of the kernel which is currently
+running on the host, but is the version of the kernel tree from which kvm
+tools was built.
diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
index 51a3d1a..5ec222f 100644
--- a/tools/kvm/Makefile
+++ b/tools/kvm/Makefile
@@ -61,6 +61,7 @@ OBJS	+= kvm-pause.o
 OBJS	+= kvm-balloon.o
 OBJS	+= kvm-list.o
 OBJS	+= kvm-run.o
+OBJS	+= kvm-version.o
 OBJS	+= mptable.o
 OBJS	+= rbtree.o
 OBJS	+= threadpool.o
@@ -124,6 +125,7 @@ endif
 
 DEFINES	+= -D_FILE_OFFSET_BITS=64
 DEFINES	+= -D_GNU_SOURCE
+DEFINES	+= -DKVMTOOLS_VERSION='"$(KVMTOOLS_VERSION)"'
 
 KVM_INCLUDE := include
 CFLAGS	+= $(CPPFLAGS) $(DEFINES) -I$(KVM_INCLUDE) -I../../include -I../../arch/$(ARCH)/include/ -Os -g
@@ -152,6 +154,10 @@ CFLAGS	+= $(WARNINGS)
 
 all: $(PROGRAM)
 
+KVMTOOLS-VERSION-FILE:
+	@$(SHELL_PATH) util/KVMTOOLS-VERSION-GEN $(OUTPUT)
+-include $(OUTPUT)KVMTOOLS-VERSION-FILE
+
 $(PROGRAM): $(DEPS) $(OBJS)
 	$(E) "  LINK    " $@
 	$(Q) $(CC) $(OBJS) $(LIBS) -o $@
@@ -168,6 +174,7 @@ $(OBJS):
 
 rbtree.o: ../../lib/rbtree.c
 	$(Q) $(CC) -c $(CFLAGS) $< -o $@
+
 %.o: %.c
 	$(E) "  CC      " $@
 	$(Q) $(CC) -c $(CFLAGS) $< -o $@
diff --git a/tools/kvm/command-list.txt b/tools/kvm/command-list.txt
index 36dcd67b..81ba140 100644
--- a/tools/kvm/command-list.txt
+++ b/tools/kvm/command-list.txt
@@ -4,3 +4,4 @@
 #
 kvm-run				mainporcelain common
 kvm-pause			common
+kvm-version			common
diff --git a/tools/kvm/include/kvm/kvm-version.h b/tools/kvm/include/kvm/kvm-version.h
new file mode 100644
index 0000000..83cac4d
--- /dev/null
+++ b/tools/kvm/include/kvm/kvm-version.h
@@ -0,0 +1,6 @@
+#ifndef KVM__VERSION_H
+#define KVM__VERSION_H
+
+int kvm_cmd_version(int argc, const char **argv, const char *prefix);
+
+#endif
diff --git a/tools/kvm/kvm-cmd.c b/tools/kvm/kvm-cmd.c
index cecf0d0..404065b 100644
--- a/tools/kvm/kvm-cmd.c
+++ b/tools/kvm/kvm-cmd.c
@@ -9,6 +9,7 @@
 #include "kvm/kvm-pause.h"
 #include "kvm/kvm-balloon.h"
 #include "kvm/kvm-list.h"
+#include "kvm/kvm-version.h"
 #include "kvm/kvm-help.h"
 #include "kvm/kvm-cmd.h"
 #include "kvm/kvm-run.h"
@@ -18,6 +19,7 @@ struct cmd_struct kvm_commands[] = {
 	{ "debug",	kvm_cmd_debug,		NULL,         0 },
 	{ "balloon",	kvm_cmd_balloon,	NULL,         0 },
 	{ "list",	kvm_cmd_list,		NULL,         0 },
+	{ "version",	kvm_cmd_version,	NULL,         0 },
 	{ "help",	kvm_cmd_help,		NULL,         0 },
 	{ "run",	kvm_cmd_run,		kvm_run_help, 0 },
 	{ NULL,		NULL,			NULL,         0 },
diff --git a/tools/kvm/kvm-version.c b/tools/kvm/kvm-version.c
new file mode 100644
index 0000000..e30f74c
--- /dev/null
+++ b/tools/kvm/kvm-version.c
@@ -0,0 +1,15 @@
+#include <kvm/util.h>
+#include <kvm/kvm-cmd.h>
+#include <kvm/kvm-version.h>
+#include <kvm/kvm.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+
+int kvm_cmd_version(int argc, const char **argv, const char *prefix)
+{
+	printf("%s\n", KVMTOOLS_VERSION);
+
+	return 0;
+}
diff --git a/tools/kvm/util/KVMTOOLS-VERSION-GEN b/tools/kvm/util/KVMTOOLS-VERSION-GEN
new file mode 100755
index 0000000..a93c378
--- /dev/null
+++ b/tools/kvm/util/KVMTOOLS-VERSION-GEN
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+if [ $# -eq 1 ]  ; then
+	OUTPUT=$1
+fi
+
+GVF=${OUTPUT}KVMTOOLS-VERSION-FILE
+
+LF='
+'
+
+# First check if there is a .git to get the version from git describe
+# otherwise try to get the version from the kernel makefile
+if test -d ../../.git -o -f ../../.git &&
+	VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
+	case "$VN" in
+	*$LF*) (exit 1) ;;
+	v[0-9]*)
+		git update-index -q --refresh
+		test -z "$(git diff-index --name-only HEAD --)" ||
+		VN="$VN-dirty" ;;
+	esac
+then
+	VN=$(echo "$VN" | sed -e 's/-/./g');
+else
+	VN=$(MAKEFLAGS= make -sC ../.. kernelversion)
+fi
+
+VN=$(expr "$VN" : v*'\(.*\)')
+
+if test -r $GVF
+then
+	VC=$(sed -e 's/^KVMTOOLS_VERSION = //' <$GVF)
+else
+	VC=unset
+fi
+test "$VN" = "$VC" || {
+	echo >&2 "KVMTOOLS_VERSION = $VN"
+	echo "KVMTOOLS_VERSION = $VN" >$GVF
+}
+
+
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/7] kvm tools: Properly add 'kvm list' to command list
  2011-07-08 21:56 [PATCH 1/7] kvm tools: Add 'kvm version' command Sasha Levin
@ 2011-07-08 21:56 ` Sasha Levin
  2011-07-08 21:56 ` [PATCH 3/7] kvm tools: Properly add 'kvm debug' " Sasha Levin
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2011-07-08 21:56 UTC (permalink / raw)
  To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124, Sasha Levin

Also adds some basic documentation.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/Documentation/kvm-list.txt |   16 ++++++++++++++++
 tools/kvm/command-list.txt           |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 tools/kvm/Documentation/kvm-list.txt

diff --git a/tools/kvm/Documentation/kvm-list.txt b/tools/kvm/Documentation/kvm-list.txt
new file mode 100644
index 0000000..121e45c
--- /dev/null
+++ b/tools/kvm/Documentation/kvm-list.txt
@@ -0,0 +1,16 @@
+kvm-list(1)
+================
+
+NAME
+----
+kvm-list - Print a list of running instances on the host.
+
+SYNOPSIS
+--------
+[verse]
+'kvm list'
+
+DESCRIPTION
+-----------
+This command prints a list of running instances on the host which
+belong to the user who currently ran 'kvm list'.
diff --git a/tools/kvm/command-list.txt b/tools/kvm/command-list.txt
index 81ba140..32bb518 100644
--- a/tools/kvm/command-list.txt
+++ b/tools/kvm/command-list.txt
@@ -5,3 +5,4 @@
 kvm-run				mainporcelain common
 kvm-pause			common
 kvm-version			common
+kvm-list			common
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/7] kvm tools: Properly add 'kvm debug' to command list
  2011-07-08 21:56 [PATCH 1/7] kvm tools: Add 'kvm version' command Sasha Levin
  2011-07-08 21:56 ` [PATCH 2/7] kvm tools: Properly add 'kvm list' to command list Sasha Levin
@ 2011-07-08 21:56 ` Sasha Levin
  2011-07-08 21:56 ` [PATCH 4/7] kvm tools: Update 'kvm pause' documentation Sasha Levin
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2011-07-08 21:56 UTC (permalink / raw)
  To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124, Sasha Levin

Also adds some basic documentation.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/Documentation/kvm-debug.txt |   16 ++++++++++++++++
 tools/kvm/command-list.txt            |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 tools/kvm/Documentation/kvm-debug.txt

diff --git a/tools/kvm/Documentation/kvm-debug.txt b/tools/kvm/Documentation/kvm-debug.txt
new file mode 100644
index 0000000..b1c0e3d
--- /dev/null
+++ b/tools/kvm/Documentation/kvm-debug.txt
@@ -0,0 +1,16 @@
+kvm-debug(1)
+================
+
+NAME
+----
+kvm-debug - Print debug information from a running instance
+
+SYNOPSIS
+--------
+[verse]
+'kvm debug [instance]'
+
+DESCRIPTION
+-----------
+The command prints debug information from a running instance.
+For a list of running instances see 'kvm list'.
diff --git a/tools/kvm/command-list.txt b/tools/kvm/command-list.txt
index 32bb518..12ef4b8 100644
--- a/tools/kvm/command-list.txt
+++ b/tools/kvm/command-list.txt
@@ -6,3 +6,4 @@ kvm-run				mainporcelain common
 kvm-pause			common
 kvm-version			common
 kvm-list			common
+kvm-debug			common
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/7] kvm tools: Update 'kvm pause' documentation
  2011-07-08 21:56 [PATCH 1/7] kvm tools: Add 'kvm version' command Sasha Levin
  2011-07-08 21:56 ` [PATCH 2/7] kvm tools: Properly add 'kvm list' to command list Sasha Levin
  2011-07-08 21:56 ` [PATCH 3/7] kvm tools: Properly add 'kvm debug' " Sasha Levin
@ 2011-07-08 21:56 ` Sasha Levin
  2011-07-08 21:56 ` [PATCH 5/7] kvm tools: Properly add 'kvm balloon' to command list Sasha Levin
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2011-07-08 21:56 UTC (permalink / raw)
  To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124, Sasha Levin

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/Documentation/kvm-pause.txt |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/kvm/Documentation/kvm-pause.txt b/tools/kvm/Documentation/kvm-pause.txt
index ddf3d8f..773824f 100644
--- a/tools/kvm/Documentation/kvm-pause.txt
+++ b/tools/kvm/Documentation/kvm-pause.txt
@@ -8,8 +8,9 @@ kvm-pause - Pause/resume the virtual machine
 SYNOPSIS
 --------
 [verse]
-'kvm pause'
+'kvm pause [instance]'
 
 DESCRIPTION
 -----------
 The command pauses and resumes a virtual machine.
+For a list of running instances see 'kvm list'.
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/7] kvm tools: Properly add 'kvm balloon' to command list
  2011-07-08 21:56 [PATCH 1/7] kvm tools: Add 'kvm version' command Sasha Levin
                   ` (2 preceding siblings ...)
  2011-07-08 21:56 ` [PATCH 4/7] kvm tools: Update 'kvm pause' documentation Sasha Levin
@ 2011-07-08 21:56 ` Sasha Levin
  2011-07-08 21:56 ` [PATCH 6/7] kvm tools: Rename command source files Sasha Levin
  2011-07-08 21:56 ` [PATCH 7/7] kvm tools: Rename debug options under 'kvm run' Sasha Levin
  5 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2011-07-08 21:56 UTC (permalink / raw)
  To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124, Sasha Levin

Also adds some documentation.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/Documentation/kvm-balloon.txt |   24 ++++++++++++++++++++++++
 tools/kvm/command-list.txt              |    1 +
 2 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 tools/kvm/Documentation/kvm-balloon.txt

diff --git a/tools/kvm/Documentation/kvm-balloon.txt b/tools/kvm/Documentation/kvm-balloon.txt
new file mode 100644
index 0000000..5ba68d6
--- /dev/null
+++ b/tools/kvm/Documentation/kvm-balloon.txt
@@ -0,0 +1,24 @@
+kvm-balloon(1)
+================
+
+NAME
+----
+kvm-balloon - Inflate or deflate the virtio balloon
+
+SYNOPSIS
+--------
+[verse]
+'kvm balloon [instance] [command] [size]'
+
+DESCRIPTION
+-----------
+The command inflates or deflates the virtio balloon located in the
+specified instance.
+For a list of running instances see 'kvm list'.
+
+Command can be either 'inflate' or 'deflate'. Inflate increases the
+size of the balloon, thus decreasing the amount of virtual RAM available
+for the guest. Deflation returns previously inflated memory back to the
+guest.
+
+size is specified in Mb.
diff --git a/tools/kvm/command-list.txt b/tools/kvm/command-list.txt
index 12ef4b8..037a8ea 100644
--- a/tools/kvm/command-list.txt
+++ b/tools/kvm/command-list.txt
@@ -7,3 +7,4 @@ kvm-pause			common
 kvm-version			common
 kvm-list			common
 kvm-debug			common
+kvm-balloon			common
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/7] kvm tools: Rename command source files
  2011-07-08 21:56 [PATCH 1/7] kvm tools: Add 'kvm version' command Sasha Levin
                   ` (3 preceding siblings ...)
  2011-07-08 21:56 ` [PATCH 5/7] kvm tools: Properly add 'kvm balloon' to command list Sasha Levin
@ 2011-07-08 21:56 ` Sasha Levin
  2011-07-08 22:24   ` Pekka Enberg
  2011-07-08 21:56 ` [PATCH 7/7] kvm tools: Rename debug options under 'kvm run' Sasha Levin
  5 siblings, 1 reply; 9+ messages in thread
From: Sasha Levin @ 2011-07-08 21:56 UTC (permalink / raw)
  To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124, Sasha Levin

Rename kvm-[command] into builtin-[command] to prevent
clashes with non-command files such as kvm-cpu.h

Suggested-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/Makefile                                 |   14 +++++++-------
 tools/kvm/{kvm-balloon.c => builtin-balloon.c}     |    2 +-
 tools/kvm/{kvm-debug.c => builtin-debug.c}         |    2 +-
 tools/kvm/{kvm-help.c => builtin-help.c}           |    2 +-
 tools/kvm/{kvm-list.c => builtin-list.c}           |    2 +-
 tools/kvm/{kvm-pause.c => builtin-pause.c}         |    2 +-
 tools/kvm/{kvm-run.c => builtin-run.c}             |    0
 tools/kvm/{kvm-version.c => builtin-version.c}     |    2 +-
 .../kvm/{kvm-balloon.h => builtin-balloon.h}       |    0
 .../include/kvm/{kvm-debug.h => builtin-debug.h}   |    0
 .../kvm/include/kvm/{kvm-help.h => builtin-help.h} |    0
 .../kvm/include/kvm/{kvm-list.h => builtin-list.h} |    0
 .../include/kvm/{kvm-pause.h => builtin-pause.h}   |    0
 tools/kvm/include/kvm/{kvm-run.h => builtin-run.h} |    0
 .../kvm/{kvm-version.h => builtin-version.h}       |    0
 tools/kvm/kvm-cmd.c                                |   14 +++++++-------
 16 files changed, 20 insertions(+), 20 deletions(-)
 rename tools/kvm/{kvm-balloon.c => builtin-balloon.c} (95%)
 rename tools/kvm/{kvm-debug.c => builtin-debug.c} (94%)
 rename tools/kvm/{kvm-help.c => builtin-help.c} (97%)
 rename tools/kvm/{kvm-list.c => builtin-list.c} (96%)
 rename tools/kvm/{kvm-pause.c => builtin-pause.c} (94%)
 rename tools/kvm/{kvm-run.c => builtin-run.c} (100%)
 rename tools/kvm/{kvm-version.c => builtin-version.c} (88%)
 rename tools/kvm/include/kvm/{kvm-balloon.h => builtin-balloon.h} (100%)
 rename tools/kvm/include/kvm/{kvm-debug.h => builtin-debug.h} (100%)
 rename tools/kvm/include/kvm/{kvm-help.h => builtin-help.h} (100%)
 rename tools/kvm/include/kvm/{kvm-list.h => builtin-list.h} (100%)
 rename tools/kvm/include/kvm/{kvm-pause.h => builtin-pause.h} (100%)
 rename tools/kvm/include/kvm/{kvm-run.h => builtin-run.h} (100%)
 rename tools/kvm/include/kvm/{kvm-version.h => builtin-version.h} (100%)

diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
index 5ec222f..4b71620 100644
--- a/tools/kvm/Makefile
+++ b/tools/kvm/Makefile
@@ -20,6 +20,13 @@ TAGS	:= ctags
 
 PROGRAM	:= kvm
 
+OBJS	+= builtin-balloon.o
+OBJS	+= builtin-debug.o
+OBJS	+= builtin-help.o
+OBJS	+= builtin-list.o
+OBJS	+= builtin-pause.o
+OBJS	+= builtin-run.o
+OBJS	+= builtin-version.o
 OBJS	+= cpuid.o
 OBJS	+= disk/core.o
 OBJS	+= framebuffer.o
@@ -55,13 +62,6 @@ OBJS	+= uip/udp.o
 OBJS	+= uip/buf.o
 OBJS	+= uip/csum.o
 OBJS	+= kvm-cmd.o
-OBJS	+= kvm-debug.o
-OBJS	+= kvm-help.o
-OBJS	+= kvm-pause.o
-OBJS	+= kvm-balloon.o
-OBJS	+= kvm-list.o
-OBJS	+= kvm-run.o
-OBJS	+= kvm-version.o
 OBJS	+= mptable.o
 OBJS	+= rbtree.o
 OBJS	+= threadpool.o
diff --git a/tools/kvm/kvm-balloon.c b/tools/kvm/builtin-balloon.c
similarity index 95%
rename from tools/kvm/kvm-balloon.c
rename to tools/kvm/builtin-balloon.c
index 277cada..319941d 100644
--- a/tools/kvm/kvm-balloon.c
+++ b/tools/kvm/builtin-balloon.c
@@ -4,7 +4,7 @@
 
 #include <kvm/util.h>
 #include <kvm/kvm-cmd.h>
-#include <kvm/kvm-balloon.h>
+#include <kvm/builtin-balloon.h>
 #include <kvm/kvm.h>
 
 int kvm_cmd_balloon(int argc, const char **argv, const char *prefix)
diff --git a/tools/kvm/kvm-debug.c b/tools/kvm/builtin-debug.c
similarity index 94%
rename from tools/kvm/kvm-debug.c
rename to tools/kvm/builtin-debug.c
index 676f311..153badd 100644
--- a/tools/kvm/kvm-debug.c
+++ b/tools/kvm/builtin-debug.c
@@ -1,6 +1,6 @@
 #include <kvm/util.h>
 #include <kvm/kvm-cmd.h>
-#include <kvm/kvm-debug.h>
+#include <kvm/builtin-debug.h>
 #include <kvm/kvm.h>
 
 #include <stdio.h>
diff --git a/tools/kvm/kvm-help.c b/tools/kvm/builtin-help.c
similarity index 97%
rename from tools/kvm/kvm-help.c
rename to tools/kvm/builtin-help.c
index 817e4f8..e89cd5c 100644
--- a/tools/kvm/kvm-help.c
+++ b/tools/kvm/builtin-help.c
@@ -6,7 +6,7 @@
 
 #include <kvm/util.h>
 #include <kvm/kvm-cmd.h>
-#include <kvm/kvm-help.h>
+#include <kvm/builtin-help.h>
 
 
 const char kvm_usage_string[] =
diff --git a/tools/kvm/kvm-list.c b/tools/kvm/builtin-list.c
similarity index 96%
rename from tools/kvm/kvm-list.c
rename to tools/kvm/builtin-list.c
index 40c0e48..dde3fb3 100644
--- a/tools/kvm/kvm-list.c
+++ b/tools/kvm/builtin-list.c
@@ -1,6 +1,6 @@
 #include <kvm/util.h>
 #include <kvm/kvm-cmd.h>
-#include <kvm/kvm-list.h>
+#include <kvm/builtin-list.h>
 #include <kvm/kvm.h>
 
 #include <stdio.h>
diff --git a/tools/kvm/kvm-pause.c b/tools/kvm/builtin-pause.c
similarity index 94%
rename from tools/kvm/kvm-pause.c
rename to tools/kvm/builtin-pause.c
index ea4f95d..0c0010d 100644
--- a/tools/kvm/kvm-pause.c
+++ b/tools/kvm/builtin-pause.c
@@ -4,7 +4,7 @@
 
 #include <kvm/util.h>
 #include <kvm/kvm-cmd.h>
-#include <kvm/kvm-pause.h>
+#include <kvm/builtin-pause.h>
 #include <kvm/kvm.h>
 
 static void do_pause(const char *name, int pid)
diff --git a/tools/kvm/kvm-run.c b/tools/kvm/builtin-run.c
similarity index 100%
rename from tools/kvm/kvm-run.c
rename to tools/kvm/builtin-run.c
diff --git a/tools/kvm/kvm-version.c b/tools/kvm/builtin-version.c
similarity index 88%
rename from tools/kvm/kvm-version.c
rename to tools/kvm/builtin-version.c
index e30f74c..5b3b598 100644
--- a/tools/kvm/kvm-version.c
+++ b/tools/kvm/builtin-version.c
@@ -1,6 +1,6 @@
 #include <kvm/util.h>
 #include <kvm/kvm-cmd.h>
-#include <kvm/kvm-version.h>
+#include <kvm/builtin-version.h>
 #include <kvm/kvm.h>
 
 #include <stdio.h>
diff --git a/tools/kvm/include/kvm/kvm-balloon.h b/tools/kvm/include/kvm/builtin-balloon.h
similarity index 100%
rename from tools/kvm/include/kvm/kvm-balloon.h
rename to tools/kvm/include/kvm/builtin-balloon.h
diff --git a/tools/kvm/include/kvm/kvm-debug.h b/tools/kvm/include/kvm/builtin-debug.h
similarity index 100%
rename from tools/kvm/include/kvm/kvm-debug.h
rename to tools/kvm/include/kvm/builtin-debug.h
diff --git a/tools/kvm/include/kvm/kvm-help.h b/tools/kvm/include/kvm/builtin-help.h
similarity index 100%
rename from tools/kvm/include/kvm/kvm-help.h
rename to tools/kvm/include/kvm/builtin-help.h
diff --git a/tools/kvm/include/kvm/kvm-list.h b/tools/kvm/include/kvm/builtin-list.h
similarity index 100%
rename from tools/kvm/include/kvm/kvm-list.h
rename to tools/kvm/include/kvm/builtin-list.h
diff --git a/tools/kvm/include/kvm/kvm-pause.h b/tools/kvm/include/kvm/builtin-pause.h
similarity index 100%
rename from tools/kvm/include/kvm/kvm-pause.h
rename to tools/kvm/include/kvm/builtin-pause.h
diff --git a/tools/kvm/include/kvm/kvm-run.h b/tools/kvm/include/kvm/builtin-run.h
similarity index 100%
rename from tools/kvm/include/kvm/kvm-run.h
rename to tools/kvm/include/kvm/builtin-run.h
diff --git a/tools/kvm/include/kvm/kvm-version.h b/tools/kvm/include/kvm/builtin-version.h
similarity index 100%
rename from tools/kvm/include/kvm/kvm-version.h
rename to tools/kvm/include/kvm/builtin-version.h
diff --git a/tools/kvm/kvm-cmd.c b/tools/kvm/kvm-cmd.c
index 404065b..a954a61 100644
--- a/tools/kvm/kvm-cmd.c
+++ b/tools/kvm/kvm-cmd.c
@@ -5,14 +5,14 @@
 #include <assert.h>
 
 /* user defined header files */
-#include "kvm/kvm-debug.h"
-#include "kvm/kvm-pause.h"
-#include "kvm/kvm-balloon.h"
-#include "kvm/kvm-list.h"
-#include "kvm/kvm-version.h"
-#include "kvm/kvm-help.h"
+#include "kvm/builtin-debug.h"
+#include "kvm/builtin-pause.h"
+#include "kvm/builtin-balloon.h"
+#include "kvm/builtin-list.h"
+#include "kvm/builtin-version.h"
+#include "kvm/builtin-help.h"
 #include "kvm/kvm-cmd.h"
-#include "kvm/kvm-run.h"
+#include "kvm/builtin-run.h"
 
 struct cmd_struct kvm_commands[] = {
 	{ "pause",	kvm_cmd_pause,		NULL,         0 },
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/7] kvm tools: Rename debug options under 'kvm run'
  2011-07-08 21:56 [PATCH 1/7] kvm tools: Add 'kvm version' command Sasha Levin
                   ` (4 preceding siblings ...)
  2011-07-08 21:56 ` [PATCH 6/7] kvm tools: Rename command source files Sasha Levin
@ 2011-07-08 21:56 ` Sasha Levin
  5 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2011-07-08 21:56 UTC (permalink / raw)
  To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124, Sasha Levin

Rename debug options to make them consistent with eachother.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/builtin-run.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index 048b6a2..8b7d08b 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -37,7 +37,7 @@
 #include <kvm/framebuffer.h>
 
 /* header files for gitish interface  */
-#include <kvm/kvm-run.h>
+#include <kvm/builtin-run.h>
 #include <kvm/parse-options.h>
 #include <kvm/mutex.h>
 
@@ -178,9 +178,9 @@ static const struct option options[] = {
 			"Enable debug messages"),
 	OPT_BOOLEAN('\0', "debug-single-step", &single_step,
 			"Enable single stepping"),
-	OPT_BOOLEAN('\0', "debug-ioport-debug", &ioport_debug,
+	OPT_BOOLEAN('\0', "debug-ioport", &ioport_debug,
 			"Enable ioport debugging"),
-	OPT_INTEGER('\0', "debug_iodelay", &debug_iodelay,
+	OPT_INTEGER('\0', "debug-iodelay", &debug_iodelay,
 			"Delay IO by millisecond"),
 	OPT_END()
 };
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 6/7] kvm tools: Rename command source files
  2011-07-08 21:56 ` [PATCH 6/7] kvm tools: Rename command source files Sasha Levin
@ 2011-07-08 22:24   ` Pekka Enberg
  2011-07-09  6:47     ` Sasha Levin
  0 siblings, 1 reply; 9+ messages in thread
From: Pekka Enberg @ 2011-07-08 22:24 UTC (permalink / raw)
  To: Sasha Levin; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124

On Sat, 9 Jul 2011, Sasha Levin wrote:
> Rename kvm-[command] into builtin-[command] to prevent
> clashes with non-command files such as kvm-cpu.h
>
> Suggested-by: Pekka Enberg <penberg@kernel.org>
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>

I see this when I apply your patch:

penberg@tiger:~/linux/tools/kvm$ make
builtin-help.c:5:25: error: common-cmds.h: No such file or directory
KVMTOOLS_VERSION = 3.0.rc5.683.g44315f
builtin-help.c:5:25: error: common-cmds.h: No such file or directory
make: *** No rule to make target `builtin-help.d', needed by `kvm'.  Stop.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 6/7] kvm tools: Rename command source files
  2011-07-08 22:24   ` Pekka Enberg
@ 2011-07-09  6:47     ` Sasha Levin
  0 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2011-07-09  6:47 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: kvm, mingo, asias.hejun, gorcunov, prasadjoshi124

On Sat, 2011-07-09 at 01:24 +0300, Pekka Enberg wrote:
> On Sat, 9 Jul 2011, Sasha Levin wrote:
> > Rename kvm-[command] into builtin-[command] to prevent
> > clashes with non-command files such as kvm-cpu.h
> >
> > Suggested-by: Pekka Enberg <penberg@kernel.org>
> > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> 
> I see this when I apply your patch:
> 
> penberg@tiger:~/linux/tools/kvm$ make
> builtin-help.c:5:25: error: common-cmds.h: No such file or directory
> KVMTOOLS_VERSION = 3.0.rc5.683.g44315f
> builtin-help.c:5:25: error: common-cmds.h: No such file or directory
> make: *** No rule to make target `builtin-help.d', needed by `kvm'.  Stop.
> 

Looks like I had old .o files which made the build work. I'll resend
this patch.

-- 

Sasha.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-07-09  6:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-08 21:56 [PATCH 1/7] kvm tools: Add 'kvm version' command Sasha Levin
2011-07-08 21:56 ` [PATCH 2/7] kvm tools: Properly add 'kvm list' to command list Sasha Levin
2011-07-08 21:56 ` [PATCH 3/7] kvm tools: Properly add 'kvm debug' " Sasha Levin
2011-07-08 21:56 ` [PATCH 4/7] kvm tools: Update 'kvm pause' documentation Sasha Levin
2011-07-08 21:56 ` [PATCH 5/7] kvm tools: Properly add 'kvm balloon' to command list Sasha Levin
2011-07-08 21:56 ` [PATCH 6/7] kvm tools: Rename command source files Sasha Levin
2011-07-08 22:24   ` Pekka Enberg
2011-07-09  6:47     ` Sasha Levin
2011-07-08 21:56 ` [PATCH 7/7] kvm tools: Rename debug options under 'kvm run' Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox