mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
pcie: Introduce pcie_sriov_num_vfs
igb can use this function to change its behavior depending on the
number of virtual functions currently enabled.
Signed-off-by: Gal Hammer <gal.hammer@sap.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 31180dbdca
)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: needed for v8.2.0-2290-g91bb64a8d2
"hw/nvme: Use pcie_sriov_num_vfs()" (CVE-2024-26328))
This commit is contained in:
committed by
Michael Tokarev
parent
0b7ccfd1d2
commit
e00b062da7
@ -299,3 +299,8 @@ PCIDevice *pcie_sriov_get_vf_at_index(PCIDevice *dev, int n)
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint16_t pcie_sriov_num_vfs(PCIDevice *dev)
|
||||
{
|
||||
return dev->exp.sriov_pf.num_vfs;
|
||||
}
|
||||
|
@ -74,4 +74,7 @@ PCIDevice *pcie_sriov_get_pf(PCIDevice *dev);
|
||||
*/
|
||||
PCIDevice *pcie_sriov_get_vf_at_index(PCIDevice *dev, int n);
|
||||
|
||||
/* Returns the current number of virtual functions. */
|
||||
uint16_t pcie_sriov_num_vfs(PCIDevice *dev);
|
||||
|
||||
#endif /* QEMU_PCIE_SRIOV_H */
|
||||
|
Reference in New Issue
Block a user