From 7877216cff954e012caf18c041a278675f93f424 Mon Sep 17 00:00:00 2001 From: rahullepakshi Date: Tue, 6 Jun 2023 19:13:01 +0530 Subject: [PATCH] control/cli: add maximum namespaces in subsystem creation Fixes https://github.com/ceph/ceph-nvmeof/issues/146 Signed-off-by: rahullepakshi --- control/cli.py | 4 +++- control/grpc.py | 1 + proto/gateway.proto | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/control/cli.py b/control/cli.py index 5973c3080..03f87edf7 100644 --- a/control/cli.py +++ b/control/cli.py @@ -166,13 +166,15 @@ def delete_bdev(self, args): @cli.cmd([ argument("-n", "--subnqn", help="Subsystem NQN", required=True), argument("-s", "--serial", help="Serial number", required=True), + argument("-m", "--maxns", help="Maximum number of namespaces", type=int, default=0, required=False), ]) def create_subsystem(self, args): """Creates a subsystem.""" try: req = pb2.create_subsystem_req(subsystem_nqn=args.subnqn, - serial_number=args.serial) + serial_number=args.serial, + max_namespaces=args.maxns) ret = self.stub.create_subsystem(req) self.logger.info(f"Created subsystem {args.subnqn}: {ret.status}") except Exception as error: diff --git a/control/grpc.py b/control/grpc.py index 6183053d0..6733a45ad 100644 --- a/control/grpc.py +++ b/control/grpc.py @@ -117,6 +117,7 @@ def create_subsystem(self, request, context=None): self.spdk_rpc_client, nqn=request.subsystem_nqn, serial_number=request.serial_number, + max_namespaces=request.max_namespaces, ) self.logger.info(f"create_subsystem {request.subsystem_nqn}: {ret}") except Exception as ex: diff --git a/proto/gateway.proto b/proto/gateway.proto index e8670e62f..3e7e04f34 100644 --- a/proto/gateway.proto +++ b/proto/gateway.proto @@ -61,6 +61,7 @@ message delete_bdev_req { message create_subsystem_req { string subsystem_nqn = 1; string serial_number = 2; + int32 max_namespaces = 3; } message delete_subsystem_req {