aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/mst_fpga.c
diff options
context:
space:
mode:
authorDongli Zhang <dongli.zhang@oracle.com>2024-07-07 21:10:56 -0700
committerMichael S. Tsirkin <mst@redhat.com>2024-09-11 07:20:30 -0400
commite228d62b4af29bca698ec57efdceb46f392f5444 (patch)
tree47fdcf12daaf29e2a12daef02768dd320e4462df /hw/misc/mst_fpga.c
parent2225dc562a93dc191c3b2a43f273639bebad5d9a (diff)
downloadqemu-e228d62b4af29bca698ec57efdceb46f392f5444.zip
qemu-e228d62b4af29bca698ec57efdceb46f392f5444.tar.gz
qemu-e228d62b4af29bca698ec57efdceb46f392f5444.tar.bz2
pci: don't skip function 0 occupancy verification for devfn auto assign
When the devfn is already assigned in the command line, the do_pci_register_device() may verify if the function 0 is already occupied. However, when devfn < 0, the verification is skipped because it is part of the last "else if". For instance, suppose there is already a device at addr=00.00 of a port. -device pcie-root-port,bus=pcie.0,chassis=115,id=port01,addr=0e.00 \ -device virtio-net-pci,bus=port01,id=vnet01,addr=00.00 \ When 'addr' is specified for the 2nd device, the hotplug is denied. (qemu) device_add virtio-net-pci,bus=port01,id=vnet02,addr=01.00 Error: PCI: slot 0 function 0 already occupied by virtio-net-pci, new func virtio-net-pci cannot be exposed to guest. When 'addr' is automatically assigned, the hotplug is not denied. This is because the verification is skipped. (qemu) device_add virtio-net-pci,bus=port01,id=vnet02 warning: PCI: slot 1 is not valid for virtio-net-pci, parent device only allows plugging into slot 0. Fix the issue by moving the verification into an independent 'if' statement. Fixes: 3f1e1478db2d ("enable multi-function hot-add") Reported-by: Aswin Unnikrishnan <aswin.u.unnikrishnan@oracle.com> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> Message-Id: <20240708041056.54504-1-dongli.zhang@oracle.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/misc/mst_fpga.c')
0 files changed, 0 insertions, 0 deletions