Skip to content

Commit

Permalink
qemu: remove append9PVolumes
Browse files Browse the repository at this point in the history
It is not used and we actully cannot append multiple 9pfs volumes to
a guest.

Signed-off-by: Peng Tao <[email protected]>
  • Loading branch information
bergwolf committed Jul 19, 2018
1 parent e001061 commit 4ac6754
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 52 deletions.
1 change: 0 additions & 1 deletion virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions virtcontainers/qemu_arch_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
39 changes: 0 additions & 39 deletions virtcontainers/qemu_arch_base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 4ac6754

Please sign in to comment.