]> git.infradead.org Git - users/hch/nvmetcli.git/log
users/hch/nvmetcli.git
12 months agobump version to v0.8 master v0.8
Christoph Hellwig [Fri, 3 Nov 2023 13:48:18 +0000 (14:48 +0100)]
bump version to v0.8

12 months agofix common misspellings from codespell project
Yi Zhang [Thu, 2 Nov 2023 07:18:51 +0000 (15:18 +0800)]
fix common misspellings from codespell project

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
19 months agonvmetcli: set up the target only after the network is configured
Maurizio Lombardi [Tue, 28 Feb 2023 16:36:15 +0000 (17:36 +0100)]
nvmetcli: set up the target only after the network is configured

network.target only indicates that the network stack is up, but it
doesn't mean that the network devices have been configured.

Replace it with network-online.target, this fixes the following
error when systemd restores the target configuration during boot:

[   19.613251] nvmet_tcp: failed to bind port socket -99
[FAILED] Failed to start Restore NVMe kernel target configuration.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agonvmetcli: fixup ana groupid setting for namespaces
Hannes Reinecke [Fri, 5 Feb 2021 09:56:36 +0000 (10:56 +0100)]
nvmetcli: fixup ana groupid setting for namespaces

The ANA group of a namespace is displayed, but can't be set.
So add a new attribute group 'ana' to the namespace such that
it can be set via 'set ana grpid'.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agoDocumentation: fix typo
Maurizio Lombardi [Mon, 1 Feb 2021 14:47:56 +0000 (15:47 +0100)]
Documentation: fix typo

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agonvmetcli: add a tcp example json
zhenwei pi [Thu, 10 Dec 2020 09:06:56 +0000 (17:06 +0800)]
nvmetcli: add a tcp example json

Run a tcp nvme target on linux-5.10-rc version, and save the config
as an example.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvmetcli: Correct xrange usage for py3
Tony Asleson [Wed, 1 Apr 2020 19:13:16 +0000 (14:13 -0500)]
nvmetcli: Correct xrange usage for py3

If you are in a namespace and simply do a 'create' without specifying
a value you will get:

/subsystems/n...f8/namespaces> create
name 'xrange' is not defined
subsystems/n...f8/namespaces>

This is because xrange is not defined in python3 as python3 changed
it to range.  As the code is already using six use six.move.xrange
which works for both python2 & python3.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvmetcli: Allow different devices for make test
Tony Asleson [Thu, 2 Apr 2020 15:54:43 +0000 (10:54 -0500)]
nvmetcli: Allow different devices for make test

The test_nvmet.py by default uses /dev/ram0 and /dev/ram1 for 2 of the
unit tests.  Add env. variable to allow user to specify different devices
or files.  Additionally, skip these unit tests that require devices/files
if they are not present.  Update README too.

$ sudo make test
......s...s.
----------------------------------------------------------------------
Ran 12 tests in 0.043s

OK (skipped=2)
Name                  Stmts   Miss  Cover
-----------------------------------------
nvmet/__init__.py         1      0   100%
nvmet/nvme.py           517    237    54%
nvmet/test_nvmet.py     276     63    77%
-----------------------------------------
TOTAL                   794    300    62%

$ sudo NVMET_TEST_DEVICES="/dev/sdc,/dev/sdd" make test
............
----------------------------------------------------------------------
Ran 12 tests in 0.124s

OK
Name                  Stmts   Miss  Cover
-----------------------------------------
nvmet/__init__.py         1      0   100%
nvmet/nvme.py           517    100    81%
nvmet/test_nvmet.py     276      4    99%
-----------------------------------------
TOTAL                   794    104    87%

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvmetcli: Report save name correctly
Tony Asleson [Thu, 26 Mar 2020 18:07:50 +0000 (13:07 -0500)]
nvmetcli: Report save name correctly

When a user simply does 'nvmetcli restore' without
specifying a file name the default is used.  However, if the
restore fails you end up with the error message:

Error processing config file at None, error [Errno 1] Operation not
permitted: '/sys/kernel/config/nvmet/ports/0/ana_groups/1', exiting

Correct file name if None in error path.

Error processing config file at /etc/nvmet/config.json, error \
[Errno 1] Operation not permitted: \
'/sys/kernel/config/nvmet/ports/1/ana_groups/1', exiting

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agotest_nvmet.py: test_invalid_input fails for py3
Tony Asleson [Thu, 26 Mar 2020 18:07:49 +0000 (13:07 -0500)]
test_nvmet.py: test_invalid_input fails for py3

When you run 'make test' using python 3 the unit test
test_invalid_input fails with:

Traceback (most recent call last):
  File "/someuser/projects/nvmetcli/nvmet/test_nvmet.py", line 395, in
test_invalid_input
    for i in range(l))
  File "/someuser/projects/nvmetcli/nvmet/test_nvmet.py", line 395, in
<genexpr>
    for i in range(l))
AttributeError: module 'string' has no attribute 'lowercase'

Python 3 does not have 'string.lowercase' ref.
https://docs.python.org/3/library/string.html

Python 2 does ref.
https://docs.python.org/2/library/string.html

Both have "string.ascii_lowercase" so lets leverage that to
support both.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvme.py: Make modprobe work for kmod lib too
Tony Asleson [Thu, 26 Mar 2020 18:07:48 +0000 (13:07 -0500)]
nvme.py: Make modprobe work for kmod lib too

The python library 'kmod' is included with libkmod, lets try to use that
if the user isn't utilizing kmodpy.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvme.py: Sync the containing directory
Tony Asleson [Thu, 26 Mar 2020 18:07:47 +0000 (13:07 -0500)]
nvme.py: Sync the containing directory

It's apparent that some thought went into making sure the config
file makes it atomically to the fs.  However, one thing is missing
which is doing a fsync on the containing directory of the config file.

See: https://lwn.net/Articles/457667/

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvme.py: Explicit close is redundant
Tony Asleson [Thu, 26 Mar 2020 18:07:46 +0000 (13:07 -0500)]
nvme.py: Explicit close is redundant

One of the benefits of using 'with' statement for open files is the
close is going to be called regardless of what happens.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvmetcli: Improve IOError handling on restore
Tony Asleson [Thu, 26 Mar 2020 18:07:45 +0000 (13:07 -0500)]
nvmetcli: Improve IOError handling on restore

Not all IOErrors are caused by specifying a missing configuration
file.  When the file is present, dump the error exception text too,
so the user has a better idea what is wrong.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agoREADME: Update URL for configshell-fb
Tony Asleson [Thu, 26 Mar 2020 18:07:44 +0000 (13:07 -0500)]
README: Update URL for configshell-fb

The github repository was moved. There is a github redirect,
so this change is not strictly required.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvmetcli: don't remove ANA Group 1 on clear
Hannes Reinecke [Fri, 27 Mar 2020 07:01:34 +0000 (08:01 +0100)]
nvmetcli: don't remove ANA Group 1 on clear

The first ANA group is maintained by the kernel so it cannot
be deleted.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
5 years agobump version to v0.7 v0.7
Christoph Hellwig [Sun, 28 Apr 2019 12:47:14 +0000 (14:47 +0200)]
bump version to v0.7

5 years agonvmetcli: ANA configuration support
Hannes Reinecke [Fri, 15 Feb 2019 11:20:29 +0000 (12:20 +0100)]
nvmetcli: ANA configuration support

Add support for ANA configuration.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agonvmetcli: simplify the enabled logic
Christoph Hellwig [Sat, 6 Oct 2018 12:31:49 +0000 (14:31 +0200)]
nvmetcli: simplify the enabled logic

pep8 complains about the overlong line, and this can be simplied
by transforming the boolean logic.

Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agonvmetcli: pep8 fixes
Christoph Hellwig [Sat, 6 Oct 2018 12:31:02 +0000 (14:31 +0200)]
nvmetcli: pep8 fixes

Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agonvmetcli: support inline_data_size port parameter
Steve Wise [Mon, 9 Jul 2018 17:00:26 +0000 (10:00 -0700)]
nvmetcli: support inline_data_size port parameter

The port parameter attribute param_inline_data_size allows adjusting
the amount of inline data that can be included in a write IO. Setting
it to < 0 (or not setting it at all) allows the transport to choose a
reasonable default, which will be 0 if that transport does not support
inline.  Setting it to 0 disables the transport from using inline_data.
And setting it to > 0 configures that port/transport to use that inline
data size, in bytes, if the transport supports it.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agoRevert "nvmetcli: expose nvmet port status and state"
Christoph Hellwig [Wed, 23 May 2018 07:31:58 +0000 (09:31 +0200)]
Revert "nvmetcli: expose nvmet port status and state"

This reverts commit 54ce6d02112f267733402735b1dbb3635dfa8055.

Turns out this broke existing setups.

6 years agoSupport python3 dictionary access.
Lee Duncan [Fri, 13 Apr 2018 18:56:29 +0000 (11:56 -0700)]
Support python3 dictionary access.

Support python2 and python3 dictionary access by using the iteritems
function the 'python-six' module.

Also, add info to the README about supporting both Python2 and Python3.

Signed-off-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agonvmetcli: expose nvmet port status and state
Sagi Grimberg [Thu, 12 Apr 2018 13:32:33 +0000 (16:32 +0300)]
nvmetcli: expose nvmet port status and state

The status attribute reflects if any subsystems are bound and can accept
existing connections. The state attribute reflects the physical state of
the port.  Also colorize UI if port state is down.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agobump version to v0.6 v0.6
Christoph Hellwig [Mon, 22 Jan 2018 18:45:05 +0000 (19:45 +0100)]
bump version to v0.6

6 years agonvmetcli: port decoration coloring only if its enabled
Sagi Grimberg [Tue, 5 Dec 2017 11:48:42 +0000 (13:48 +0200)]
nvmetcli: port decoration coloring only if its enabled

Only color the port if its enabled (has subsystems or
referrals symlinks).

Also, don't display none trsvcid (like in the fc case).

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agonvmetcli: decorate namespace, subsystem and port UI
Sagi Grimberg [Sun, 3 Dec 2017 08:25:35 +0000 (10:25 +0200)]
nvmetcli: decorate namespace, subsystem and port UI

Display some info on the on the UI node.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agonvmetcli: expose ls to dump UI configuration
Sagi Grimberg [Sun, 3 Dec 2017 08:25:34 +0000 (10:25 +0200)]
nvmetcli: expose ls to dump UI configuration

for running: nvmetcli ls

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
6 years agonvmetcli: remove status method for the UIPortNode
Johannes Thumshirn [Thu, 30 Nov 2017 10:27:23 +0000 (11:27 +0100)]
nvmetcli: remove status method for the UIPortNode

nvmetcli defines a status method for the UIPortNode class but there is
no corresponding 'enable' file in configfs so typing in status will
always result in nvmetcli printing disbaled if one types 'status' in
the port node:

/> cd ports/1/
/ports/1> status
Status for /ports/1: disabled
/ports/1>

There are two possible ways for fixing this issue, provide a configfs
file to enable/disable the port node in the kernel or delete the
method in nvmetcli. Having a configfs file in the kernel is pointless,
as ports get enabled when symlinked to a namespace so zap the pointless status
method in user-space.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reported-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agobump version to v0.5 v0.5
Christoph Hellwig [Thu, 10 Aug 2017 12:46:02 +0000 (14:46 +0200)]
bump version to v0.5

7 years agoadd a make clean pass to bump-ver.sh
Christoph Hellwig [Thu, 10 Aug 2017 12:45:42 +0000 (14:45 +0200)]
add a make clean pass to bump-ver.sh

Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: allow setting of the subsystem version
Johannes Thumshirn [Fri, 14 Jul 2017 13:42:54 +0000 (15:42 +0200)]
nvmetcli: allow setting of the subsystem version

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: allow setting of serial number number
Johannes Thumshirn [Thu, 13 Jul 2017 10:48:45 +0000 (12:48 +0200)]
nvmetcli: allow setting of serial number number

Allow a user to set a serial number of a controller in configfs in order to
have persistent serials that survive a reboot of the target.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: add support for NS UUIDs
Johannes Thumshirn [Fri, 16 Jun 2017 08:05:44 +0000 (10:05 +0200)]
nvmetcli: add support for NS UUIDs

Add support for setting the Namespace Universally Unique Identifier in
a NVMe over Fabrics namespace.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agobump version to v0.4 v0.4
Christoph Hellwig [Fri, 21 Apr 2017 06:31:31 +0000 (08:31 +0200)]
bump version to v0.4

7 years agoAdd fc transport support to nvmetcli
James Smart [Wed, 12 Apr 2017 23:09:14 +0000 (16:09 -0700)]
Add fc transport support to nvmetcli

Add fc.json file for example FC configuration.
Small text update for FC in examples/documentation

Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: create json file's dir first if it doesn't exist
Yi Zhang [Wed, 12 Apr 2017 11:34:28 +0000 (19:34 +0800)]
nvmetcli: create json file's dir first if it doesn't exist

The saveconfig operation will be failed as the /etc/nvmet dir
doesn't exist by default, so create it first before save operation.

$ ./nvmetcli
/> saveconfig
[Errno 2] No such file or directory: '/etc/nvmet/config.json.temp'

Signed-off-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: Install nvmetcli in /usr/sbin with setup.py
Mauro S. M. Rodrigues [Wed, 5 Apr 2017 23:49:06 +0000 (20:49 -0300)]
nvmetcli: Install nvmetcli in /usr/sbin with setup.py

According to the README, one can install nvmetcli through setup.py.
When one tries this though, the nvmetcli isn't configured in system's
$PATH.

Adding nvmetcli to scripts argument in setup call does half of the job.
Then, in order to install it in the correct location in a maintanable
way it's introduced setup.cfg file which contains 'install_scripts'
parameter for 'install' command set to /usr/sbin.

Nothing changes on the .deb package creation, the .rpm package process
in the other hand was made simpler by lines that are now done by
setup.py + setup.cfg settings.

Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: fix Referral operation in shell
Mauro S. M. Rodrigues [Mon, 27 Mar 2017 17:46:44 +0000 (14:46 -0300)]
nvmetcli: fix Referral operation in shell

It's not possible to create or list a Referral under Port entity,
because Referral class is not imported and thus it fails:

/ports/1/referrals> ls

returning "'module' object has no attribute 'Referral'".

This is caused by changes introduced in:
a21ebd54f0 ("nvmetcli: Fix nvmet import").

This patch also fixes the attribute type helper expected for Referral's
portid attribute. It was 'int', causing the system to show error
messages like:

"'UIReferralNode' object has no attribute 'ui_type_int'".
The correct type is 'number'.

Reviewed-by: Guilherme G. Piccoli<gpiccoli@linux.vnet.ibm.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: fix Port and Host operations in shell
Mauro S. M. Rodrigues [Mon, 27 Mar 2017 17:46:43 +0000 (14:46 -0300)]
nvmetcli: fix Port and Host operations in shell

Operations against Port and Host entities are broken. When performing
operations like the follow:

/ports> create 1
/hosts> create 1

nvmetcli fails, saying the object doesn't have the attribute we're
trying to access, for instance:
'module' object has no attribute 'Port'

This patch fixes this issue by importing the classes Port and Host in
nvmet/__init__.py which was forgotten during the follow change:

a21ebd54f0 ("nvmetcli: Fix nvmet import").

Tested-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Tested-by: Sagi Grimberg <sagi@grimberg.m>
Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agobump version to v0.3 v0.3
Christoph Hellwig [Fri, 17 Feb 2017 14:58:54 +0000 (15:58 +0100)]
bump version to v0.3

7 years agoadd a bump-ver.sh script to automate cutting releases
Christoph Hellwig [Fri, 17 Feb 2017 14:46:43 +0000 (15:46 +0100)]
add a bump-ver.sh script to automate cutting releases

Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agoupdate .gitignore for the auto-generated manpage formats
Christoph Hellwig [Fri, 17 Feb 2017 14:48:05 +0000 (15:48 +0100)]
update .gitignore for the auto-generated manpage formats

Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agoadd example configuration files
Christoph Hellwig [Fri, 17 Feb 2017 14:47:06 +0000 (15:47 +0100)]
add example configuration files

Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: update README
Christoph Hellwig [Thu, 1 Dec 2016 09:42:45 +0000 (10:42 +0100)]
nvmetcli: update README

Most usage information has moved to the manpage.  Also add a blurb
that bugs reports should go to the linux-nvme list.

Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: Adding manpage/html generation
Jay Freyensee [Tue, 29 Nov 2016 23:10:59 +0000 (15:10 -0800)]
nvmetcli: Adding manpage/html generation

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
7 years agonvmetcli: add python-six to rpm package building
Jay Freyensee [Wed, 23 Nov 2016 18:01:12 +0000 (10:01 -0800)]
nvmetcli: add python-six to rpm package building

From experience, if python-six isn't installed on a Fedora
system, hard-to-decipher errors can occur trying to use
nvmetcli.

Signed-off-by: Jay Freyensee <james.p.freyensee@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: Fix nvmet import
Andy Grover [Thu, 13 Oct 2016 00:00:42 +0000 (17:00 -0700)]
nvmetcli: Fix nvmet import

We should just need to import nvmet, which will run __init__.py and import
just the public things from nvmet/nvme.py.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoUse relative import in nvmet/__init__.py
Andy Grover [Thu, 13 Oct 2016 00:00:41 +0000 (17:00 -0700)]
Use relative import in nvmet/__init__.py

This is supported by Python 2.7 and later.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: README description of discovery v0.2
Jay Freyensee [Thu, 8 Sep 2016 19:14:24 +0000 (12:14 -0700)]
nvmetcli: README description of discovery

Some blurbs on discovery and the connection
between using nvmetcli to set up an NVMe target and
what gets seen by an NVMe Host when accessing
the discovery controller.

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agonvmetcli: More refined cleanup of README
Jay Freyensee [Thu, 28 Jul 2016 17:37:06 +0000 (10:37 -0700)]
nvmetcli: More refined cleanup of README

Adds a few more tidbits to the README file, minus
discovery/referral info (still WIP).

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: Updated README to current functionality
Jay Freyensee [Thu, 23 Jun 2016 21:41:16 +0000 (14:41 -0700)]
nvmetcli: Updated README to current functionality

Also added a referrals/discovery placeholder TBD section.

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoadd RPM packaging
Christoph Hellwig [Thu, 2 Jun 2016 15:16:05 +0000 (17:16 +0200)]
add RPM packaging

Build and install tested on Fedora 23.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoadd a systemd unit file
Christoph Hellwig [Wed, 1 Jun 2016 18:28:47 +0000 (20:28 +0200)]
add a systemd unit file

This restores the configuration when started and clears it when shut down.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoadd Debian packaging
Christoph Hellwig [Wed, 1 Jun 2016 17:09:38 +0000 (19:09 +0200)]
add Debian packaging

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agomove the default config into a /etc/nvmet/
Christoph Hellwig [Wed, 1 Jun 2016 18:26:27 +0000 (20:26 +0200)]
move the default config into a /etc/nvmet/

no need to clutter /etc directly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agorename README.md to README
Christoph Hellwig [Wed, 1 Jun 2016 17:56:01 +0000 (19:56 +0200)]
rename README.md to README

Seems like our code examples aren't valid markdown..

Reported-by: Steve Wise <swise@chelsio.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoupdate README and examples
Christoph Hellwig [Sun, 29 May 2016 19:15:30 +0000 (21:15 +0200)]
update README and examples

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: add descriptions for all configfs attributes
Christoph Hellwig [Sun, 29 May 2016 18:44:26 +0000 (20:44 +0200)]
nvmetcli: add descriptions for all configfs attributes

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: remove broken automatic portid assignment
Christoph Hellwig [Thu, 26 May 2016 12:58:29 +0000 (14:58 +0200)]
nvmet: remove broken automatic portid assignment

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet,nvmetcli: support referrals
Christoph Hellwig [Wed, 25 May 2016 12:31:00 +0000 (14:31 +0200)]
nvmet,nvmetcli: support referrals

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: small fixes and cleanups
Christoph Hellwig [Wed, 25 May 2016 12:30:50 +0000 (14:30 +0200)]
nvmet: small fixes and cleanups

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet,nvmetcli: support per-port subsystem enablement
Christoph Hellwig [Thu, 19 May 2016 14:14:36 +0000 (16:14 +0200)]
nvmet,nvmetcli: support per-port subsystem enablement

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet,nvmetcli: add support for host NQN based access control
Christoph Hellwig [Sun, 3 Apr 2016 15:44:35 +0000 (17:44 +0200)]
nvmet,nvmetcli: add support for host NQN based access control

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: fix a couple see also references
Christoph Hellwig [Sun, 3 Apr 2016 15:47:38 +0000 (17:47 +0200)]
nvmetcli: fix a couple see also references

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvme: a couple typo fixes
Christoph Hellwig [Sun, 3 Apr 2016 15:46:12 +0000 (17:46 +0200)]
nvme: a couple typo fixes

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: fix attribute listing
Christoph Hellwig [Sun, 3 Apr 2016 15:45:02 +0000 (17:45 +0200)]
nvmet: fix attribute listing

We only want to split at the first underscore, not at any.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet, nvmetcli: add support for NVMe ports
Christoph Hellwig [Fri, 25 Mar 2016 13:06:29 +0000 (14:06 +0100)]
nvmet, nvmetcli: add support for NVMe ports

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agotests: check for invalid subsystem names
Christoph Hellwig [Sat, 26 Mar 2016 17:28:06 +0000 (18:28 +0100)]
tests: check for invalid subsystem names

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agotests: check that the nguid is properly saved and restored
Christoph Hellwig [Sat, 26 Mar 2016 17:14:02 +0000 (18:14 +0100)]
tests: check that the nguid is properly saved and restored

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoupdate default config file
Christoph Hellwig [Sat, 26 Mar 2016 10:38:07 +0000 (11:38 +0100)]
update default config file

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: improve enable semantics
Christoph Hellwig [Sat, 26 Mar 2016 10:35:20 +0000 (11:35 +0100)]
nvmet: improve enable semantics

Allow for a None state of the _enable variable, and use that fact to
automatically set up the enabled state in the primary Node class.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agopep8
Christoph Hellwig [Fri, 25 Mar 2016 17:45:14 +0000 (18:45 +0100)]
pep8

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agotests: initial version of the testsuite
Christoph Hellwig [Fri, 25 Mar 2016 17:44:57 +0000 (18:44 +0100)]
tests: initial version of the testsuite

This requires nose2 and can be run using make test

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: reject Namespace and Subsystems lookups without identifier
Christoph Hellwig [Fri, 25 Mar 2016 17:19:14 +0000 (18:19 +0100)]
nvmet: reject Namespace and Subsystems lookups without identifier

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: fix invalid access to self.subsystems in the Namespace constructor
Christoph Hellwig [Fri, 25 Mar 2016 16:29:28 +0000 (17:29 +0100)]
nvmet: fix invalid access to self.subsystems in the Namespace constructor

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet, nvmetcli: implement enable/disable semantics
Christoph Hellwig [Fri, 25 Mar 2016 15:00:53 +0000 (16:00 +0100)]
nvmet, nvmetcli: implement enable/disable semantics

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: improve error reporting
Christoph Hellwig [Fri, 25 Mar 2016 13:59:01 +0000 (14:59 +0100)]
nvmetcli: improve error reporting

Report a nice error message in red instead of a python backtrace.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: add description strings for the Namespace class
Christoph Hellwig [Thu, 24 Mar 2016 16:19:36 +0000 (17:19 +0100)]
nvmetcli: add description strings for the Namespace class

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: introduce UINode class
Christoph Hellwig [Fri, 25 Mar 2016 13:53:54 +0000 (14:53 +0100)]
nvmetcli: introduce UINode class

This allows calling saveconfig from each context, and factors some common
group handling code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: make attr_groups public for nvmetcli
Christoph Hellwig [Fri, 25 Mar 2016 13:49:48 +0000 (14:49 +0100)]
nvmet: make attr_groups public for nvmetcli

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: remove the unused Controllers and Controller classes
Christoph Hellwig [Fri, 25 Mar 2016 13:53:37 +0000 (14:53 +0100)]
nvmetcli: remove the unused Controllers and Controller classes

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: remove unused DEFAULT_SAVE_FILE defintion
Christoph Hellwig [Fri, 25 Mar 2016 12:14:58 +0000 (13:14 +0100)]
nvmetcli: remove unused DEFAULT_SAVE_FILE defintion

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoEnsure internal buffers are flushed json after dumping json to disk
Christoph Hellwig [Thu, 24 Mar 2016 15:42:26 +0000 (16:42 +0100)]
Ensure internal buffers are flushed json after dumping json to disk

A power-outage, unexpected reboot, etc can lead to zero byte file
after a saveconfig.

Based on a rtslib-fb patch from Jon Magrini <jmagrini@redhat.com>.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: fix up various docstrings
Christoph Hellwig [Thu, 24 Mar 2016 15:23:47 +0000 (16:23 +0100)]
nvmet: fix up various docstrings

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: fix up the default config file to agree with the documentation
Christoph Hellwig [Thu, 24 Mar 2016 15:20:57 +0000 (16:20 +0100)]
nvmetcli: fix up the default config file to agree with the documentation

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: 0 is not a valid namespace ID
Christoph Hellwig [Thu, 24 Mar 2016 15:19:58 +0000 (16:19 +0100)]
nvmet: 0 is not a valid namespace ID

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmet: load the nvmet module if not already loaded
Christoph Hellwig [Wed, 23 Mar 2016 20:16:16 +0000 (21:16 +0100)]
nvmet: load the nvmet module if not already loaded

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvmetcli: print a useful warning when not called as root user
Christoph Hellwig [Wed, 23 Mar 2016 19:21:07 +0000 (20:21 +0100)]
nvmetcli: print a useful warning when not called as root user

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoinitial public release v0.1
Christoph Hellwig [Wed, 16 Mar 2016 16:44:56 +0000 (17:44 +0100)]
initial public release