- Implement dataset/volume clone promote function

This commit is contained in:
Faruk Kasumovic 2017-03-17 14:22:17 +01:00
parent 07270bcff8
commit 89e00d6218
1 changed files with 12 additions and 0 deletions

12
zfs.go
View File

@ -407,6 +407,18 @@ func (d *Dataset) Rollback(snap *Dataset, force bool) (err error) {
return
}
// Promote promotes dataset clone
func (d *Dataset) Promote() (err error) {
if d.list == nil {
err = errors.New(msgDatasetIsNil)
return
}
if errc := C.zfs_promote(d.list.zh); errc != 0 {
err = LastError()
}
return
}
// Rename dataset
func (d *Dataset) Rename(newName string, recur,
forceUnmount bool) (err error) {