This function doesn't actually reserve an entire slot any more, it reserves a single PCI address, so this name is more appropriate. --- src/bhyve/bhyve_device.c | 8 ++++++-- src/conf/domain_addr.c | 2 +- src/conf/domain_addr.h | 2 +- src/libvirt_private.syms | 2 +- src/qemu/qemu_domain_address.c | 24 ++++++++++++------------ 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index 4a1e1bd..97e81e1 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -53,8 +53,10 @@ bhyveCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, } } - if (virDomainPCIAddressReserveSlot(addrs, addr, VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) + if (virDomainPCIAddressReserveAddr(addrs, addr, + VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) { goto cleanup; + } ret = 0; cleanup: @@ -94,8 +96,10 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, memset(&lpc_addr, 0, sizeof(lpc_addr)); lpc_addr.slot = 0x1; - if (virDomainPCIAddressReserveSlot(addrs, &lpc_addr, VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) + if (virDomainPCIAddressReserveAddr(addrs, &lpc_addr, + VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) { goto error; + } for (i = 0; i < def->nnets; i++) { if (!virDeviceInfoPCIAddressWanted(&def->nets[i]->info)) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 60f8baf..dc474a7 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -529,7 +529,7 @@ virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs, int -virDomainPCIAddressReserveSlot(virDomainPCIAddressSetPtr addrs, +virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, virPCIDeviceAddressPtr addr, virDomainPCIConnectFlags flags) { diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 2412ed3..dac73fa 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -150,7 +150,7 @@ int virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, virDomainPCIConnectFlags flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainPCIAddressReserveSlot(virDomainPCIAddressSetPtr addrs, +int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, virPCIDeviceAddressPtr addr, virDomainPCIConnectFlags flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c853f38..eb089a1 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -101,8 +101,8 @@ virDomainPCIAddressEnsureAddr; virDomainPCIAddressFlagsCompatible; virDomainPCIAddressIsMulti; virDomainPCIAddressReleaseSlot; +virDomainPCIAddressReserveAddr; virDomainPCIAddressReserveNextAddr; -virDomainPCIAddressReserveSlot; virDomainPCIAddressSetAlloc; virDomainPCIAddressSetFree; virDomainPCIAddressSetGrow; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index e3c0410..2848733 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -959,7 +959,7 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, } } - if (virDomainPCIAddressReserveSlot(addrs, addr, + if (virDomainPCIAddressReserveAddr(addrs, addr, info->pciConnectFlags) < 0) { goto cleanup; } @@ -1146,7 +1146,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, if (addrs->nbuses) { memset(&tmp_addr, 0, sizeof(tmp_addr)); tmp_addr.slot = 1; - if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) goto cleanup; } @@ -1181,7 +1181,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, goto cleanup; } } else { - if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) goto cleanup; primaryVideo->info.addr.pci = tmp_addr; primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; @@ -1206,7 +1206,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, VIR_DEBUG("PCI address 0:0:2.0 in use, future addition of a video" " device will not be possible without manual" " intervention"); - } else if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) { + } else if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) { goto cleanup; } } @@ -1282,7 +1282,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, assign = true; } if (assign) { - if (virDomainPCIAddressReserveSlot(addrs, + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) { goto cleanup; } @@ -1307,7 +1307,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, memset(&tmp_addr, 0, sizeof(tmp_addr)); tmp_addr.slot = 0x1E; if (!virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) { - if (virDomainPCIAddressReserveSlot(addrs, + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) { goto cleanup; } @@ -1333,12 +1333,12 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, tmp_addr.slot = 0x1F; tmp_addr.function = 0; tmp_addr.multi = VIR_TRISTATE_SWITCH_ON; - if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) goto cleanup; tmp_addr.function = 3; tmp_addr.multi = VIR_TRISTATE_SWITCH_ABSENT; - if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) goto cleanup; } @@ -1372,7 +1372,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, goto cleanup; } } else { - if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) goto cleanup; primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; primaryVideo->info.addr.pci = tmp_addr; @@ -1398,7 +1398,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, " device will not be possible without manual" " intervention"); virResetLastError(); - } else if (virDomainPCIAddressReserveSlot(addrs, + } else if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) { goto cleanup; } @@ -1420,7 +1420,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, !virDeviceInfoPCIAddressWanted(&sound->info)) { continue; } - if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) goto cleanup; sound->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; @@ -1636,7 +1636,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, if (foundAddr) { /* Reserve this function on the slot we found */ - if (virDomainPCIAddressReserveSlot(addrs, &addr, + if (virDomainPCIAddressReserveAddr(addrs, &addr, cont->info.pciConnectFlags) < 0) { goto error; } -- 2.7.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list