[PATCH 4/5] kvm tools: Ignore parameters after dashdash in 'kvm run'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <levinsasha928@xxxxxxxxx>
---
 tools/kvm/builtin-run.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index cd14159..5db6995 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -776,8 +776,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]);
-- 
1.7.8

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux