cli: device: Add address.zpci.uid and address.zpci.fid

This commit is contained in:
Cole Robinson 2019-05-14 12:20:53 -04:00
parent afce300084
commit 0eb2b167f9
4 changed files with 8 additions and 1 deletions

View File

@ -395,6 +395,9 @@
<source>
<address domain="0" bus="21" slot="0" function="3"/>
</source>
<address type="pci">
<zpci uid="0xffff" fid="0xffffffff"/>
</address>
</hostdev>
<hostdev mode="subsystem" type="usb" managed="yes">
<source>

View File

@ -548,7 +548,7 @@ c.add_compare("""
--host-device 001.003
--hostdev 15:0.1
--host-device 2:15:0.2
--hostdev 0:15:0.3
--hostdev 0:15:0.3,address.type=pci,address.zpci.uid=0xffff,address.zpci.fid=0xffffffff
--host-device 0x0781:0x5151,driver_name=vfio
--host-device 04b3:4485
--host-device pci_8086_2829_scsi_host_scsi_device_lun0

View File

@ -2463,6 +2463,8 @@ def _add_common_device_args(cls, boot_order=False):
cls.add_arg("address.iobase", "address.iobase")
cls.add_arg("address.irq", "address.irq")
cls.add_arg("address.base", "address.base")
cls.add_arg("address.zpci.uid", "address.zpci_uid")
cls.add_arg("address.zpci.fid", "address.zpci_fid")
def set_boot_order_cb(self, inst, val, virtarg):
val = int(val)

View File

@ -86,6 +86,8 @@ class DeviceAddress(XMLBuilder):
slot = XMLProperty("./@slot", is_int=True)
function = XMLProperty("./@function", is_int=True)
multifunction = XMLProperty("./@multifunction", is_onoff=True)
zpci_uid = XMLProperty("./zpci/@uid")
zpci_fid = XMLProperty("./zpci/@fid")
# type=drive
controller = XMLProperty("./@controller", is_int=True)
unit = XMLProperty("./@unit", is_int=True)