Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 58d7623

Browse files
author
Sebastien Boeuf
authored
Merge pull request #434 from stefanha/virtio-fs-core
mount: add virtio-fs mount driver
2 parents 292d0d7 + 42e664f commit 58d7623

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

device.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
const (
2727
driver9pType = "9p"
28+
driverVirtioFSType = "virtio-fs"
2829
driverBlkType = "blk"
2930
driverMmioBlkType = "mmioblk"
3031
driverSCSIType = "scsi"

mount.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
const (
2424
type9pFs = "9p"
25+
typeVirtioFS = "virtio_fs"
2526
typeTmpFs = "tmpfs"
2627
devPrefix = "/dev/"
2728
timeoutHotplug = 3
@@ -98,7 +99,7 @@ func mount(source, destination, fsType string, flags int, options string) error
9899

99100
var err error
100101
switch fsType {
101-
case type9pFs:
102+
case type9pFs, typeVirtioFS:
102103
if err = createDestinationDir(destination); err != nil {
103104
return err
104105
}
@@ -191,6 +192,7 @@ type storageHandler func(storage pb.Storage, s *sandbox) (string, error)
191192
// storageHandlerList lists the supported drivers.
192193
var storageHandlerList = map[string]storageHandler{
193194
driver9pType: virtio9pStorageHandler,
195+
driverVirtioFSType: virtioFSStorageHandler,
194196
driverBlkType: virtioBlkStorageHandler,
195197
driverMmioBlkType: virtioMmioBlkStorageHandler,
196198
driverSCSIType: virtioSCSIStorageHandler,
@@ -223,6 +225,11 @@ func virtioMmioBlkStorageHandler(storage pb.Storage, s *sandbox) (string, error)
223225
return commonStorageHandler(storage)
224226
}
225227

228+
// virtioFSStorageHandler handles the storage for virtio-fs.
229+
func virtioFSStorageHandler(storage pb.Storage, s *sandbox) (string, error) {
230+
return commonStorageHandler(storage)
231+
}
232+
226233
// virtioBlkStorageHandler handles the storage for blk driver.
227234
func virtioBlkStorageHandler(storage pb.Storage, s *sandbox) (string, error) {
228235
// Get the device node path based on the PCI address provided

0 commit comments

Comments
 (0)