vmm: Add id field to --device through CLI

Add the ability to specify the "id" associated with a device, by adding
an extra option to the parameter --device.

This new option is not mandatory, and by default, the VMM will take care
of finding a unique identifier.

If the identifier provided by the user through this new option is not
unique, an error will be thrown and the VM won't be started.

Fixes #881

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-03-11 11:23:42 +01:00
committed by Rob Bradford
parent f4a956a60a
commit 9023444ad3
4 changed files with 27 additions and 4 deletions

View File

@@ -204,7 +204,7 @@ fn create_app<'a, 'b>(
.help("Direct device assignment parameter")
.help(
"Direct device assignment parameters \
\"path=<device_path>,iommu=on|off\"",
\"path=<device_path>,iommu=on|off,id=<device_id>\"",
)
.takes_value(true)
.min_values(1)