qemu: remove append9PVolumes

It is not used and we actully cannot append multiple 9pfs volumes to
a guest.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
Peng Tao 2018-07-13 18:07:28 +08:00
parent e0010619fc
commit 4ac675453f
3 changed files with 0 additions and 52 deletions

View File

@ -359,7 +359,6 @@ func (q *qemu) createSandbox(sandboxConfig SandboxConfig) error {
// bridge gets the first available PCI address i.e bridgePCIStartAddr
devices = q.arch.appendBridges(devices, q.state.Bridges)
devices = q.arch.append9PVolumes(devices, sandboxConfig.Volumes)
console, err := q.getSandboxConsole(sandboxConfig.ID)
if err != nil {
return err

View File

@ -50,9 +50,6 @@ type qemuArch interface {
// memoryTopology returns the memory topology using the given amount of memoryMb and hostMemoryMb
memoryTopology(memoryMb, hostMemoryMb uint64) govmmQemu.Memory
// append9PVolumes appends volumes to devices
append9PVolumes(devices []govmmQemu.Device, volumes []Volume) []govmmQemu.Device
// appendConsole appends a console to devices
appendConsole(devices []govmmQemu.Device, path string) []govmmQemu.Device
@ -253,15 +250,6 @@ func (q *qemuArchBase) memoryTopology(memoryMb, hostMemoryMb uint64) govmmQemu.M
return memory
}
func (q *qemuArchBase) append9PVolumes(devices []govmmQemu.Device, volumes []Volume) []govmmQemu.Device {
// Add the shared volumes
for _, v := range volumes {
devices = q.append9PVolume(devices, v)
}
return devices
}
func (q *qemuArchBase) appendConsole(devices []govmmQemu.Device, path string) []govmmQemu.Device {
serial := govmmQemu.SerialDevice{
Driver: govmmQemu.VirtioSerial,

View File

@ -206,8 +206,6 @@ func testQemuArchBaseAppend(t *testing.T, structure interface{}, expected []govm
devices = qemuArchBase.append9PVolume(devices, s)
case Socket:
devices = qemuArchBase.appendSocket(devices, s)
case []Volume:
devices = qemuArchBase.append9PVolumes(devices, s)
case drivers.Drive:
devices = qemuArchBase.appendBlockDevice(devices, s)
case drivers.VFIODevice:
@ -219,43 +217,6 @@ func testQemuArchBaseAppend(t *testing.T, structure interface{}, expected []govm
assert.Equal(devices, expected)
}
func TestQemuArchBaseAppend9PVolumes(t *testing.T) {
volMountTag := "testVolMountTag"
volHostPath := "testVolHostPath"
expectedOut := []govmmQemu.Device{
govmmQemu.FSDevice{
Driver: govmmQemu.Virtio9P,
FSDriver: govmmQemu.Local,
ID: fmt.Sprintf("extra-9p-%s", fmt.Sprintf("%s.1", volMountTag)),
Path: fmt.Sprintf("%s.1", volHostPath),
MountTag: fmt.Sprintf("%s.1", volMountTag),
SecurityModel: govmmQemu.None,
},
govmmQemu.FSDevice{
Driver: govmmQemu.Virtio9P,
FSDriver: govmmQemu.Local,
ID: fmt.Sprintf("extra-9p-%s", fmt.Sprintf("%s.2", volMountTag)),
Path: fmt.Sprintf("%s.2", volHostPath),
MountTag: fmt.Sprintf("%s.2", volMountTag),
SecurityModel: govmmQemu.None,
},
}
volumes := []Volume{
{
MountTag: fmt.Sprintf("%s.1", volMountTag),
HostPath: fmt.Sprintf("%s.1", volHostPath),
},
{
MountTag: fmt.Sprintf("%s.2", volMountTag),
HostPath: fmt.Sprintf("%s.2", volHostPath),
},
}
testQemuArchBaseAppend(t, volumes, expectedOut)
}
func TestQemuArchBaseAppendConsoles(t *testing.T) {
var devices []govmmQemu.Device
assert := assert.New(t)