summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2013-12-04 04:13:41 +0000
committerAvra Sengupta <asengupt@redhat.com>2013-12-10 23:54:41 +0000
commitdbd515195e5177fe34a12102ba2290cfe2bdc388 (patch)
tree4dbc2c77447e1015b674e00c6f48b907f7cd941f /xlators/mgmt/glusterd/src/glusterd-store.c
parentdb9476c6dd4af75c3f658bc4ee4ce82403eb5fdf (diff)
glusterd/snapshot: Fix Displaying Port, Online Status and Pid for snap vols in volume status
Added a parent_volname member in glusterd_volinfo_ structure to help point the snap vol to the parent volname. Using this to fetch the pidfile location during volume status. Change-Id: I30a16646561394d0f7d16f66abff14c425f31f06 Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index ca3b80ced..88ac2bf6e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -656,6 +656,14 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo)
if (ret)
goto out;
+ snprintf (buf, sizeof (buf), "%s", volinfo->parent_volname);
+ ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_PARENT_VOLNAME, buf);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_ERROR, "Failed to store "
+ GLUSTERD_STORE_KEY_PARENT_VOLNAME);
+ goto out;
+ }
+
ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_VOL_ID,
uuid_utoa (volinfo->volume_id));
if (ret)
@@ -2673,6 +2681,7 @@ glusterd_store_retrieve_volume (char *volname, glusterd_snap_t *snap)
goto out;
while (!ret) {
+ gf_log ("", GF_LOG_DEBUG, "key = %s value = %s", key, value);
if (!strncmp (key, GLUSTERD_STORE_KEY_VOL_TYPE,
strlen (GLUSTERD_STORE_KEY_VOL_TYPE))) {
volinfo->type = atoi (value);
@@ -2744,6 +2753,9 @@ glusterd_store_retrieve_volume (char *volname, glusterd_snap_t *snap)
} else if (!strncmp (key, GLUSTERD_STORE_KEY_SNAP_MAX_LIMIT,
strlen (GLUSTERD_STORE_KEY_SNAP_MAX_LIMIT))) {
volinfo->snap_max_limit = (uint64_t) atoll (value);
+ } else if (!strncmp (key, GLUSTERD_STORE_KEY_PARENT_VOLNAME,
+ strlen (GLUSTERD_STORE_KEY_PARENT_VOLNAME))) {
+ strncpy (volinfo->parent_volname, value, sizeof(volinfo->parent_volname) - 1);
} else {
if (is_key_glusterd_hooks_friendly (key)) {