Documentation ¶
Index ¶
- Constants
- type LogicalDeviceHandler
- func (ldh *LogicalDeviceHandler) EnsureDevHeaderMatches(devPath string, imageHash [sha256.Size]byte) (bool, error)
- func (ldh *LogicalDeviceHandler) ListVirtletLogicalDevices() ([]string, error)
- func (ldh *LogicalDeviceHandler) Map(devPath, dmName string, imageSize uint64) error
- func (ldh *LogicalDeviceHandler) Unmap(dmName string) error
Constants ¶
const ( // VirtletLogicalDevicePrefix denotes the required prefix for // the virtual block devices created by Virtlet. VirtletLogicalDevicePrefix = "virtlet-dm-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogicalDeviceHandler ¶
type LogicalDeviceHandler struct {
// contains filtered or unexported fields
}
LogicalDeviceHandler makes it possible to store metadata in the first sector of a block device, making the rest of the device available as another logical device managed by the device mapper.
func NewLogicalDeviceHandler ¶
func NewLogicalDeviceHandler(commander utils.Commander, devPath, sysfsPath string) *LogicalDeviceHandler
NewLogicalDeviceHandler creates a new LogicalDeviceHandler using the specified commander and paths that should be used in place of /dev and /sys directories (empty string to use /dev and /sys, respectively)
func (*LogicalDeviceHandler) EnsureDevHeaderMatches ¶
func (ldh *LogicalDeviceHandler) EnsureDevHeaderMatches(devPath string, imageHash [sha256.Size]byte) (bool, error)
EnsureDevHeaderMatches returns true if the specified block device has proper Virtlet header that matches the specified image hash
func (*LogicalDeviceHandler) ListVirtletLogicalDevices ¶
func (ldh *LogicalDeviceHandler) ListVirtletLogicalDevices() ([]string, error)
ListVirtletLogicalDevices returns a list of logical devices managed by Virtlet
func (*LogicalDeviceHandler) Map ¶
func (ldh *LogicalDeviceHandler) Map(devPath, dmName string, imageSize uint64) error
Map maps the device sectors starting from 1 to a new virtual block device. dmName specifies the name of the new device.
func (*LogicalDeviceHandler) Unmap ¶
func (ldh *LogicalDeviceHandler) Unmap(dmName string) error
Unmap unmaps the virtual block device