summaryrefslogtreecommitdiffstats
path: root/rpc/xdr/src
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-09-20 09:54:12 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-20 10:33:38 -0700
commitad234382336a6f2dafb4cb698dfabbf7957b498b (patch)
tree8cb8c47abb63ea4a5647a5524b688f298017aae9 /rpc/xdr/src
parente71b50e49612af4e76510b0c2a6f0519adfd852d (diff)
cli, mgmt/glusterd: volume sync command
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1310 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1310
Diffstat (limited to 'rpc/xdr/src')
-rw-r--r--rpc/xdr/src/cli1-xdr.c39
-rw-r--r--rpc/xdr/src/cli1-xdr.h25
-rw-r--r--rpc/xdr/src/cli1.c28
-rw-r--r--rpc/xdr/src/cli1.h10
-rw-r--r--rpc/xdr/src/cli1.x18
5 files changed, 117 insertions, 3 deletions
diff --git a/rpc/xdr/src/cli1-xdr.c b/rpc/xdr/src/cli1-xdr.c
index 95c27e99f..93f7e7681 100644
--- a/rpc/xdr/src/cli1-xdr.c
+++ b/rpc/xdr/src/cli1-xdr.c
@@ -62,6 +62,15 @@ xdr_gf1_cli_get_volume (XDR *xdrs, gf1_cli_get_volume *objp)
}
bool_t
+xdr_gf1_cli_sync_volume (XDR *xdrs, gf1_cli_sync_volume *objp)
+{
+
+ if (!xdr_enum (xdrs, (enum_t *) objp))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
xdr_gf1_cli_op_flags (XDR *xdrs, gf1_cli_op_flags *objp)
{
@@ -279,8 +288,8 @@ xdr_gf1_cli_start_vol_rsp (XDR *xdrs, gf1_cli_start_vol_rsp *objp)
return FALSE;
if (!xdr_string (xdrs, &objp->volname, ~0))
return FALSE;
- if (!xdr_string (xdrs, &objp->op_errstr, ~0))
- return FALSE;
+ if (!xdr_string (xdrs, &objp->op_errstr, ~0))
+ return FALSE;
return TRUE;
}
@@ -512,6 +521,19 @@ xdr_gf1_cli_log_locate_req (XDR *xdrs, gf1_cli_log_locate_req *objp)
}
bool_t
+xdr_gf1_cli_sync_volume_req (XDR *xdrs, gf1_cli_sync_volume_req *objp)
+{
+
+ if (!xdr_int (xdrs, &objp->flags))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->volname, ~0))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->hostname, ~0))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
xdr_gf1_cli_log_locate_rsp (XDR *xdrs, gf1_cli_log_locate_rsp *objp)
{
@@ -547,3 +569,16 @@ xdr_gf1_cli_log_rotate_rsp (XDR *xdrs, gf1_cli_log_rotate_rsp *objp)
return FALSE;
return TRUE;
}
+
+bool_t
+xdr_gf1_cli_sync_volume_rsp (XDR *xdrs, gf1_cli_sync_volume_rsp *objp)
+{
+
+ if (!xdr_int (xdrs, &objp->op_ret))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->op_errno))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->op_errstr, ~0))
+ return FALSE;
+ return TRUE;
+}
diff --git a/rpc/xdr/src/cli1-xdr.h b/rpc/xdr/src/cli1-xdr.h
index 1b6145a67..c6d8e8bf5 100644
--- a/rpc/xdr/src/cli1-xdr.h
+++ b/rpc/xdr/src/cli1-xdr.h
@@ -63,6 +63,11 @@ enum gf1_cli_get_volume {
};
typedef enum gf1_cli_get_volume gf1_cli_get_volume;
+enum gf1_cli_sync_volume {
+ GF_CLI_SYNC_ALL = 1,
+};
+typedef enum gf1_cli_sync_volume gf1_cli_sync_volume;
+
enum gf1_cli_op_flags {
GF_CLI_FLAG_OP_FORCE = 1,
};
@@ -311,6 +316,13 @@ struct gf1_cli_log_locate_req {
};
typedef struct gf1_cli_log_locate_req gf1_cli_log_locate_req;
+struct gf1_cli_sync_volume_req {
+ int flags;
+ char *volname;
+ char *hostname;
+};
+typedef struct gf1_cli_sync_volume_req gf1_cli_sync_volume_req;
+
struct gf1_cli_log_locate_rsp {
int op_ret;
int op_errno;
@@ -331,6 +343,13 @@ struct gf1_cli_log_rotate_rsp {
};
typedef struct gf1_cli_log_rotate_rsp gf1_cli_log_rotate_rsp;
+struct gf1_cli_sync_volume_rsp {
+ int op_ret;
+ int op_errno;
+ char *op_errstr;
+};
+typedef struct gf1_cli_sync_volume_rsp gf1_cli_sync_volume_rsp;
+
/* the xdr functions */
#if defined(__STDC__) || defined(__cplusplus)
@@ -338,6 +357,7 @@ extern bool_t xdr_gf1_cluster_type (XDR *, gf1_cluster_type*);
extern bool_t xdr_gf1_cli_replace_op (XDR *, gf1_cli_replace_op*);
extern bool_t xdr_gf1_cli_friends_list (XDR *, gf1_cli_friends_list*);
extern bool_t xdr_gf1_cli_get_volume (XDR *, gf1_cli_get_volume*);
+extern bool_t xdr_gf1_cli_sync_volume (XDR *, gf1_cli_sync_volume*);
extern bool_t xdr_gf1_cli_op_flags (XDR *, gf1_cli_op_flags*);
extern bool_t xdr_gf1_cli_probe_req (XDR *, gf1_cli_probe_req*);
extern bool_t xdr_gf1_cli_probe_rsp (XDR *, gf1_cli_probe_rsp*);
@@ -370,15 +390,18 @@ extern bool_t xdr_gf1_cli_set_vol_rsp (XDR *, gf1_cli_set_vol_rsp*);
extern bool_t xdr_gf1_cli_log_filename_req (XDR *, gf1_cli_log_filename_req*);
extern bool_t xdr_gf1_cli_log_filename_rsp (XDR *, gf1_cli_log_filename_rsp*);
extern bool_t xdr_gf1_cli_log_locate_req (XDR *, gf1_cli_log_locate_req*);
+extern bool_t xdr_gf1_cli_sync_volume_req (XDR *, gf1_cli_sync_volume_req*);
extern bool_t xdr_gf1_cli_log_locate_rsp (XDR *, gf1_cli_log_locate_rsp*);
extern bool_t xdr_gf1_cli_log_rotate_req (XDR *, gf1_cli_log_rotate_req*);
extern bool_t xdr_gf1_cli_log_rotate_rsp (XDR *, gf1_cli_log_rotate_rsp*);
+extern bool_t xdr_gf1_cli_sync_volume_rsp (XDR *, gf1_cli_sync_volume_rsp*);
#else /* K&R C */
extern bool_t xdr_gf1_cluster_type ();
extern bool_t xdr_gf1_cli_replace_op ();
extern bool_t xdr_gf1_cli_friends_list ();
extern bool_t xdr_gf1_cli_get_volume ();
+extern bool_t xdr_gf1_cli_sync_volume ();
extern bool_t xdr_gf1_cli_op_flags ();
extern bool_t xdr_gf1_cli_probe_req ();
extern bool_t xdr_gf1_cli_probe_rsp ();
@@ -411,9 +434,11 @@ extern bool_t xdr_gf1_cli_set_vol_rsp ();
extern bool_t xdr_gf1_cli_log_filename_req ();
extern bool_t xdr_gf1_cli_log_filename_rsp ();
extern bool_t xdr_gf1_cli_log_locate_req ();
+extern bool_t xdr_gf1_cli_sync_volume_req ();
extern bool_t xdr_gf1_cli_log_locate_rsp ();
extern bool_t xdr_gf1_cli_log_rotate_req ();
extern bool_t xdr_gf1_cli_log_rotate_rsp ();
+extern bool_t xdr_gf1_cli_sync_volume_rsp ();
#endif /* K&R C */
diff --git a/rpc/xdr/src/cli1.c b/rpc/xdr/src/cli1.c
index d7ba91aea..22b74fd7d 100644
--- a/rpc/xdr/src/cli1.c
+++ b/rpc/xdr/src/cli1.c
@@ -523,3 +523,31 @@ gf_xdr_from_cli_log_rotate_req (struct iovec outmsg, void *req)
return xdr_serialize_generic (outmsg, (void *)req,
(xdrproc_t)xdr_gf1_cli_log_rotate_req);
}
+
+ssize_t
+gf_xdr_to_cli_sync_volume_req (struct iovec inmsg, void *args)
+{
+ return xdr_to_generic (inmsg, (void *)args,
+ (xdrproc_t)xdr_gf1_cli_sync_volume_req);
+}
+
+ssize_t
+gf_xdr_from_cli_sync_volume_req (struct iovec outmsg, void *args)
+{
+ return xdr_serialize_generic (outmsg, (void *)args,
+ (xdrproc_t)xdr_gf1_cli_sync_volume_req);
+}
+
+ssize_t
+gf_xdr_to_cli_sync_volume_rsp (struct iovec inmsg, void *args)
+{
+ return xdr_to_generic (inmsg, (void *)args,
+ (xdrproc_t)xdr_gf1_cli_sync_volume_rsp);
+}
+
+ssize_t
+gf_xdr_from_cli_sync_volume_rsp (struct iovec outmsg, void *args)
+{
+ return xdr_serialize_generic (outmsg, (void *)args,
+ (xdrproc_t)xdr_gf1_cli_sync_volume_rsp);
+}
diff --git a/rpc/xdr/src/cli1.h b/rpc/xdr/src/cli1.h
index 31b2c9b75..ee2254001 100644
--- a/rpc/xdr/src/cli1.h
+++ b/rpc/xdr/src/cli1.h
@@ -234,6 +234,16 @@ gf_xdr_to_cli_log_rotate_rsp (struct iovec inmsg, void *args);
ssize_t
gf_xdr_from_cli_log_rotate_req (struct iovec outmsg, void *req);
+ssize_t
+gf_xdr_to_cli_sync_volume_req (struct iovec inmsg, void *args);
+
+ssize_t
+gf_xdr_from_cli_sync_volume_req (struct iovec outmsg, void *args);
+ssize_t
+gf_xdr_to_cli_sync_volume_rsp (struct iovec inmsg, void *args);
+
+ssize_t
+gf_xdr_from_cli_sync_volume_rsp (struct iovec outmsg, void *args);
#endif /* !_CLI1_H */
diff --git a/rpc/xdr/src/cli1.x b/rpc/xdr/src/cli1.x
index 03c175e63..3f37f6d75 100644
--- a/rpc/xdr/src/cli1.x
+++ b/rpc/xdr/src/cli1.x
@@ -23,6 +23,10 @@ enum gf1_cli_get_volume {
GF_CLI_GET_NEXT_VOLUME
} ;
+enum gf1_cli_sync_volume {
+ GF_CLI_SYNC_ALL = 1
+} ;
+
enum gf1_cli_op_flags {
GF_CLI_FLAG_OP_FORCE = 1
};
@@ -218,6 +222,12 @@ struct gf1_cli_log_locate_req {
string brick<>;
};
+struct gf1_cli_sync_volume_req {
+ int flags;
+ string volname<>;
+ string hostname<>;
+};
+
struct gf1_cli_log_locate_rsp {
int op_ret;
int op_errno;
@@ -230,7 +240,13 @@ struct gf1_cli_log_rotate_req {
};
struct gf1_cli_log_rotate_rsp {
+ int op_ret;
+ int op_errno;
+ string errstr<>;
+};
+
+struct gf1_cli_sync_volume_rsp {
int op_ret;
int op_errno;
- string errstr<>;
+ string op_errstr<>;
};