mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 06:44:23 +01:00
runtime: Remove unused qemuArchBase.appendBridges definition
qemuArchBase.appendBridges is never actually used, because the bare qemuArchBase type is itself never used (outside of unit tests). Instead *all* the subclasses of qemuArchBase override appendBridges() to call the very similar, but not identical genericAppendBridges. So, we can remove the qemuArchBase.appendBridges implementation. Furthermore, all those subclasses override appendBridges() in exactly the same way, and so we can remove *those* definitions and replace the base class qemuArchBase appendBridges() with that version, calling genericAppendBridges(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
govmmQemu "github.com/kata-containers/govmm/qemu"
|
||||
@@ -456,31 +455,7 @@ func (q *qemuArchBase) appendSCSIController(_ context.Context, devices []govmmQe
|
||||
|
||||
// appendBridges appends to devices the given bridges
|
||||
func (q *qemuArchBase) appendBridges(devices []govmmQemu.Device) []govmmQemu.Device {
|
||||
for idx, b := range q.Bridges {
|
||||
if b.Type == types.CCW {
|
||||
continue
|
||||
}
|
||||
t := govmmQemu.PCIBridge
|
||||
if b.Type == types.PCIE {
|
||||
t = govmmQemu.PCIEBridge
|
||||
}
|
||||
|
||||
q.Bridges[idx].Addr = bridgePCIStartAddr + idx
|
||||
|
||||
devices = append(devices,
|
||||
govmmQemu.BridgeDevice{
|
||||
Type: t,
|
||||
Bus: defaultBridgeBus,
|
||||
ID: b.ID,
|
||||
// Each bridge is required to be assigned a unique chassis id > 0
|
||||
Chassis: idx + 1,
|
||||
SHPC: true,
|
||||
Addr: strconv.FormatInt(int64(q.Bridges[idx].Addr), 10),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
return devices
|
||||
return genericAppendBridges(devices, q.Bridges, q.qemuMachine.Type)
|
||||
}
|
||||
|
||||
func generic9PVolume(volume types.Volume, nestedRun bool) govmmQemu.FSDevice {
|
||||
|
||||
Reference in New Issue
Block a user