diff --git a/nvme_gw.config b/nvme_gw.config index c7f5f489..a73e5a77 100644 --- a/nvme_gw.config +++ b/nvme_gw.config @@ -25,8 +25,7 @@ client_cert = ./client.crt [spdk] -spdk_server_addr = /var/tmp/spdk.sock -spdk_port = 5260 +rpc_socket = /var/tmp/spdk.sock timeout = 60.0 log_level = ERROR conn_retries = 3 diff --git a/nvme_gw_server.py b/nvme_gw_server.py index 84abba61..5be2c267 100644 --- a/nvme_gw_server.py +++ b/nvme_gw_server.py @@ -35,8 +35,9 @@ def start_spdk(self): self.spdk_rpc = spdk_rpc spdk_tgt = self.nvme_config.get("config", "spdk_tgt") spdk_cmd = os.path.join(spdk_path, spdk_tgt) + spdk_rpc_socket = self.nvme_config.get("spdk", "rpc_socket") - cmd = [spdk_cmd, "all", "-u"] + cmd = [spdk_cmd, "-u", "-r", spdk_rpc_socket] self.logger.info(f"Starting {' '.join(cmd)}") try: @@ -48,20 +49,18 @@ def start_spdk(self): self.logger.error(f"Unable to start SPDK: \n {ex}") raise - spdk_server_addr = self.nvme_config.get("spdk", "spdk_server_addr") - spdk_port = self.nvme_config.get("spdk", "spdk_port") timeout = self.nvme_config.getfloat("spdk", "timeout") log_level = self.nvme_config.get("spdk", "log_level") conn_retries = self.nvme_config.getint("spdk", "conn_retries") self.logger.info( - f"Attempting to initialize SPDK: server_addr: {spdk_server_addr}, port: {spdk_port}, conn_retries: {conn_retries}, timeout: {timeout}" + f"Attempting to initialize SPDK: rpc_socket: {spdk_rpc_socket}, conn_retries: {conn_retries}, timeout: {timeout}" ) try: self.client = self.spdk_rpc.client.JSONRPCClient( - spdk_server_addr, - spdk_port, + spdk_rpc_socket, + None, timeout, log_level=log_level, conn_retries=conn_retries,