diff options
author | Akihiko Odaki <akihiko.odaki@daynix.com> | 2025-01-16 18:00:53 +0900 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2025-02-20 18:23:19 -0500 |
commit | 3bc31441ba31c94f12b7b96b1960abb4c1f21ee8 (patch) | |
tree | 7f0d7edb82b23ce00158acbe42c9ea174f25a9b9 | |
parent | 5731b005246297ab5b91975f52fcd525e08507cd (diff) | |
download | qemu-3bc31441ba31c94f12b7b96b1960abb4c1f21ee8.zip qemu-3bc31441ba31c94f12b7b96b1960abb4c1f21ee8.tar.gz qemu-3bc31441ba31c94f12b7b96b1960abb4c1f21ee8.tar.bz2 |
hw/ppc/spapr_pci: Do not reject VFs created after a PF
A PF may automatically create VFs and the PF may be function 0.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Tested-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Message-Id: <20250116-reuse-v20-2-7cb370606368@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | hw/ppc/spapr_pci.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index b94e4ba..e0a9d50 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1549,7 +1549,9 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_handler, * hotplug, we do not allow functions to be hotplugged to a * slot that already has function 0 present */ - if (plugged_dev->hotplugged && bus->devices[PCI_DEVFN(slotnr, 0)] && + if (plugged_dev->hotplugged && + !pci_is_vf(pdev) && + bus->devices[PCI_DEVFN(slotnr, 0)] && PCI_FUNC(pdev->devfn) != 0) { error_setg(errp, "PCI: slot %d function 0 already occupied by %s," " additional functions can no longer be exposed to guest.", |