mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
qemu: fix off-by-one in pci slot reservation
Signed-off-by: Steve Hodgson <shodgson@solarflare.com>
This commit is contained in:
parent
3468bdafaf
commit
7ae740fcb1
@ -878,7 +878,7 @@ int qemuDomainPCIAddressReserveSlot(qemuDomainPCIAddressSetPtr addrs,
|
||||
{
|
||||
int function;
|
||||
|
||||
for (function = 0; function <= QEMU_PCI_ADDRESS_LAST_FUNCTION; function++) {
|
||||
for (function = 0; function < QEMU_PCI_ADDRESS_LAST_FUNCTION; function++) {
|
||||
if (qemuDomainPCIAddressReserveFunction(addrs, slot, function) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
@ -956,7 +956,7 @@ int qemuDomainPCIAddressReleaseSlot(qemuDomainPCIAddressSetPtr addrs, int slot)
|
||||
dev.addr.pci.bus = 0;
|
||||
dev.addr.pci.slot = slot;
|
||||
|
||||
for (*function = 0; *function <= QEMU_PCI_ADDRESS_LAST_FUNCTION; (*function)++) {
|
||||
for (*function = 0; *function < QEMU_PCI_ADDRESS_LAST_FUNCTION; (*function)++) {
|
||||
addr = qemuPCIAddressAsString(&dev);
|
||||
if (!addr)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user