main: Add some command line argument conflicts

Add explicit exclusions with --net-backend from --block-backend (and
vice-versa.) And also with "--kernel" as this is the option for "VM boot" that is never optional.

Ideally we would conflcit the backend arguments against the "vm-group"
however this does not work as it includes some arguments that have a
default value set and thus clap thinks those arguments are always
provided. Conflicting with "--kernel" is thus a reasonable compromise.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-01-22 15:44:02 +00:00
parent 611d13ed1b
commit cafab9e981

View File

@ -274,6 +274,7 @@ fn create_app<'a, 'b>(
queue_size=<size_of_each_queue>\"",
)
.takes_value(true)
.conflicts_with_all(&["block-backend", "kernel"])
.min_values(1),
)
.arg(
@ -285,6 +286,7 @@ fn create_app<'a, 'b>(
direct=true|false\"",
)
.takes_value(true)
.conflicts_with_all(&["net-backend", "kernel"])
.min_values(1),
)
}