From 1a007c823ef12ed56ada30b228c798bead589a3d Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 5 Dec 2011 16:16:35 +0200 Subject: [PATCH] kvm tools: Ignore parameters after dashdash in 'kvm run' This allows other commands to wrap 'kvm run' and use the parameters user provides after a dash-dash for it's own use. Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- builtin-run.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builtin-run.c b/builtin-run.c index e76db9b..03e4ceb 100644 --- a/builtin-run.c +++ b/builtin-run.c @@ -777,8 +777,13 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix) while (argc != 0) { argc = parse_options(argc, argv, options, run_usage, - PARSE_OPT_STOP_AT_NON_OPTION); + PARSE_OPT_STOP_AT_NON_OPTION | + PARSE_OPT_KEEP_DASHDASH); if (argc != 0) { + /* Cusrom options, should have been handled elsewhere */ + if (strcmp(argv[0], "--") == 0) + break; + if (kernel_filename) { fprintf(stderr, "Cannot handle parameter: " "%s\n", argv[0]);