cli: --tpm: use predictable cli subarg names

To match the XML schema, rename these subarguments and add aliases
to preserve compatibility:

* path -> backend.device.path
* type -> backend.type
* version -> backend.version
This commit is contained in:
Cole Robinson 2019-05-12 09:00:39 -04:00
parent 8e1cdf2cd7
commit b0c3c8e12e
1 changed files with 8 additions and 3 deletions

View File

@ -2887,6 +2887,11 @@ class ParserTPM(VirtCLIParser):
cli_arg_name = "tpm"
guest_propname = "devices.tpm"
remove_first = "type"
aliases = {
"backend.type": "type",
"backend.version": "version",
"backend.device.path": "path",
}
def _parse(self, inst):
if (self.optdict.get("type", "").startswith("/")):
@ -2897,10 +2902,10 @@ class ParserTPM(VirtCLIParser):
def _init_class(cls, **kwargs):
VirtCLIParser._init_class(**kwargs)
_add_device_address_args(cls)
cls.add_arg("type", "type")
cls.add_arg("model", "model")
cls.add_arg("version", "version")
cls.add_arg("path", "device_path")
cls.add_arg("backend.type", "type")
cls.add_arg("backend.version", "version")
cls.add_arg("backend.device.path", "device_path")
#################