mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
conf: Move virDomainPCIAddressBusIsFullyReserved()
This function was private to the QEMU driver and was, accordingly, called qemuDomainPCIBusFullyReserved(). However the function is really not QEMU-specific at all, so it makes sense to move it closer to the virDomainPCIAddressBus struct it operates on. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Laine Stump <laine@laine.org>
This commit is contained in:
parent
b6c6b0ba46
commit
c79f97c83c
@ -355,6 +355,20 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = bus->minSlot; i <= bus->maxSlot; i++) {
|
||||||
|
if (!bus->slot[i].functions)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Ensure addr fits in the address set, by expanding it if needed
|
/* Ensure addr fits in the address set, by expanding it if needed
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
|
@ -141,6 +141,9 @@ int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
|
|||||||
virDomainControllerModelPCI model)
|
virDomainControllerModelPCI model)
|
||||||
ATTRIBUTE_NONNULL(1);
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
|
bool virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus)
|
||||||
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs,
|
bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs,
|
||||||
virPCIDeviceAddressPtr addr)
|
virPCIDeviceAddressPtr addr)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
@ -106,6 +106,7 @@ virDomainCCWAddressSetFree;
|
|||||||
virDomainCCWAddressValidate;
|
virDomainCCWAddressValidate;
|
||||||
virDomainGetBlkioParametersAssignFromDef;
|
virDomainGetBlkioParametersAssignFromDef;
|
||||||
virDomainPCIAddressAsString;
|
virDomainPCIAddressAsString;
|
||||||
|
virDomainPCIAddressBusIsFullyReserved;
|
||||||
virDomainPCIAddressBusSetModel;
|
virDomainPCIAddressBusSetModel;
|
||||||
virDomainPCIAddressEnsureAddr;
|
virDomainPCIAddressEnsureAddr;
|
||||||
virDomainPCIAddressFlagsCompatible;
|
virDomainPCIAddressFlagsCompatible;
|
||||||
|
@ -1499,19 +1499,6 @@ qemuDomainValidateDevicePCISlotsChipsets(virDomainDefPtr def,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
|
||||||
qemuDomainPCIBusFullyReserved(virDomainPCIAddressBusPtr bus)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for (i = bus->minSlot; i <= bus->maxSlot; i++)
|
|
||||||
if (!bus->slot[i].functions)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This assigns static PCI slots to all configured devices.
|
* This assigns static PCI slots to all configured devices.
|
||||||
* The ordering here is chosen to match the ordering used
|
* The ordering here is chosen to match the ordering used
|
||||||
@ -2043,7 +2030,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
|
|||||||
bool buses_reserved = true;
|
bool buses_reserved = true;
|
||||||
|
|
||||||
for (i = 0; i < addrs->nbuses; i++) {
|
for (i = 0; i < addrs->nbuses; i++) {
|
||||||
if (!qemuDomainPCIBusFullyReserved(&addrs->buses[i])) {
|
if (!virDomainPCIAddressBusIsFullyReserved(&addrs->buses[i])) {
|
||||||
buses_reserved = false;
|
buses_reserved = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user