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

Commit

Permalink
block: add support of block storage driver "nvdimm"
Browse files Browse the repository at this point in the history
Support the block storage driver "nvdimm".

Fixes: #426

Signed-off-by: Hui Zhu <teawater@hyper.sh>
  • Loading branch information
teawater committed Dec 5, 2018
1 parent 0ff3006 commit 092f1a0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions device.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
driver9pType = "9p"
driverBlkType = "blk"
driverSCSIType = "scsi"
driverNvdimmType = "nvdimm"
driverEphemeralType = "ephemeral"
)

Expand Down Expand Up @@ -58,8 +59,9 @@ var (
type deviceHandler func(device pb.Device, spec *pb.Spec, s *sandbox) error

var deviceHandlerList = map[string]deviceHandler{
driverBlkType: virtioBlkDeviceHandler,
driverSCSIType: virtioSCSIDeviceHandler,
driverBlkType: virtioBlkDeviceHandler,
driverSCSIType: virtioSCSIDeviceHandler,
driverNvdimmType: nvdimmDeviceHandler,
}

func rescanPciBus() error {
Expand Down Expand Up @@ -192,6 +194,10 @@ func virtioSCSIDeviceHandler(device pb.Device, spec *pb.Spec, s *sandbox) error
return updateSpecDeviceList(device, spec)
}

func nvdimmDeviceHandler(device pb.Device, spec *pb.Spec, s *sandbox) error {
return updateSpecDeviceList(device, spec)
}

// updateSpecDeviceList takes a device description provided by the caller,
// trying to find it on the guest. Once this device has been identified, the
// "real" information that can be read from inside the VM is used to update
Expand Down

0 comments on commit 092f1a0

Please sign in to comment.