aboutsummaryrefslogtreecommitdiffstats
path: root/builtin-stop.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2011-08-10 21:32:58 +0300
committerWill Deacon <will.deacon@arm.com>2015-06-01 16:39:47 +0100
commitc9cba7910f52a48ecc99c9976bab69883aa3ef58 (patch)
tree740917c1b81a3d299bc41d5f58c954aa719d286c /builtin-stop.c
parent8a09361d6a526e17511b01464cbe2c67fa9476bc (diff)
downloadkvmtool-c9cba7910f52a48ecc99c9976bab69883aa3ef58.tar.gz
kvm tool: Fix builtin command usage printouts
This patch fixes builtin commands to use usage_with_options() instead of die(). The latter prefixes messages with "Fatal" which makes the usage text ugly. Cc: Asias He <asias.hejun@gmail.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Prasad Joshi <prasadjoshi124@gmail.com> Cc: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'builtin-stop.c')
-rw-r--r--builtin-stop.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/builtin-stop.c b/builtin-stop.c
index 46be393c..efbf979c 100644
--- a/builtin-stop.c
+++ b/builtin-stop.c
@@ -2,11 +2,21 @@
#include <kvm/kvm-cmd.h>
#include <kvm/builtin-stop.h>
#include <kvm/kvm.h>
+#include <kvm/parse-options.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
+static const char * const stop_usage[] = {
+ "kvm stop <instance name>",
+ NULL
+};
+
+static const struct option stop_options[] = {
+ OPT_END()
+};
+
static int do_stop(const char *name, int pid)
{
return kill(pid, SIGKVMSTOP);
@@ -17,7 +27,7 @@ int kvm_cmd_stop(int argc, const char **argv, const char *prefix)
int pid;
if (argc != 1)
- die("Usage: kvm stop [instance name]\n");
+ usage_with_options(stop_usage, stop_options);
if (strcmp(argv[0], "all") == 0) {
return kvm__enumerate_instances(do_stop);