cli: Clarify that --controller address= is not the preferred pattern

Remove it from the man page, and add a local comment to the code

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-01-25 13:42:03 -05:00
parent b3ea89f218
commit 6924e16aaf
2 changed files with 3 additions and 5 deletions

View File

@ -1349,11 +1349,6 @@ for the B<scsi> controller, B<ehci> or B<none> for the B<usb>
controller. For full list and further details on controllers/models,
see C<https://libvirt.org/formatdomain.html#elementsControllers>.
=item B<address>
Shorthand for setting a manual PCI address from an lscpi style string.
The preferred method for setting this is using the address.* parameters.
=item B<index>
A decimal integer describing in which order the bus controller is

View File

@ -3498,6 +3498,9 @@ class ParserController(VirtCLIParser):
###################
def set_address_cb(self, inst, val, virtarg):
# Convenience option for address= PCI parsing. This pattern should
# not be extended IMO, make users manually specify the address
# fields they need
addrstr = val
if addrstr.count(":") in [1, 2] and "." in addrstr:
inst.address.type = inst.address.ADDRESS_TYPE_PCI