Skip to content

Commit

Permalink
Merge pull request #665 from gbregman/devel
Browse files Browse the repository at this point in the history
Get version string from SPDK
  • Loading branch information
gbregman authored May 22, 2024
2 parents e0e8c71 + e3b95a3 commit a2bb33e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion control/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def display_environment_info(self, logger):
logger.info(f"Using NVMeoF gateway version {ver}")
spdk_ver = os.getenv("NVMEOF_SPDK_VERSION")
if spdk_ver:
logger.info(f"Using SPDK version {spdk_ver}")
logger.info(f"Configured SPDK version {spdk_ver}")
ceph_ver = os.getenv("NVMEOF_CEPH_VERSION")
if ceph_ver:
logger.info(f"Using vstart cluster version based on {ceph_ver}")
Expand Down
12 changes: 12 additions & 0 deletions control/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,18 @@ def _start_spdk(self, omap_state):
for trtype in spdk_transports.split():
self._create_transport(trtype.lower())

with self.ping_lock:
try:
return_version = spdk.rpc.spdk_get_version(self.spdk_rpc_ping_client)
try:
version_string = return_version["version"]
self.logger.info(f"Started SPDK with version \"{version_string}\"")
except KeyError:
self.logger.error(f"Can't find SPDK version string in {return_version}")
except Exception:
self.logger.exception(f"Can't read SPDK version")
pass

def _stop_subprocess(self, proc, timeout):
"""Stops SPDK process."""
assert proc is not None # should be verified by the caller
Expand Down

0 comments on commit a2bb33e

Please sign in to comment.