MCPcopy Index your code
hub / github.com/containerd/containerd / activateDevice

Method activateDevice

plugins/snapshots/devmapper/pool_device.go:295–303  ·  view source on GitHub ↗

activateDevice activates thin device

(ctx context.Context, info *DeviceInfo)

Source from the content-addressed store, hash-verified

293
294// activateDevice activates thin device
295func (p *PoolDevice) activateDevice(ctx context.Context, info *DeviceInfo) error {
296 if err := p.transition(ctx, info.Name, Activating, Activated, func() error {
297 return dmsetup.ActivateDevice(p.poolName, info.Name, info.DeviceID, info.Size, "")
298 }); err != nil {
299 return fmt.Errorf("failed to activate new thin device %q (dev: %d): %w", info.Name, info.DeviceID, err)
300 }
301
302 return nil
303}
304
305// CreateSnapshotDevice creates and activates new thin-device from parent thin-device (makes snapshot)
306func (p *PoolDevice) CreateSnapshotDevice(ctx context.Context, deviceName string, snapshotName string, virtualSizeBytes uint64) (retErr error) {

Callers 3

ensureDeviceStatesMethod · 0.95
CreateThinDeviceMethod · 0.95
CreateSnapshotDeviceMethod · 0.95

Calls 2

transitionMethod · 0.95
ActivateDeviceFunction · 0.92

Tested by

no test coverage detected