mirror of https://github.com/ceph/go-ceph
rbd: add CreateMirrorSnapshot implementing rbd_mirror_image_create_snapshot
This function is used to "manually" trigger a snapshot for snapshot based mirroring. It is needed as a pre-req to test actual cross-cluster mirroring and the full functionality of GetGlobalMirrorStatus. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
0946b9e0e2
commit
f84140356a
|
@ -408,3 +408,16 @@ func (image *Image) GetGlobalMirrorStatus() (GlobalMirrorImageStatus, error) {
|
||||||
}
|
}
|
||||||
return status, nil
|
return status, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateMirrorSnapshot creates a snapshot for image propagation to mirrors.
|
||||||
|
//
|
||||||
|
// Implements:
|
||||||
|
// int rbd_mirror_image_create_snapshot(rbd_image_t image,
|
||||||
|
// uint64_t *snap_id);
|
||||||
|
func (image *Image) CreateMirrorSnapshot() (uint64, error) {
|
||||||
|
var snapID C.uint64_t
|
||||||
|
ret := C.rbd_mirror_image_create_snapshot(
|
||||||
|
image.image,
|
||||||
|
&snapID)
|
||||||
|
return uint64(snapID), getError(ret)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue