mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 06:44:23 +01:00
qemu: Only one element of qemuPaths map is relevant
The qemuPaths field in qemuArchBase maps from machine type to the default qemu path. But, by the time we construct it, we already know the machine type, so that entry ends up being the only one we care about. So, collapse the map into a single path. As a bonus, the qemuPath() method can no longer fail. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
@@ -346,9 +346,7 @@ func TestQemuQemuPath(t *testing.T) {
|
||||
Type: "pc",
|
||||
Options: "",
|
||||
},
|
||||
qemuPaths: map[string]string{
|
||||
"pc": expectedPath,
|
||||
},
|
||||
qemuExePath: expectedPath,
|
||||
}
|
||||
|
||||
q := &qemu{
|
||||
@@ -372,13 +370,6 @@ func TestQemuQemuPath(t *testing.T) {
|
||||
path, err = q.qemuPath()
|
||||
assert.NoError(err)
|
||||
assert.Equal(path, expectedPath)
|
||||
|
||||
// bad machine type, arch should fail
|
||||
qkvm.qemuMachine.Type = "rgb"
|
||||
q.arch = qkvm
|
||||
path, err = q.qemuPath()
|
||||
assert.Error(err)
|
||||
assert.Equal(path, "")
|
||||
}
|
||||
|
||||
func TestHotplugUnsupportedDeviceType(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user