cli: --vsock: use predictable cli subarg names

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

* cid -> cid.address
* auto_cid -> cid.auto

Add man docs for --vsock while we are at it, since they are missing
This commit is contained in:
Cole Robinson 2019-05-12 09:23:07 -04:00
parent b92f1595a8
commit d1c6c6e758
2 changed files with 16 additions and 4 deletions

View File

@ -1550,6 +1550,14 @@ to configure hotplugmemory and NUMA for a guest.
Use --memdev=? to see a list of all available sub options. Complete details at L<https://libvirt.org/formatdomain.html#elementsMemory>.
=item B<--vsock> OPTS
Configure a vsock host/guest interface. A typical configuration would be
--vsock cid.auto=yes
Use --vsock=? to see a list of all available sub options. Complete details at L<https://libvirt.org/formatdomain.html#vsock>.
=back

View File

@ -752,8 +752,8 @@ def add_device_options(devg, sound_back_compat=False):
ParserVsock.register()
devg.add_argument("--vsock", action="append",
help=_("Configure guest vsock sockets. Ex:\n"
"--vsock auto_cid=yes\n"
"--vsock cid=7"))
"--vsock cid.auto=yes\n"
"--vsock cid.address=7"))
def add_guest_xml_options(geng):
@ -3089,14 +3089,18 @@ class ParserVsock(VirtCLIParser):
guest_propname = "devices.vsock"
remove_first = "model"
stub_none = False
aliases = {
"cid.auto": "auto_cid",
"cid.address": "cid",
}
@classmethod
def _init_class(cls, **kwargs):
VirtCLIParser._init_class(**kwargs)
_add_device_address_args(cls)
cls.add_arg("model", "model")
cls.add_arg("auto_cid", "auto_cid")
cls.add_arg("cid", "cid")
cls.add_arg("cid.auto", "auto_cid", is_onoff=True)
cls.add_arg("cid.address", "cid")
######################################################