From 538bae4ccaa760c53d15245df899f45674d975b6 Mon Sep 17 00:00:00 2001
From: Tim Wickberg <tim@schedmd.com>
Date: Wed, 30 Aug 2017 15:24:18 -0600
Subject: [PATCH] Remove z_16, z_32, z_str from slurm_ctl_conf_t.

Stop unpacking / packing it as well.
---
 slurm/slurm.h.in                 |  3 ---
 src/common/read_config.c         |  1 -
 src/common/slurm_protocol_pack.c | 39 ++++++++++++++------------------
 3 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in
index 0d06aada00b..fdff8b197c2 100644
--- a/slurm/slurm.h.in
+++ b/slurm/slurm.h.in
@@ -2896,9 +2896,6 @@ typedef struct slurm_ctl_conf {
 	char *version;		/* version of slurmctld */
 	uint16_t vsize_factor;	/* virtual memory limit size factor */
 	uint16_t wait_time;	/* default job --wait time */
-	uint16_t z_16;		/* reserved for future use */
-	uint32_t z_32;		/* reserved for future use */
-	char *z_char;		/* reserved for future use */
 } slurm_ctl_conf_t;
 
 typedef struct slurmd_status_msg {
diff --git a/src/common/read_config.c b/src/common/read_config.c
index aa085e201fc..bad330ee6e1 100644
--- a/src/common/read_config.c
+++ b/src/common/read_config.c
@@ -2424,7 +2424,6 @@ free_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr, bool purge_node_hash)
 	xfree (ctl_conf_ptr->topology_plugin);
 	xfree (ctl_conf_ptr->unkillable_program);
 	xfree (ctl_conf_ptr->version);
-	xfree (ctl_conf_ptr->z_char);
 
 	if (purge_node_hash)
 		_free_name_hashtbl();
diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c
index bd370dad360..f063082c7d2 100644
--- a/src/common/slurm_protocol_pack.c
+++ b/src/common/slurm_protocol_pack.c
@@ -6630,9 +6630,6 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->vsize_factor, buffer);
 
 		pack16(build_ptr->wait_time, buffer);
-		pack16(build_ptr->z_16, buffer);
-		pack32(build_ptr->z_32, buffer);
-		packstr(build_ptr->z_char, buffer);
 	} else if (protocol_version >= SLURM_17_02_PROTOCOL_VERSION) {
 		pack_time(build_ptr->last_update, buffer);
 
@@ -6912,9 +6909,9 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->vsize_factor, buffer);
 
 		pack16(build_ptr->wait_time, buffer);
-		pack16(build_ptr->z_16, buffer);
-		pack32(build_ptr->z_32, buffer);
-		packstr(build_ptr->z_char, buffer);
+		pack16(0, buffer);
+		pack32(0, buffer);
+		packnull(buffer);
 	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack_time(build_ptr->last_update, buffer);
 
@@ -7195,9 +7192,9 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->vsize_factor, buffer);
 
 		pack16(build_ptr->wait_time, buffer);
-		pack16(build_ptr->z_16, buffer);
-		pack32(build_ptr->z_32, buffer);
-		packstr(build_ptr->z_char, buffer);
+		pack16(0, buffer);
+		pack32(0, buffer);
+		packnull(buffer);
 	} else {
 		error("_pack_slurm_ctl_conf_msg: protocol_version "
 		      "%hu not supported", protocol_version);
@@ -7625,12 +7622,9 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack16(&build_ptr->vsize_factor, buffer);
 
 		safe_unpack16(&build_ptr->wait_time, buffer);
-
-		safe_unpack16(&build_ptr->z_16, buffer);
-		safe_unpack32(&build_ptr->z_32, buffer);
-		safe_unpackstr_xmalloc(&build_ptr->z_char, &uint32_tmp,
-				       buffer);
 	} else if (protocol_version >= SLURM_17_02_PROTOCOL_VERSION) {
+		char *charptr_tmp;
+
 		/* unpack timestamp of snapshot */
 
 		safe_unpack_time(&build_ptr->last_update, buffer);
@@ -8031,12 +8025,13 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 
 		safe_unpack16(&build_ptr->wait_time, buffer);
 
-		safe_unpack16(&build_ptr->z_16, buffer);
-		safe_unpack32(&build_ptr->z_32, buffer);
-		safe_unpackstr_xmalloc(&build_ptr->z_char, &uint32_tmp,
-				       buffer);
+		safe_unpack16(&uint16_tmp, buffer);
+		safe_unpack32(&uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&charptr_tmp, &uint32_tmp, buffer);
+		xfree(charptr_tmp);
 	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint32_t tmp_mem;
+		char *charptr_tmp;
 		/* unpack timestamp of snapshot */
 		safe_unpack_time(&build_ptr->last_update, buffer);
 
@@ -8438,10 +8433,10 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 
 		safe_unpack16(&build_ptr->wait_time, buffer);
 
-		safe_unpack16(&build_ptr->z_16, buffer);
-		safe_unpack32(&build_ptr->z_32, buffer);
-		safe_unpackstr_xmalloc(&build_ptr->z_char, &uint32_tmp,
-				       buffer);
+		safe_unpack16(&uint16_tmp, buffer);
+		safe_unpack32(&uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&charptr_tmp, &uint32_tmp, buffer);
+		xfree(charptr_tmp);
 	} else {
 		error("_unpack_slurm_ctl_conf_msg: protocol_version "
 		      "%hu not supported", protocol_version);
-- 
GitLab