Documentation ¶
Index ¶
- Variables
- func FaultFormatMissingDevice(device string) *fault.Fault
- func FaultIpmctlBadVersion(version string) *fault.Fault
- type Backend
- type DIMM
- type DIMMList
- type DIMMs
- type MockBackend
- type MockBackendConfig
- type NdctlRegion
- type NdctlRegions
- type Provider
- func (p *Provider) CheckFormat(req storage.ScmFormatRequest) (*storage.ScmFormatResponse, error)
- func (p *Provider) Format(req storage.ScmFormatRequest) (*storage.ScmFormatResponse, error)
- func (p *Provider) IsMounted(target string) (bool, error)
- func (p *Provider) Mount(req storage.ScmMountRequest) (*storage.MountResponse, error)
- func (p *Provider) Prepare(req storage.ScmPrepareRequest) (*storage.ScmPrepareResponse, error)
- func (p *Provider) QueryFirmware(req storage.ScmFirmwareQueryRequest) (*storage.ScmFirmwareQueryResponse, error)
- func (p *Provider) Scan(req storage.ScmScanRequest) (_ *storage.ScmScanResponse, err error)
- func (p *Provider) Stat(path string) (os.FileInfo, error)
- func (p *Provider) Unmount(req storage.ScmMountRequest) (*storage.MountResponse, error)
- func (p *Provider) UpdateFirmware(req storage.ScmFirmwareUpdateRequest) (*storage.ScmFirmwareUpdateResponse, error)
- type Region
- type RegionList
- type Regions
- type SystemProvider
Constants ¶
This section is empty.
Variables ¶
var ( // FaultUnknown represents an unspecified SCM error. FaultUnknown = scmFault( code.ScmUnknown, "unknown scm error", "", ) // FaultGetModulesFailed represents an SCM discovery failure. FaultGetModulesFailed = scmFault( code.ScmDiscoveryFailed, "module discovery failed", "", ) // FaultFormatInvalidSize represents an error where an invalid SCM format size // was requested. FaultFormatInvalidSize = scmFault( code.ScmFormatInvalidSize, "format request must specify a size greater than 0", "", ) // FaultFormatInvalidDeviceCount represents an error where an invalid number // of SCM devices was requested during format. FaultFormatInvalidDeviceCount = scmFault( code.ScmFormatInvalidDeviceCount, "format request must have exactly 1 dcpm device", "", ) // FaultFormatMissingMountpoint represents an error where a mountpoint // was missing from an SCM format request. FaultFormatMissingMountpoint = scmFault( code.ScmFormatMissingMountpoint, "format request must specify mountpoint", "", ) // FaultFormatMissingParam represents an error where a parameter was missing // from a format request. FaultFormatMissingParam = scmFault( code.ScmFormatMissingParam, "format request must have ramdisk or dcpm parameter", "", ) // FaultFormatConflictingParam represents an error where a format request // had conflicting parameters. FaultFormatConflictingParam = scmFault( code.ScmFormatConflictingParam, "format request must not have both ramdisk and dcpm parameters", "", ) // FaultFormatNoReformat represents an error where a format was requested // on SCM storage that was already formatted. FaultFormatNoReformat = scmFault( code.StorageAlreadyFormatted, "format request for device with an existing filesystem signature", "retry the operation with force option to overwrite existing data", ) // FaultDeviceAlreadyMounted represents an error where a format was requested // on SCM storage that was already mounted on the system. FaultDeviceAlreadyMounted = scmFault( code.StorageDeviceAlreadyMounted, "request included already-mounted device", "unmount the device and retry the operation", ) // FaultMissingNdctl represents an error where the ndctl SCM management tool // is not installed on the system. FaultMissingNdctl = scmFault( code.MissingSoftwareDependency, "ndctl utility not found", "install the ndctl software for your OS", ) // FaultDuplicateDevices represents an error where a user provided duplicate // device IDs in an input. FaultDuplicateDevices = scmFault(code.ScmDuplicatesInDeviceList, "duplicates in SCM device list", "check your device list and try again") // FaultNoFilterMatch represents an error where no modules were found that // matched user-provided filter criteria. FaultNoFilterMatch = scmFault(code.ScmNoDevicesMatchFilter, "no SCM modules matched the filter criteria", "adjust or relax the filters and try again") )
Functions ¶
func FaultFormatMissingDevice ¶
FaultFormatMissingDevice creates a Fault for the case where a requested device was not found.
func FaultIpmctlBadVersion ¶
FaultIpmctlBadVersion represents an error where an incompatible version of ipmctl is installed.
Types ¶
type Backend ¶
type Backend interface { GetFirmwareStatus(deviceUID string) (*storage.ScmFirmwareInfo, error) UpdateFirmware(deviceUID string, firmwarePath string) error // contains filtered or unexported methods }
Backend defines a set of methods to be implemented by a SCM backend.
type DIMM ¶
type DIMM struct { XMLName xml.Name `xml:"Dimm",json:"-"` ID hexShort `xml:"DimmID",json:"dimm_id"` Capacity stringSize `xml:"Capacity",json:"capacity"` HealthState stringPlain `xml:"HealthState",json:"health_state"` FirmwareRevision stringPlain `xml:"FWVersion",json:"fw_version"` PhysicalID hexShort `xml:"PhysicalID",json:"physical_id"` UID stringPlain `xml:"DimmUID",json:"dimm_uid"` SocketID hexShort `xml:"SocketID",json:"socket_id"` ControllerID hexShort `xml:"MemControllerID",json:"mem_controller_id"` ChannelID hexShort `xml:"ChannelID",json:"channel_id"` ChannelPosition uint32 `xml:"ChannelPos",json:"channel_pos"` PartNumber stringPlain `xml:"PartNumber",json:"part_number"` }
DIMM struct represents a PMem AppDirect region.
type MockBackend ¶
type MockBackend struct { sync.RWMutex PrepareCalls []storage.ScmPrepareRequest ResetCalls []storage.ScmPrepareRequest GetModulesCalls []int GetNamespacesCalls []int // contains filtered or unexported fields }
func DefaultMockBackend ¶
func DefaultMockBackend() *MockBackend
func NewMockBackend ¶
func NewMockBackend(cfg *MockBackendConfig) *MockBackend
func (*MockBackend) GetFirmwareStatus ¶
func (mb *MockBackend) GetFirmwareStatus(deviceUID string) (*storage.ScmFirmwareInfo, error)
func (*MockBackend) UpdateFirmware ¶
func (mb *MockBackend) UpdateFirmware(deviceUID string, firmwarePath string) error
type MockBackendConfig ¶
type MockBackendConfig struct { GetModulesRes storage.ScmModules GetModulesErr error GetNamespacesRes storage.ScmNamespaces GetNamespacesErr error PrepRes *storage.ScmPrepareResponse PrepErr error PrepResetRes *storage.ScmPrepareResponse PrepResetErr error GetFirmwareStatusErr error GetFirmwareStatusRes *storage.ScmFirmwareInfo UpdateFirmwareErr error }
MockBackendConfig specifies behavior for a mock SCM backend implementation providing capability to access and configure SCM modules and namespaces.
type NdctlRegion ¶
type NdctlRegions ¶
type NdctlRegions []*NdctlRegion
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider encapsulates configuration and logic for providing SCM management and interrogation.
func DefaultMockProvider ¶
func DefaultProvider ¶
DefaultProvider returns an initialized *Provider suitable for use with production code.
func NewMockProvider ¶
func NewMockProvider(log logging.Logger, mbc *MockBackendConfig, msc *system.MockSysConfig) *Provider
func NewProvider ¶
func NewProvider(log logging.Logger, backend Backend, sys SystemProvider, mounter storage.MountProvider) *Provider
NewProvider returns an initialized *Provider.
func (*Provider) CheckFormat ¶
func (p *Provider) CheckFormat(req storage.ScmFormatRequest) (*storage.ScmFormatResponse, error)
CheckFormat attempts to determine whether or not the SCM specified in the request is already formatted. If it is mounted, it is assumed to be formatted. In the case of DCPM, the device is checked directly for the presence of a filesystem.
func (*Provider) Format ¶
func (p *Provider) Format(req storage.ScmFormatRequest) (*storage.ScmFormatResponse, error)
Format attempts to fulfill the specified SCM format request.
func (*Provider) IsMounted ¶
IsMounted checks to see if the target device or directory is mounted and returns flag to specify whether mounted or a relevant fault.
func (*Provider) Mount ¶
func (p *Provider) Mount(req storage.ScmMountRequest) (*storage.MountResponse, error)
Mount attempts to mount the target specified in the supplied request.
func (*Provider) Prepare ¶
func (p *Provider) Prepare(req storage.ScmPrepareRequest) (*storage.ScmPrepareResponse, error)
Prepare attempts to fulfill a SCM Prepare request.
func (*Provider) QueryFirmware ¶
func (p *Provider) QueryFirmware(req storage.ScmFirmwareQueryRequest) (*storage.ScmFirmwareQueryResponse, error)
QueryFirmware fetches the status of SCM device firmware.
func (*Provider) Scan ¶
func (p *Provider) Scan(req storage.ScmScanRequest) (_ *storage.ScmScanResponse, err error)
Scan attempts to scan the system for SCM storage components.
func (*Provider) Unmount ¶
func (p *Provider) Unmount(req storage.ScmMountRequest) (*storage.MountResponse, error)
Unmount attempts to unmount the target specified in the supplied request.
func (*Provider) UpdateFirmware ¶
func (p *Provider) UpdateFirmware(req storage.ScmFirmwareUpdateRequest) (*storage.ScmFirmwareUpdateResponse, error)
UpdateFirmware updates the SCM device firmware.
type Region ¶
type Region struct { XMLName xml.Name `xml:"Region"` ID regionID `xml:"RegionID"` SocketID regionSocketID `xml:"SocketID"` PersistentMemoryType regionType `xml:"PersistentMemoryType"` Capacity regionCapacity `xml:"Capacity"` FreeCapacity regionCapacity `xml:"FreeCapacity"` Health regionHealth `xml:"HealthState"` ISetID regionISetID `xml:"ISetID"` }
Region struct represents a PMem AppDirect region.
type RegionList ¶
RegionList struct contains all the PMemRegions.
type SystemProvider ¶
type SystemProvider interface { Mkfs(system.MkfsReq) error Getfs(device string) (string, error) Stat(string) (os.FileInfo, error) Chmod(string, os.FileMode) error Chown(string, int, int) error }
SystemProvider defines a set of methods to be implemented by a provider of SCM-specific system capabilities.