Skip to content

Commit

Permalink
control/cli: add maximum namespaces in subsystem creation
Browse files Browse the repository at this point in the history
Fixes #146

Signed-off-by: rahullepakshi <rlepaksh@redhat.com>
  • Loading branch information
rahullepakshi committed Jun 7, 2023
1 parent 9cacd58 commit 7877216
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion control/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions proto/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7877216

Please sign in to comment.