diff options
author | Josh Durgin <josh.durgin@inktank.com> | 2012-06-10 23:21:58 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-06-11 09:58:15 -0700 |
commit | 985168348ffb8892a8372f0ace849b6a9c1596fd (patch) | |
tree | 6e0b9fb594dc35c10a775dfc77c5580be9ee8f69 /src/cls_rbd.cc | |
parent | ee7a027b9ddf6f1a9cfb9e11016cc6002629dd13 (diff) | |
download | ceph-985168348ffb8892a8372f0ace849b6a9c1596fd.tar.gz |
cls_rbd: add get_all_features method
This is useful for reporting which features an osd supports, and for
testing rados_exec. Update the rados api tests to use this method
instead of test_exec, which was removed.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/cls_rbd.cc')
-rw-r--r-- | src/cls_rbd.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cls_rbd.cc b/src/cls_rbd.cc index 46c78fcb6be..f90a0531e2d 100644 --- a/src/cls_rbd.cc +++ b/src/cls_rbd.cc @@ -53,6 +53,7 @@ cls_method_handle_t h_get_object_prefix; cls_method_handle_t h_get_snapshot_name; cls_method_handle_t h_snapshot_add; cls_method_handle_t h_snapshot_remove; +cls_method_handle_t h_get_all_features; cls_method_handle_t h_old_snapshots_list; cls_method_handle_t h_old_snapshot_add; cls_method_handle_t h_old_snapshot_remove; @@ -616,6 +617,16 @@ int snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out) return 0; } +/** + * Returns a uint64_t of all the features supported by this class. + */ +int get_all_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out) +{ + uint64_t all_features = RBD_FEATURES_ALL; + ::encode(all_features, *out); + return 0; +} + /****************************** Old format *******************************/ int old_snapshots_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) @@ -887,6 +898,9 @@ void __cls_init() cls_register_cxx_method(h_class, "snapshot_remove", CLS_METHOD_RD | CLS_METHOD_WR | CLS_METHOD_PUBLIC, snapshot_remove, &h_snapshot_remove); + cls_register_cxx_method(h_class, "get_all_features", + CLS_METHOD_RD | CLS_METHOD_PUBLIC, + get_all_features, &h_get_all_features); /* methods for the old format */ cls_register_cxx_method(h_class, "snap_list", |