govmm/qemu: Let IO/memory reservations be specified for bridge devices

This adds fields to BridgeDevice struct to allow qemu's io-reserve,
mem-reserve and pref64-reserve properties to be set for PCI bridges.
This is needed for Kata's upcoming change to ACPI hotplug.

fixes #200

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson
2021-09-08 11:48:52 +10:00
parent 2f8e417bb2
commit de039da2a9
3 changed files with 39 additions and 0 deletions

View File

@@ -486,6 +486,24 @@ func TestAppendPCIBridgeDevice(t *testing.T) {
testAppend(bridge, devicePCIBridgeString, t)
}
func TestAppendPCIBridgeDeviceWithReservations(t *testing.T) {
bridge := BridgeDevice{
Type: PCIBridge,
ID: "mybridge",
Bus: "/pci-bus/pcie.0",
Addr: "255",
Chassis: 5,
SHPC: false,
ROMFile: romfile,
IOReserve: "4k",
MemReserve: "1m",
Pref64Reserve: "1m",
}
testAppend(bridge, devicePCIBridgeStringReserved, t)
}
func TestAppendPCIEBridgeDevice(t *testing.T) {
bridge := BridgeDevice{