linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH] Adds the appility to print json to stdout, create ports,  namespaces and subsystems using cli.
Date: Mon, 16 Jul 2018 10:07:04 +0300	[thread overview]
Message-ID: <739dae37-0c4a-aa23-a8c7-8969bbf972b2@grimberg.me> (raw)
In-Reply-To: <1531663895-5151-1-git-send-email-hamdyk@mellanox.com>

This patch needs to split into at least 2 patches.

On 07/15/2018 05:11 PM, Hamdy Khader wrote:
> ---
>   nvmet/nvme.py |  3 +++
>   nvmetcli      | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
>   2 files changed, 59 insertions(+), 5 deletions(-)
> 
> diff --git a/nvmet/nvme.py b/nvmet/nvme.py
> index 8253ea9..3ca8429 100644
> --- a/nvmet/nvme.py
> +++ b/nvmet/nvme.py
> @@ -388,6 +388,9 @@ class Root(CFSNode):
>           d['hosts'] = [h.dump() for h in self.hosts]
>           return d
>   
> +    def dump_json(self):
> +        return json.dumps(self.dump(), sort_keys=True, indent=2)
> +
>   
>   class Subsystem(CFSNode):
>       '''
> diff --git a/nvmetcli b/nvmetcli
> index 6b102a2..b784162 100755
> --- a/nvmetcli
> +++ b/nvmetcli
> @@ -583,6 +583,12 @@ def usage():
>       print("        %s restore [file_to_restore_from]" % sys.argv[0])
>       print("        %s clear" % sys.argv[0])
>       print("        %s ls" % sys.argv[0])
> +    print("        %s create_port [subsystem_name] [port_id] [ip_version]" % sys.argv[0])
> +    print("                       [transport_address] [transport_type] [transport_port]")

If we go down this route, then subsystem linkage should be a separate
command.

> +    print("        %s create_subsystem [subsystem_name]" % sys.argv[0])

What about remove_port/remove_subsystem?

> +    print("        %s create_ns [namespace_id] [subsystem_name] [device_path]" % sys.argv[0])
> +    print("        %s delete_ns [namespace_id] [subsystem_name]" % sys.argv[0])
> +    print("        %s dump" % sys.argv[0])
>       sys.exit(-1)

      reply	other threads:[~2018-07-16  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-15 14:11 [PATCH] Adds the appility to print json to stdout, create ports, namespaces and subsystems using cli Hamdy Khader
2018-07-16  7:07 ` Sagi Grimberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=739dae37-0c4a-aa23-a8c7-8969bbf972b2@grimberg.me \
    --to=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).