diff options
author | Shishir Gowda <sgowda@redhat.com> | 2013-10-24 23:44:29 -0700 |
---|---|---|
committer | Gerrit Code Review <review@dev.gluster.org> | 2013-10-24 23:44:29 -0700 |
commit | bd6089217135aed9aaa4a786590a14fc930ade6d (patch) | |
tree | 4d6b6909d78e424cc37d38d713b33117762869cc | |
parent | bfb9fb693abd868fbb3187bc49598bdf0eba462e (diff) | |
parent | 4618b0f0c9990a21cedeb4363630a572099e34d4 (diff) |
Merge "Snapshot: Added new XDR types" into snap_devel
-rw-r--r-- | rpc/xdr/src/cli1-xdr.h | 8 | ||||
-rw-r--r-- | rpc/xdr/src/cli1-xdr.x | 8 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 39 |
3 files changed, 40 insertions, 15 deletions
diff --git a/rpc/xdr/src/cli1-xdr.h b/rpc/xdr/src/cli1-xdr.h index fb77edb00..20924229c 100644 --- a/rpc/xdr/src/cli1-xdr.h +++ b/rpc/xdr/src/cli1-xdr.h @@ -171,7 +171,13 @@ typedef enum gf_cli_status_type gf_cli_status_type; enum gf1_cli_snapshot { GF_SNAP_OPTION_TYPE_NONE = 0, GF_SNAP_OPTION_TYPE_CREATE = 1, - GF_SNAP_OPTION_TYPE_LIST = 2, + GF_SNAP_OPTION_TYPE_DELETE = 2, + GF_SNAP_OPTION_TYPE_RESTORE = 3, + GF_SNAP_OPTION_TYPE_START = 4, + GF_SNAP_OPTION_TYPE_STOP = 5, + GF_SNAP_OPTION_TYPE_LIST = 6, + GF_SNAP_OPTION_TYPE_STATUS = 7, + GF_SNAP_OPTION_TYPE_CONFIG = 8, }; typedef enum gf1_cli_snapshot gf1_cli_snapshot; diff --git a/rpc/xdr/src/cli1-xdr.x b/rpc/xdr/src/cli1-xdr.x index ed3242fb4..52d088297 100644 --- a/rpc/xdr/src/cli1-xdr.x +++ b/rpc/xdr/src/cli1-xdr.x @@ -125,7 +125,13 @@ enum gf_cli_status_type { enum gf1_cli_snapshot { GF_SNAP_OPTION_TYPE_NONE, GF_SNAP_OPTION_TYPE_CREATE, - GF_SNAP_OPTION_TYPE_LIST + GF_SNAP_OPTION_TYPE_DELETE, + GF_SNAP_OPTION_TYPE_RESTORE, + GF_SNAP_OPTION_TYPE_START, + GF_SNAP_OPTION_TYPE_STOP, + GF_SNAP_OPTION_TYPE_LIST, + GF_SNAP_OPTION_TYPE_STATUS, + GF_SNAP_OPTION_TYPE_CONFIG }; struct gf_cli_req { diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index 48a5b7be7..265e64eac 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -2080,20 +2080,20 @@ out: int32_t glusterd_snapshot (dict_t *dict, char **op_errstr, dict_t *rsp_dict) { - char *name = NULL; - char *volname = NULL; - glusterd_volinfo_t *volinfo = NULL; - int64_t volume_count = 0; - char volname_buf[PATH_MAX] = {0, }; - int i = 0; - int snap_command = 0; - xlator_t *this = NULL; - int ret = -1; - glusterd_snap_cg_t *cg = NULL; - gf_boolean_t is_cg = _gf_false; + int ret = -1; + int i = 0; + int snap_command = 0; + int64_t volume_count = 0; + gf_boolean_t is_cg = _gf_false; + char *name = NULL; + char *volname = NULL; + char *tmp = NULL; + char volname_buf[PATH_MAX] = {0, }; + xlator_t *this = NULL; + glusterd_volinfo_t *volinfo = NULL; + glusterd_snap_cg_t *cg = NULL; + glusterd_conf_t *priv = NULL; uuid_t cg_id; - glusterd_conf_t *priv = NULL; - char *tmp = NULL; this = THIS; @@ -2188,6 +2188,7 @@ glusterd_snapshot (dict_t *dict, char **op_errstr, dict_t *rsp_dict) } break; } + default: gf_log (this->name, GF_LOG_WARNING, "invalid snap command"); goto out; @@ -2302,6 +2303,18 @@ glusterd_handle_snapshot_fn (rpcsvc_request_t *req) case GF_SNAP_OPTION_TYPE_LIST: ret = glusterd_handle_snapshot_list (req, cli_op, dict); break; + case GF_SNAP_OPTION_TYPE_RESTORE: + case GF_SNAP_OPTION_TYPE_DELETE: + case GF_SNAP_OPTION_TYPE_START: + case GF_SNAP_OPTION_TYPE_STOP: + case GF_SNAP_OPTION_TYPE_STATUS: + case GF_SNAP_OPTION_TYPE_CONFIG: + gf_log (this->name, GF_LOG_ERROR, "Operation (%d) not " + "supported ", type); + + ret = -1; /* Failure */ + break; + default: gf_log (this->name, GF_LOG_ERROR, "Unkown snapshot request " "type (%d)", type); |