Skip to content

Commit

Permalink
rbd: promote preview API for release v0.23.0
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Anderson <[email protected]>
  • Loading branch information
ansiwen committed Aug 14, 2023
1 parent 988ade7 commit b76632d
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 72 deletions.
50 changes: 25 additions & 25 deletions docs/api-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -1828,75 +1828,75 @@
"comment": "MigrationStatus retrieve status of a live migration\nfor the specified image.\n\nImplements:\n\n\tint rbd_migration_status(rados_ioctx_t ioctx,\n\t const char *image_name,\n\t rbd_image_migration_status_t *status,\n\t size_t status_size);\n",
"added_in_version": "v0.20.0",
"became_stable_version": "v0.22.0"
}
],
"preview_api": [
},
{
"name": "SiteMirrorImageStatus.UnmarshalDescriptionJSON",
"comment": "UnmarshalDescriptionJSON parses an embedded JSON string that may be found in\nthe description of the SiteMirrorImageStatus. It will store the result in\nthe value pointed to by v. If no embedded JSON string is found an\nErrNotExist error is returned. An error may also be returned if the contents\ncan not be parsed.\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "SiteMirrorImageStatus.DescriptionReplayStatus",
"comment": "DescriptionReplayStatus parses a MirrorDescriptionReplayStatus result out of\nthe image status description field if available. If the embedded status JSON\nis not found or fails to parse and error will be returned.\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "AddMirrorPeerSite",
"comment": "AddMirrorPeerSite adds a peer site to the list of existing sites.\n",
"comment": "AddMirrorPeerSite adds a peer site to the list of existing sites\n\nImplements:\n\n\tint rbd_mirror_peer_site_add(rados_ioctx_t p, char *uuid, size_t uuid_max_length,\n\t\t\t\t\t\t\t\t rbd_mirror_peer_direction_t direction,\n\t\t\t\t\t\t\t\t const char *site_name,\n\t\t\t\t\t\t\t\t const char *client_name);\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "RemoveMirrorPeerSite",
"comment": "RemoveMirrorPeerSite removes the site with the provided uuid.\n",
"comment": "RemoveMirrorPeerSite removes the site with the provided uuid\n\nImplements:\n\n\tint rbd_mirror_peer_site_remove(rados_ioctx_t p, const char *uuid)\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "GetAttributesMirrorPeerSite",
"comment": "GetAttributesMirrorPeerSite fetches the list of key,value pair of attributes of a peer site.\n",
"comment": "GetAttributesMirrorPeerSite fetches the list of key,value pair of attributes of a peer site\n\nImplements:\n\n\tint rbd_mirror_peer_site_get_attributes(rados_ioctx_t p, const char *uuid, char *keys,\n\t\t\t\t\t\t\t\t\t\t\tsize_t *max_key_len, char *values, size_t *max_val_len,\n\t\t\t\t\t\t\t\t\t\t\tsize_t *key_value_count);\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "SetAttributesMirrorPeerSite",
"comment": "SetAttributesMirrorPeerSite sets the attributes for the site with the given uuid.\n",
"comment": "SetAttributesMirrorPeerSite sets the attributes for the site with the given uuid\n\nImplements:\n\n\tint rbd_mirror_peer_site_set_attributes(rados_ioctx_t p, const char *uuid,\n\t\t\t\t\t\t\t\t\t\t\tconst char *keys, const char *values,\n\t\t\t\t\t\t\t\t\t\t\tsize_t count) ;\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "ListMirrorPeerSite",
"comment": "ListMirrorPeerSite returns the list of peer sites.\n",
"comment": "ListMirrorPeerSite returns the list of peer sites\n\nImplements:\n\n\tint rbd_mirror_peer_site_list(rados_ioctx_t p, rbd_mirror_peer_site_t *peers, int *max_peers)\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "SetMirrorPeerSiteClientName",
"comment": "SetMirrorPeerSiteClientName sets the client name of a mirror peer site.\n",
"comment": "SetMirrorPeerSiteClientName sets the client name for a mirror peer site\n\nImplements:\n\n\tint rbd_mirror_peer_site_set_client_name(rados_ioctx_t p, const char *uuid,\n\t\t\t\t\t\t\t\t\t\t\t const char *client_name);\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "SetMirrorPeerSiteName",
"comment": "SetMirrorPeerSiteName sets the site name of a mirror peer site.\n",
"name": "SetMirrorPeerSiteDirection",
"comment": "SetMirrorPeerSiteDirection sets the direction of a mirror peer site\n\nImplements:\n\n\tint rbd_mirror_peer_site_set_direction(rados_ioctx_t p, const char *uuid,\n\t\t\t\t\t\t\t\t\t\t rbd_mirror_peer_direction_t direction);\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "SetMirrorPeerSiteDirection",
"comment": "SetMirrorPeerSiteDirection sets the direction of a mirror peer site.\n",
"name": "SetMirrorPeerSiteName",
"comment": "SetMirrorPeerSiteName sets the name of a mirror peer site\n\nImplements:\n\n\tint rbd_mirror_peer_site_set_name(rados_ioctx_t p, const char *uuid,\n\t\t\t\t\t\t\t\t\t const char *site_name);\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
"became_stable_version": "v0.23.0"
},
{
"name": "Image.SparsifyWithProgress",
"comment": "SparsifyWithProgress makes an image sparse by deallocating runs of zeros.\nThe sparseSize value will be used to find runs of zeros and must be\na power of two no less than 4096 and no larger than the image size.\nThe given progress callback will be called to report on the progress\nof sparse. The operation will be aborted if the progress callback returns\na non-zero value.\n\nImplements:\n\n\tint rbd_sparsify_with_progress(rbd_image_t image, size_t sparse_size,\n\t\t\t\t\t\t\t\t librbd_progress_fn_t cb, void *cbdata);\n",
"added_in_version": "v0.21.0",
"expected_stable_version": "v0.23.0"
},
"became_stable_version": "v0.23.0"
}
],
"preview_api": [
{
"name": "Image.LockAcquire",
"comment": "LockAcquire takes a lock on the given image as per the provided lock_mode.\n\nImplements:\n\n\tint rbd_lock_acquire(rbd_image_t image, rbd_lock_mode_t lock_mode);\n",
Expand Down
11 changes: 0 additions & 11 deletions docs/api-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ No Preview/Deprecated APIs found. All APIs are considered stable.

Name | Added in Version | Expected Stable Version |
---- | ---------------- | ----------------------- |
SiteMirrorImageStatus.UnmarshalDescriptionJSON | v0.21.0 | v0.23.0 |
SiteMirrorImageStatus.DescriptionReplayStatus | v0.21.0 | v0.23.0 |
AddMirrorPeerSite | v0.21.0 | v0.23.0 |
RemoveMirrorPeerSite | v0.21.0 | v0.23.0 |
GetAttributesMirrorPeerSite | v0.21.0 | v0.23.0 |
SetAttributesMirrorPeerSite | v0.21.0 | v0.23.0 |
ListMirrorPeerSite | v0.21.0 | v0.23.0 |
SetMirrorPeerSiteClientName | v0.21.0 | v0.23.0 |
SetMirrorPeerSiteName | v0.21.0 | v0.23.0 |
SetMirrorPeerSiteDirection | v0.21.0 | v0.23.0 |
Image.SparsifyWithProgress | v0.21.0 | v0.23.0 |
Image.LockAcquire | v0.22.0 | v0.24.0 |
Image.LockBreak | v0.22.0 | v0.24.0 |
Image.LockGetOwners | v0.22.0 | v0.24.0 |
Expand Down
7 changes: 4 additions & 3 deletions rbd/mirror_desc_status.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview
//go:build !nautilus
// +build !nautilus

package rbd

Expand Down Expand Up @@ -61,7 +61,8 @@ func (s *SiteMirrorImageStatus) UnmarshalDescriptionJSON(v interface{}) error {
// the image status description field if available. If the embedded status JSON
// is not found or fails to parse and error will be returned.
func (s *SiteMirrorImageStatus) DescriptionReplayStatus() (
*MirrorDescriptionReplayStatus, error) {
*MirrorDescriptionReplayStatus, error,
) {
// ---
mdrs := MirrorDescriptionReplayStatus{}
if err := s.UnmarshalDescriptionJSON(&mdrs); err != nil {
Expand Down
7 changes: 2 additions & 5 deletions rbd/mirror_desc_status_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview

// IMPORTANT - when removing ceph_preview from this file also delete
// rbd/mirror_stub_test.go as it will no longer serve a purpose.
//go:build !nautilus
// +build !nautilus

package rbd

Expand Down
9 changes: 4 additions & 5 deletions rbd/mirror_peer_site.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview
//go:build !nautilus
// +build !nautilus

package rbd

Expand All @@ -26,8 +26,8 @@ import (
// const char *site_name,
// const char *client_name);
func AddMirrorPeerSite(ioctx *rados.IOContext, siteName string, clientName string,
direction MirrorPeerDirection) (string, error) {

direction MirrorPeerDirection,
) (string, error) {
var (
err error
buf []byte
Expand Down Expand Up @@ -78,7 +78,6 @@ func RemoveMirrorPeerSite(ioctx *rados.IOContext, uuid string) error {
// size_t *max_key_len, char *values, size_t *max_val_len,
// size_t *key_value_count);
func GetAttributesMirrorPeerSite(ioctx *rados.IOContext, uuid string) (map[string]string, error) {

var (
err error
keys []byte
Expand Down
4 changes: 2 additions & 2 deletions rbd/mirror_peer_site_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview
//go:build !nautilus
// +build !nautilus

package rbd

Expand Down
14 changes: 0 additions & 14 deletions rbd/mirror_stub_test.go

This file was deleted.

11 changes: 6 additions & 5 deletions rbd/sparsify.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview
//go:build !nautilus
// +build !nautilus

package rbd

Expand Down Expand Up @@ -56,7 +56,8 @@ type sparsifyCallbackCtx struct {
// int rbd_sparsify_with_progress(rbd_image_t image, size_t sparse_size,
// librbd_progress_fn_t cb, void *cbdata);
func (image *Image) SparsifyWithProgress(
sparseSize uint, cb SparsifyCallback, data interface{}) error {
sparseSize uint, cb SparsifyCallback, data interface{},
) error {
// the provided callback must be a real function
if cb == nil {
return rbdError(C.EINVAL)
Expand All @@ -80,8 +81,8 @@ func (image *Image) SparsifyWithProgress(

//export sparsifyCallback
func sparsifyCallback(
offset, total C.uint64_t, index uintptr) C.int {

offset, total C.uint64_t, index uintptr,
) C.int {
v := sparsifyCallbacks.Lookup(index)
ctx := v.(sparsifyCallbackCtx)
return C.int(ctx.callback(uint64(offset), uint64(total), ctx.data))
Expand Down
4 changes: 2 additions & 2 deletions rbd/sparsify_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !nautilus && ceph_preview
// +build !nautilus,ceph_preview
//go:build !nautilus
// +build !nautilus

package rbd

Expand Down

0 comments on commit b76632d

Please sign in to comment.