activateDevice activates thin device
(ctx context.Context, info *DeviceInfo)
| 293 | |
| 294 | // activateDevice activates thin device |
| 295 | func (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) |
| 306 | func (p *PoolDevice) CreateSnapshotDevice(ctx context.Context, deviceName string, snapshotName string, virtualSizeBytes uint64) (retErr error) { |
no test coverage detected