diff options
author | Akihiko Odaki <akihiko.odaki@daynix.com> | 2024-06-27 15:07:54 +0900 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2024-07-03 18:14:07 -0400 |
commit | 77718701157f6ca77ea7a57b536fa0a22f676082 (patch) | |
tree | 3dce0b19d3e760eb9adb5d07a8afcddc2c0a23fe /docs | |
parent | c613ad25125bf3016aa8f81ce170f5ac91d2379f (diff) | |
download | qemu-77718701157f6ca77ea7a57b536fa0a22f676082.zip qemu-77718701157f6ca77ea7a57b536fa0a22f676082.tar.gz qemu-77718701157f6ca77ea7a57b536fa0a22f676082.tar.bz2 |
pcie_sriov: Ensure VF function number does not overflow
pci_new() aborts when creating a VF with a function number equals to or
is greater than PCI_DEVFN_MAX.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20240627-reuse-v10-5-7ca0b8ed3d9f@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/pcie_sriov.txt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/pcie_sriov.txt b/docs/pcie_sriov.txt index a47aad0..ab21428 100644 --- a/docs/pcie_sriov.txt +++ b/docs/pcie_sriov.txt @@ -52,9 +52,11 @@ setting up a BAR for a VF. ... /* Add and initialize the SR/IOV capability */ - pcie_sriov_pf_init(d, 0x200, "your_virtual_dev", - vf_devid, initial_vfs, total_vfs, - fun_offset, stride); + if (!pcie_sriov_pf_init(d, 0x200, "your_virtual_dev", + vf_devid, initial_vfs, total_vfs, + fun_offset, stride, errp)) { + return; + } /* Set up individual VF BARs (parameters as for normal BARs) */ pcie_sriov_pf_init_vf_bar( ... ) |