mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 06:44:23 +01:00
qemu: Remove useless table from qemuArchBase
The supportedQemuMachines array in qemuArchBase has a list of all the qemu machine types supported for the architecture, with the options for each. But, the machineType field already tells us which of the machine types we're actually using, and that's the only entry we actually care about. So, drop the table, and just have a single value with the machine type we're actually using. As a bonus that means the machine() method can no longer fail, so no longer needs an error return. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
@@ -342,7 +342,10 @@ func TestQemuQemuPath(t *testing.T) {
|
||||
qemuConfig := newQemuConfig()
|
||||
qemuConfig.HypervisorPath = expectedPath
|
||||
qkvm := &qemuArchBase{
|
||||
machineType: "pc",
|
||||
qemuMachine: govmmQemu.Machine{
|
||||
Type: "pc",
|
||||
Options: "",
|
||||
},
|
||||
qemuPaths: map[string]string{
|
||||
"pc": expectedPath,
|
||||
},
|
||||
@@ -371,7 +374,7 @@ func TestQemuQemuPath(t *testing.T) {
|
||||
assert.Equal(path, expectedPath)
|
||||
|
||||
// bad machine type, arch should fail
|
||||
qkvm.machineType = "rgb"
|
||||
qkvm.qemuMachine.Type = "rgb"
|
||||
q.arch = qkvm
|
||||
path, err = q.qemuPath()
|
||||
assert.Error(err)
|
||||
|
||||
Reference in New Issue
Block a user