From 89e00d621882a0d6e2603f640e8c0719bf150d32 Mon Sep 17 00:00:00 2001 From: Faruk Kasumovic Date: Fri, 17 Mar 2017 14:22:17 +0100 Subject: [PATCH] - Implement dataset/volume clone promote function --- zfs.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zfs.go b/zfs.go index 10a69f1..2be0be1 100644 --- a/zfs.go +++ b/zfs.go @@ -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) {