AttachLoopDevice attaches a specified backing file to a loop device
(backingFile string)
| 227 | |
| 228 | // AttachLoopDevice attaches a specified backing file to a loop device |
| 229 | func AttachLoopDevice(backingFile string) (string, error) { |
| 230 | file, err := SetupLoop(backingFile, LoopParams{}) |
| 231 | if err != nil { |
| 232 | return "", err |
| 233 | } |
| 234 | defer file.Close() |
| 235 | return file.Name(), nil |
| 236 | } |
| 237 | |
| 238 | // DetachLoopDevice detaches the provided loop devices |
| 239 | func DetachLoopDevice(devices ...string) error { |
searching dependent graphs…