createDevice creates thin device
(ctx context.Context, info *DeviceInfo)
| 282 | |
| 283 | // createDevice creates thin device |
| 284 | func (p *PoolDevice) createDevice(ctx context.Context, info *DeviceInfo) error { |
| 285 | if err := p.transition(ctx, info.Name, Creating, Created, func() error { |
| 286 | return dmsetup.CreateDevice(p.poolName, info.DeviceID) |
| 287 | }); err != nil { |
| 288 | return fmt.Errorf("failed to create new thin device %q (dev: %d): %w", info.Name, info.DeviceID, err) |
| 289 | } |
| 290 | |
| 291 | return nil |
| 292 | } |
| 293 | |
| 294 | // activateDevice activates thin device |
| 295 | func (p *PoolDevice) activateDevice(ctx context.Context, info *DeviceInfo) error { |
no test coverage detected