mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-16 16:32:03 +00: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:
parent
e248de4616
commit
cc4983eeac
@ -193,11 +193,6 @@ func (q *qemuAmd64) appendImage(ctx context.Context, devices []govmmQemu.Device,
|
||||
return q.appendBlockImage(ctx, devices, path)
|
||||
}
|
||||
|
||||
// appendBridges appends to devices the given bridges
|
||||
func (q *qemuAmd64) appendBridges(devices []govmmQemu.Device) []govmmQemu.Device {
|
||||
return genericAppendBridges(devices, q.Bridges, q.qemuMachine.Type)
|
||||
}
|
||||
|
||||
// enable protection
|
||||
func (q *qemuAmd64) enableProtection() error {
|
||||
var err error
|
||||
|
@ -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 {
|
||||
|
@ -89,11 +89,6 @@ func (q *qemuArm64) bridges(number uint32) {
|
||||
q.Bridges = genericBridges(number, q.qemuMachine.Type)
|
||||
}
|
||||
|
||||
// appendBridges appends to devices the given bridges
|
||||
func (q *qemuArm64) appendBridges(devices []govmmQemu.Device) []govmmQemu.Device {
|
||||
return genericAppendBridges(devices, q.Bridges, q.qemuMachine.Type)
|
||||
}
|
||||
|
||||
func (q *qemuArm64) appendImage(ctx context.Context, devices []govmmQemu.Device, path string) ([]govmmQemu.Device, error) {
|
||||
if !q.disableNvdimm {
|
||||
return q.appendNvdimmImage(devices, path)
|
||||
|
@ -123,11 +123,6 @@ func (q *qemuPPC64le) memoryTopology(memoryMb, hostMemoryMb uint64, slots uint8)
|
||||
return genericMemoryTopology(memoryMb, hostMemoryMb, slots, q.memoryOffset)
|
||||
}
|
||||
|
||||
// appendBridges appends to devices the given bridges
|
||||
func (q *qemuPPC64le) appendBridges(devices []govmmQemu.Device) []govmmQemu.Device {
|
||||
return genericAppendBridges(devices, q.Bridges, q.qemuMachine.Type)
|
||||
}
|
||||
|
||||
func (q *qemuPPC64le) appendIOMMU(devices []govmmQemu.Device) ([]govmmQemu.Device, error) {
|
||||
return devices, fmt.Errorf("PPC64le does not support appending a vIOMMU")
|
||||
}
|
||||
|
@ -256,11 +256,6 @@ func (q *qemuS390x) append9PVolume(ctx context.Context, devices []govmmQemu.Devi
|
||||
return devices, nil
|
||||
}
|
||||
|
||||
// appendBridges appends to devices the given bridges
|
||||
func (q *qemuS390x) appendBridges(devices []govmmQemu.Device) []govmmQemu.Device {
|
||||
return genericAppendBridges(devices, q.Bridges, q.qemuMachine.Type)
|
||||
}
|
||||
|
||||
func (q *qemuS390x) appendSCSIController(ctx context.Context, devices []govmmQemu.Device, enableIOThreads bool) ([]govmmQemu.Device, *govmmQemu.IOThread, error) {
|
||||
d, t := genericSCSIController(enableIOThreads, q.nestedRun)
|
||||
addr, b, err := q.addDeviceToBridge(ctx, d.ID, types.CCW)
|
||||
|
Loading…
Reference in New Issue
Block a user