From aa26f59f5794515fb42d54749b4cd180a665d95e Mon Sep 17 00:00:00 2001 From: Asias He Date: Sun, 7 Aug 2011 14:57:15 +0800 Subject: [PATCH] kvm tools: Tune 'kvm balloon' option This patch changes the option from: kvm balloon [command] [instance name] [amount] to: kvm balloon [inflate/deflate] [size in MiB] [instance name] Acked-by: Sasha Levin Signed-off-by: Asias He Signed-off-by: Pekka Enberg --- tools/kvm/Documentation/kvm-balloon.txt | 2 +- tools/kvm/builtin-balloon.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/kvm/Documentation/kvm-balloon.txt b/tools/kvm/Documentation/kvm-balloon.txt index 5ba68d6045bf..a29a20110526 100644 --- a/tools/kvm/Documentation/kvm-balloon.txt +++ b/tools/kvm/Documentation/kvm-balloon.txt @@ -8,7 +8,7 @@ kvm-balloon - Inflate or deflate the virtio balloon SYNOPSIS -------- [verse] -'kvm balloon [instance] [command] [size]' +'kvm balloon [command] [size] [instance]' DESCRIPTION ----------- diff --git a/tools/kvm/builtin-balloon.c b/tools/kvm/builtin-balloon.c index 319941d4d589..ce076ba90709 100644 --- a/tools/kvm/builtin-balloon.c +++ b/tools/kvm/builtin-balloon.c @@ -14,9 +14,9 @@ int kvm_cmd_balloon(int argc, const char **argv, const char *prefix) int inflate = 0; if (argc != 3) - die("Usage: kvm balloon [command] [instance name] [amount]\n"); + die("Usage: kvm balloon [inflate/deflate] [size in MiB] [instance name]\n"); - pid = kvm__get_pid_by_instance(argv[1]); + pid = kvm__get_pid_by_instance(argv[2]); if (pid < 0) die("Failed locating instance name"); @@ -25,7 +25,7 @@ int kvm_cmd_balloon(int argc, const char **argv, const char *prefix) else if (strcmp(argv[0], "deflate")) die("command can be either 'inflate' or 'deflate'"); - amount = atoi(argv[2]); + amount = atoi(argv[1]); for (i = 0; i < amount; i++) kill(pid, inflate ? SIGKVMADDMEM : SIGKVMDELMEM); -- 2.39.5