]> git.infradead.org Git - users/sagi/libnvme.git/log
users/sagi/libnvme.git
2 years agodoc: Regenerate all documentation v1.0
Daniel Wagner [Fri, 8 Apr 2022 16:14:55 +0000 (18:14 +0200)]
doc: Regenerate all documentation

Prepare for initial 1.0 release

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #332 from linux-nvme/fix-discovery-tcp-port
Daniel Wagner [Thu, 7 Apr 2022 08:00:41 +0000 (10:00 +0200)]
Merge pull request #332 from linux-nvme/fix-discovery-tcp-port

Remove default discovery port bits

2 years agoMerge pull request #333 from jk-ozlabs/fixes
Daniel Wagner [Tue, 5 Apr 2022 08:28:48 +0000 (10:28 +0200)]
Merge pull request #333 from jk-ozlabs/fixes

test: fix meson test() executable definitions

2 years agotest: drop hardware-dependent tests from meson test target
Jeremy Kerr [Tue, 5 Apr 2022 02:17:20 +0000 (10:17 +0800)]
test: drop hardware-dependent tests from meson test target

Currently, the tests under test/ require intractions with actual
hardware, which isn't available under CI.

[Additionally, the test() functions are mostly incorrect, as they'll all
just repeat the same test.c test]

This test drops the test() defitinitons, but leaves the executable()s
available for developer use, and adds a comment to indicate what we're
doing.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agotree: Remove default port setting for TCP and RDMA ports
Daniel Wagner [Mon, 4 Apr 2022 15:36:20 +0000 (17:36 +0200)]
tree: Remove default port setting for TCP and RDMA ports

When the controller is created, the discovery_ctrl attribute is not
set yet. The caller is supposed to set this after the creation of the
new discovery controller. Thus we can't really set the default port at
this level. This is a bit of a chicken-egg situation.

Move this work up to the caller to provide the correct defaults.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #331 from jk-ozlabs/fixes
Daniel Wagner [Mon, 4 Apr 2022 10:08:14 +0000 (12:08 +0200)]
Merge pull request #331 from jk-ozlabs/fixes

log.h: include tree.h for nvme_root_t

2 years agoMerge pull request #330 from hreinecke/filter-ns
Hannes Reinecke [Fri, 1 Apr 2022 15:23:37 +0000 (17:23 +0200)]
Merge pull request #330 from hreinecke/filter-ns

Update nvme_scan_filter_t

2 years agotree: add 'f_args' argument to pass user data to the filter function
Hannes Reinecke [Fri, 1 Apr 2022 14:02:18 +0000 (16:02 +0200)]
tree: add 'f_args' argument to pass user data to the filter function

Increase usability by adding an 'f_args' argument to pass user data
to the filter function.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agotree: remove 'ctrl_get_ana_state()'
Hannes Reinecke [Fri, 1 Apr 2022 13:29:01 +0000 (15:29 +0200)]
tree: remove 'ctrl_get_ana_state()'

This function was a hack to begin with, and as we now have namespace
filters it can be removed.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agotree: add namespace path iterators
Hannes Reinecke [Fri, 1 Apr 2022 10:26:13 +0000 (12:26 +0200)]
tree: add namespace path iterators

For some reason the namespace path iterators have not been implemented.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agotree: filter out namespaces
Hannes Reinecke [Fri, 1 Apr 2022 12:37:08 +0000 (14:37 +0200)]
tree: filter out namespaces

As the scan filter accepts a namespace as argument use it to
filter out namespaces, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agodoc: Regenerate all documentation v1.0-rc8
Daniel Wagner [Fri, 1 Apr 2022 12:47:29 +0000 (14:47 +0200)]
doc: Regenerate all documentation

Prepare for next release candiate.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agotree: update nvme_scan_filter_t usage
Hannes Reinecke [Fri, 1 Apr 2022 12:29:02 +0000 (14:29 +0200)]
tree: update nvme_scan_filter_t usage

Add two more arguments (nvme_ctrl_t and nvme_ns_t) to the nvme scan
filter to allow the implementation to distinguish between the call sites.
This allows for a more targeted approach when implementing filters.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoMerge pull request #329 from hreinecke/read_config
Hannes Reinecke [Fri, 1 Apr 2022 11:36:43 +0000 (13:36 +0200)]
Merge pull request #329 from hreinecke/read_config

tree: always allocate config file in nvme_read_config()

2 years agotree: always allocate config file in nvme_read_config()
Hannes Reinecke [Fri, 1 Apr 2022 11:28:11 +0000 (13:28 +0200)]
tree: always allocate config file in nvme_read_config()

Even if there was an error when reading the config file we still
should store the config file name, as it might used later on to
update/write the config file.
So parsing errors don't really matter, and we'll get notified for
I/O errors on writing anyway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agolog.h: include tree.h for nvme_root_t
Jeremy Kerr [Fri, 1 Apr 2022 03:05:59 +0000 (11:05 +0800)]
log.h: include tree.h for nvme_root_t

nvme_init_logging() has a nvme_root_t, so we need a definition from
tree.h

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #321 from igaw/remove-packed-attribute
Daniel Wagner [Thu, 31 Mar 2022 11:19:43 +0000 (13:19 +0200)]
Merge pull request #321 from igaw/remove-packed-attribute

ioctl: Remove attribute packed and alignedof for args structs

2 years agoMerge pull request #325 from martin-belanger/fix-dim-tas
Daniel Wagner [Thu, 31 Mar 2022 11:19:21 +0000 (13:19 +0200)]
Merge pull request #325 from martin-belanger/fix-dim-tas

fabrics: Invoke nvmf_dim() with provided tas argument.

2 years agofabrics: Invoke nvmf_dim() with provided tas argument
Martin Belanger [Thu, 31 Mar 2022 11:07:01 +0000 (07:07 -0400)]
fabrics: Invoke nvmf_dim() with provided tas argument

Looks like a copy-paste issue. One of the arguments to
nvmf_register_ctrl() is "tas" (i.e. the DIM Task). This argument
should be passed to the nvmf_dim() API, but instead a fixed value
of NVMF_DIM_TAS_REGISTER was passed.

The "tas" field specifies whether to perform a "registration",
"deregistration", or a "registration update".

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
2 years agoMerge pull request #327 from hreinecke/doc-update
Hannes Reinecke [Thu, 31 Mar 2022 09:06:02 +0000 (11:06 +0200)]
Merge pull request #327 from hreinecke/doc-update

Update function prototype documentation

2 years agoUpdate function prototype documentation
Hannes Reinecke [Thu, 31 Mar 2022 08:39:25 +0000 (10:39 +0200)]
Update function prototype documentation

CI has been complaining, so fix things up.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoMerge pull request #324 from hreinecke/subsystem-rework
Hannes Reinecke [Thu, 31 Mar 2022 07:39:56 +0000 (09:39 +0200)]
Merge pull request #324 from hreinecke/subsystem-rework

Rework nvme_scan_subsystem()

2 years agotree: rework nvme_scan_subsystem()
Hannes Reinecke [Wed, 30 Mar 2022 15:00:48 +0000 (17:00 +0200)]
tree: rework nvme_scan_subsystem()

The nvme subsystem does not have a 'hostnqn' sysfs entry, so we
cannot infer from the nvme subsystem sysfs entry to which host
it relates. And really, the subsystem should already have been
created by the previous call to nvme_scan_ctrl().
So do not call nvme_lookup_subsystem() in nvme_scan_subystem(),
but rather just validate the sysfs subsystem entries and create
any missing subsystems.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agotree: make subsystem name mandatory in nvme_scan_ctrl()
Hannes Reinecke [Wed, 30 Mar 2022 14:47:17 +0000 (16:47 +0200)]
tree: make subsystem name mandatory in nvme_scan_ctrl()

nvme_scan_ctrl() is iterating over sysfs, so any controller must
have a corresponding subsystem; not finding one is an error.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agotree: move nvme_init_subsystem() into nvme_lookup_subsystem()
Hannes Reinecke [Wed, 30 Mar 2022 14:42:18 +0000 (16:42 +0200)]
tree: move nvme_init_subsystem() into nvme_lookup_subsystem()

We're always calling nvme_init_subsystem() when nvme_lookup_subsystem()
is called with a non-NULL 'name' parameter. So we might as well move
it into nvme_lookup_subsystem() and simplify the callers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoMerge pull request #323 from hreinecke/export-symbol
Hannes Reinecke [Wed, 30 Mar 2022 10:30:12 +0000 (12:30 +0200)]
Merge pull request #323 from hreinecke/export-symbol

libnvme: export 'nvme_lookup_ctrl()'

2 years agolibnvme: export 'nvme_lookup_ctrl()'
Hannes Reinecke [Wed, 30 Mar 2022 10:25:50 +0000 (12:25 +0200)]
libnvme: export 'nvme_lookup_ctrl()'

For some reason it has been missing from the map file.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoMerge pull request #322 from hreinecke/update-config
Hannes Reinecke [Wed, 30 Mar 2022 10:02:15 +0000 (12:02 +0200)]
Merge pull request #322 from hreinecke/update-config

fabrics: add 'nvmf_update_config()'

2 years agofabrics: add 'nvmf_update_config()'
Hannes Reinecke [Wed, 30 Mar 2022 08:29:55 +0000 (10:29 +0200)]
fabrics: add 'nvmf_update_config()'

Add a function to update the fabrics configuration values of an
existing controller.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoioctl: Remove attribute packed and alignedof for args structs
Daniel Wagner [Wed, 30 Mar 2022 07:38:03 +0000 (09:38 +0200)]
ioctl: Remove attribute packed and alignedof for args structs

The attribute packed is usually used to make sure the data structures
is compatible between different compilers in regards of padding rules.

As we have sorted the members of all argument structs according their
naturual size, there are no holes to pad. This makes the packed
attributed superflous as compilers are agree on the data layout in
this case.

The alignedof attribute is used to tell the outer alignmen of the data
structure because the aligment of a packed data structure is 1.

Anyway, both attributes doen't add any benefits to the layout and
pahole agrees on this.

This is an example the diff between the packed/aligneof version and
the plain version:

 struct nvme_dim_args {
        __u32 *                    result;               /*     0     8 */
        void *                     data;                 /*     8     8 */
@@ -776,4 +777,4 @@
        /* size: 40, cachelines: 1, members: 7 */
        /* padding: 7 */
        /* last cacheline: 40 bytes */
-} __attribute__((__aligned__(8)));
+};

Thus, just remove the attributes.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #320 from hreinecke/json-scan
Hannes Reinecke [Wed, 30 Mar 2022 06:22:39 +0000 (08:22 +0200)]
Merge pull request #320 from hreinecke/json-scan

json: fix endless loop scanning for controllers

2 years agojson: fix endless loop scanning for controllers
Hannes Reinecke [Wed, 30 Mar 2022 06:05:56 +0000 (08:05 +0200)]
json: fix endless loop scanning for controllers

nvme_lookup_ctrl() will always create a new controller if none is
found, so checking for a NULL return value is not correct here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoMerge pull request #319 from hreinecke/scan-filter
Hannes Reinecke [Tue, 29 Mar 2022 09:53:32 +0000 (11:53 +0200)]
Merge pull request #319 from hreinecke/scan-filter

Fixup scan filter usage

2 years agotree: do not return error when filtering out subsystems
Hannes Reinecke [Tue, 29 Mar 2022 08:09:56 +0000 (10:09 +0200)]
tree: do not return error when filtering out subsystems

The filter is set by the caller, and just modifies the tree.
It does not invalidate the scanning, so we shouldn't return
an error.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agotree: add debugging messages during scanning
Hannes Reinecke [Tue, 29 Mar 2022 08:39:58 +0000 (10:39 +0200)]
tree: add debugging messages during scanning

Add some debugging messages during scanning to aid debugging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoMerge pull request #318 from hreinecke/display-tree
Daniel Wagner [Tue, 29 Mar 2022 08:18:54 +0000 (10:18 +0200)]
Merge pull request #318 from hreinecke/display-tree

meson: build display-tree example

2 years agomeson: build display-tree example
Hannes Reinecke [Tue, 29 Mar 2022 08:03:35 +0000 (10:03 +0200)]
meson: build display-tree example

The 'display-tree' example program wasn't build with meson.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoMerge pull request #307 from bjpaupor/lbstm
Daniel Wagner [Fri, 25 Mar 2022 14:40:22 +0000 (15:40 +0100)]
Merge pull request #307 from bjpaupor/lbstm

Add lbstm support for create-ns

2 years agoMerge pull request #315 from igaw/fix-host-traddr-free
Daniel Wagner [Fri, 25 Mar 2022 09:36:43 +0000 (10:36 +0100)]
Merge pull request #315 from igaw/fix-host-traddr-free

fabrics: Free old traddr in nvmf_add_ctrl

2 years agoMerge pull request #308 from Arunpandian15/tests_23_03
Daniel Wagner [Fri, 25 Mar 2022 09:35:04 +0000 (10:35 +0100)]
Merge pull request #308 from Arunpandian15/tests_23_03

test: print test logs for pass case

2 years agotest: print test logs for pass case
Arunpandian J [Fri, 25 Mar 2022 03:56:47 +0000 (09:26 +0530)]
test: print test logs for pass case

test log print for passed cases and aligning
log output.

Signed-off-by: Arunpandian J <apj.arun@samsung.com>
2 years agofabrics: Free old traddr in nvmf_add_ctrl
Daniel Wagner [Thu, 24 Mar 2022 18:56:48 +0000 (19:56 +0100)]
fabrics: Free old traddr in nvmf_add_ctrl

We need to free the old traddr and not the newly translated traddr.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #306 from jeffreyalien/nvme-2.0-2
Daniel Wagner [Thu, 24 Mar 2022 15:44:03 +0000 (16:44 +0100)]
Merge pull request #306 from jeffreyalien/nvme-2.0-2

Nvme 2.0 Changes

2 years agoRemove nvme_init_id_ns
Brandon Paupore [Thu, 24 Mar 2022 14:46:19 +0000 (09:46 -0500)]
Remove nvme_init_id_ns

Function was used only once in nvme-cli for the create-ns command,
instead just handle setting the fields in nvme-cli directly.

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
2 years agoAdd lbstm support for create-ns
Brandon Paupore [Thu, 24 Mar 2022 14:51:28 +0000 (09:51 -0500)]
Add lbstm support for create-ns

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
2 years agotypes: Add support for get log - MI Command Supported
Jeff Lien [Tue, 22 Mar 2022 15:54:01 +0000 (10:54 -0500)]
types: Add support for get log - MI Command Supported

Add API to get NVMe-MI Commands Supported and Effects log page.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
2 years agotypes: Add new Identify constant
Jeff Lien [Mon, 21 Mar 2022 21:23:01 +0000 (16:23 -0500)]
types: Add new Identify constant

Add IDENTIFY_CNS_CSI_ID_NS_DATA_STRUCTURE/0x1B define

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
2 years agotypes: Update persistent event entry struct added new fields
Jeff Lien [Mon, 21 Mar 2022 21:17:29 +0000 (16:17 -0500)]
types: Update persistent event entry struct added new fields

Add missing ehai and pelpid members.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
2 years agotypes: Add Host Initiated Data Gen Number to telemetry log struct
Jeff Lien [Mon, 21 Mar 2022 21:06:03 +0000 (16:06 -0500)]
types: Add Host Initiated Data Gen Number to telemetry log struct

2 years agoMerge pull request #292 from tbzatek/errno-fixes-1
Daniel Wagner [Thu, 24 Mar 2022 12:15:27 +0000 (13:15 +0100)]
Merge pull request #292 from tbzatek/errno-fixes-1

tree: nvme_configure_ctrl(): Set errno to zero on success

2 years agoMerge pull request #310 from igaw/nvme_chomp
Daniel Wagner [Thu, 24 Mar 2022 12:13:06 +0000 (13:13 +0100)]
Merge pull request #310 from igaw/nvme_chomp

fabrics: Avoid out of bounds string chomping

2 years agoMerge pull request #314 from glimchb/codecov
Daniel Wagner [Thu, 24 Mar 2022 12:06:18 +0000 (13:06 +0100)]
Merge pull request #314 from glimchb/codecov

ci: add code coverage

2 years agoci: add code coverage
Boris Glimcher [Thu, 24 Mar 2022 10:12:30 +0000 (12:12 +0200)]
ci: add code coverage

From https://mesonbuild.com/howtox.html#producing-a-coverage-report
Upload a report to https://codecov.io/

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
2 years agoMerge pull request #313 from glimchb/badges
Daniel Wagner [Thu, 24 Mar 2022 09:23:15 +0000 (10:23 +0100)]
Merge pull request #313 from glimchb/badges

readme: Add github badges

2 years agoMerge pull request #311 from glimchb/ci
Daniel Wagner [Thu, 24 Mar 2022 09:21:26 +0000 (10:21 +0100)]
Merge pull request #311 from glimchb/ci

CI: fixing dist packaging error

2 years agoreadme: Add github badges
Boris Glimcher [Wed, 23 Mar 2022 20:57:14 +0000 (22:57 +0200)]
readme: Add github badges

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
2 years agoCI: fixing dist packaging error
Boris Glimcher [Wed, 23 Mar 2022 20:10:17 +0000 (22:10 +0200)]
CI: fixing dist packaging error

Fixes #303

python.platlibdir and python.install_env are mutually exclusive

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
2 years agoMerge pull request #309 from tbzatek/init-subsystem-2
Daniel Wagner [Wed, 23 Mar 2022 14:59:46 +0000 (15:59 +0100)]
Merge pull request #309 from tbzatek/init-subsystem-2

tree: Handle NULL subsysname in nvme_scan_ctrl()

2 years agofabrics: Avoid out of bounds string chomping
Daniel Wagner [Wed, 23 Mar 2022 14:49:38 +0000 (15:49 +0100)]
fabrics: Avoid out of bounds string chomping

Update all callsides of nvme_chomp to use the correct max lenght of
the string to avoid out of bounds access.

While at it, nvme_chomp() is used by fabrics.c to sanitize the traddr
and trsvcid. There is no user outside of fabrics and clearly this is a
small helper function. Thus move it to fabrics and rename it to a more
comon name strchomp.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agotree: Handle NULL subsysname in nvme_scan_ctrl()
Tomas Bzatek [Wed, 23 Mar 2022 12:17:02 +0000 (13:17 +0100)]
tree: Handle NULL subsysname in nvme_scan_ctrl()

As noted couple of lines earlier, the subsysname string might
be NULL. In that case, defer initialization of nvme_subsystem_t
in hope that it would get initialized while scanning subsystems.

2 years agoMerge pull request #304 from tbzatek/init-subsystem-1
Daniel Wagner [Wed, 23 Mar 2022 07:46:22 +0000 (08:46 +0100)]
Merge pull request #304 from tbzatek/init-subsystem-1

tree: Fix subsystem initialization in nvme_scan_ctrl()

2 years agotree: Fix subsystem initialization in nvme_scan_ctrl()
Tomas Bzatek [Tue, 22 Mar 2022 15:22:30 +0000 (16:22 +0100)]
tree: Fix subsystem initialization in nvme_scan_ctrl()

The subsystem instance would normally get properly initialized
in later stages of topology scanning, unless there's a host
mismatch and the instance would stand alone.

2 years agoMerge pull request #302 from martin-gpy/update_log_level
Daniel Wagner [Tue, 22 Mar 2022 10:17:56 +0000 (11:17 +0100)]
Merge pull request #302 from martin-gpy/update_log_level

fabrics: update log level for write failures

2 years agofabrics: update log level for write failures
Martin George [Tue, 22 Mar 2022 07:34:43 +0000 (13:04 +0530)]
fabrics: update log level for write failures

Update the log level to LOG_ERR for write failures in
__nvmf_add_ctrl().

Signed-off-by: Martin George <marting@netapp.com>
2 years agoMerge pull request #299 from tbzatek/covscan-fixes-1
Daniel Wagner [Mon, 21 Mar 2022 14:51:21 +0000 (15:51 +0100)]
Merge pull request #299 from tbzatek/covscan-fixes-1

Misc. static analyzer fixes

2 years agoMerge pull request #301 from Arunpandian15/doc_20
Daniel Wagner [Mon, 21 Mar 2022 14:47:54 +0000 (15:47 +0100)]
Merge pull request #301 from Arunpandian15/doc_20

Streamlining documentation

2 years agoioctl: Align arguments indentation with braces
Arunpandian J [Mon, 21 Mar 2022 04:16:06 +0000 (09:46 +0530)]
ioctl: Align arguments indentation with braces

Aligned function arguments indentation with open braces

Signed-off-by: Arunpandian J <apj.arun@samsung.com>
2 years agofabrics: Streamlining documentation
Arunpandian J [Mon, 21 Mar 2022 03:55:51 +0000 (09:25 +0530)]
fabrics: Streamlining documentation

Aligning whitespace indentation

Signed-off-by: Arunpandian J <apj.arun@samsung.com>
2 years agotree: Fix leaking 'name' in nvme_subsystem_lookup_namespace()
Tomas Bzatek [Fri, 18 Mar 2022 16:59:25 +0000 (17:59 +0100)]
tree: Fix leaking 'name' in nvme_subsystem_lookup_namespace()

2 years agotree: Avoid dereferencing nvme_subsystem_t before its check for NULL
Tomas Bzatek [Fri, 18 Mar 2022 16:54:30 +0000 (17:54 +0100)]
tree: Avoid dereferencing nvme_subsystem_t before its check for NULL

2 years agofabrics: Fix leaking ctrl in nvmf_connect_disc_entry()
Tomas Bzatek [Fri, 18 Mar 2022 16:45:26 +0000 (17:45 +0100)]
fabrics: Fix leaking ctrl in nvmf_connect_disc_entry()

2 years agofabrics: Add missing break in a switch
Tomas Bzatek [Fri, 18 Mar 2022 16:43:20 +0000 (17:43 +0100)]
fabrics: Add missing break in a switch

No functional change, just a static analyzer warning.

2 years agodoc: Provide SYSCONFDIR without quotes v1.0-rc7
Daniel Wagner [Fri, 18 Mar 2022 16:40:19 +0000 (17:40 +0100)]
doc: Provide SYSCONFDIR without quotes

Unfortunately, we can't use the configuration data object defined in
the top meson.build file as this one is with quotes. Instead, making
the c code ugly, just provide a new configuration data object without
the quotes. This avoid generating strings suchs as

  "/etc"/nvme/hostnqn

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agotree: Clarify NULL return values from nvme_get_attr()
Tomas Bzatek [Fri, 18 Mar 2022 16:08:44 +0000 (17:08 +0100)]
tree: Clarify NULL return values from nvme_get_attr()

Returned NULL value means either an empty string or an error
reading the sysfs attribute. The only way to distinguish that
is by errno.

2 years agotree: nvme_configure_ctrl(): Set errno to zero on success
Tomas Bzatek [Mon, 14 Mar 2022 17:09:38 +0000 (18:09 +0100)]
tree: nvme_configure_ctrl(): Set errno to zero on success

2 years agoMerge pull request #297 from igaw/fix-stringify-hostnqn
Daniel Wagner [Fri, 18 Mar 2022 15:19:50 +0000 (16:19 +0100)]
Merge pull request #297 from igaw/fix-stringify-hostnqn

fabrics: Correctly stringify default hostnqn and hostid paths

2 years agoMerge pull request #298 from hreinecke/log-page-len
Hannes Reinecke [Fri, 18 Mar 2022 15:15:16 +0000 (16:15 +0100)]
Merge pull request #298 from hreinecke/log-page-len

linux: fixup log page offset in nvme_get_log_page()

2 years agofabrics: Correctly stringify default hostnqn and hostid paths
Daniel Wagner [Fri, 18 Mar 2022 13:05:27 +0000 (14:05 +0100)]
fabrics: Correctly stringify default hostnqn and hostid paths

Fixes: f356ab0ca74a ("fabrics: Allow to change sysconfdir for hostnqn and hostid file")
Reported-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #296 from igaw/set_default_trsvcid
Hannes Reinecke [Fri, 18 Mar 2022 13:58:37 +0000 (14:58 +0100)]
Merge pull request #296 from igaw/set_default_trsvcid

tree: Add support for default trsvcid for all controllers

2 years agolinux: fixup log page offset in nvme_get_log_page()
Hannes Reinecke [Fri, 18 Mar 2022 13:54:07 +0000 (14:54 +0100)]
linux: fixup log page offset in nvme_get_log_page()

When resubmitting the log page with a different length in
nvme_get_log_page() we need to store the original length
of the log page to avoid the length being overwritten.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agotree: Add support for default trsvcid for all controllers
Daniel Wagner [Fri, 18 Mar 2022 08:33:21 +0000 (09:33 +0100)]
tree: Add support for default trsvcid for all controllers

When the user doesn't provide trsvcid always use the default values
for tcp/rdma transport.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #290 from glimchb/rpm
Daniel Wagner [Wed, 16 Mar 2022 11:30:37 +0000 (12:30 +0100)]
Merge pull request #290 from glimchb/rpm

rpm: add makefile rule for rpms

2 years agoMerge pull request #293 from igaw/fix-sysconfdir
Daniel Wagner [Wed, 16 Mar 2022 11:17:38 +0000 (12:17 +0100)]
Merge pull request #293 from igaw/fix-sysconfdir

fabrics: Allow to change sysconfdir for hostnqn and hostid file

2 years agoMerge pull request #294 from hreinecke/disc-ttrsvcid
Daniel Wagner [Wed, 16 Mar 2022 11:16:43 +0000 (12:16 +0100)]
Merge pull request #294 from hreinecke/disc-ttrsvcid

tree: fixup coredump during nvme discover

2 years agotree: fixup coredump during nvme discover
Hannes Reinecke [Wed, 16 Mar 2022 10:40:55 +0000 (11:40 +0100)]
tree: fixup coredump during nvme discover

nvme_free_ctrl() expects the 'trsvcid' string to be dynamically
allocated; just calling 'stringify' will cause a coredump on exit.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agofabrics: Allow to change sysconfdir for hostnqn and hostid file
Daniel Wagner [Tue, 15 Mar 2022 11:09:58 +0000 (12:09 +0100)]
fabrics: Allow to change sysconfdir for hostnqn and hostid file

Instead hard coding the sysconfdir allow the user to overwrite the
location of the hostnqn and hostid file. The default is "/etc" but
when configured with --prefix=DIR the files should be read from
"DIR/nvme/".

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agorpm: add makefile rule for rpms
Boris Glimcher [Mon, 14 Mar 2022 12:44:07 +0000 (14:44 +0200)]
rpm: add makefile rule for rpms

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
2 years agoMerge pull request #289 from glimchb/rpm
Daniel Wagner [Mon, 14 Mar 2022 08:56:05 +0000 (09:56 +0100)]
Merge pull request #289 from glimchb/rpm

dist: add missing BuildRequires to spec file

2 years agodist: add missing BuildRequires to spec file
Boris Glimcher [Sun, 13 Mar 2022 14:23:26 +0000 (16:23 +0200)]
dist: add missing BuildRequires to spec file

According to https://docs.fedoraproject.org/en-US/packaging-guidelines/Meson/

Fixes #288

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
2 years agodoc: Regenerate all documentation v1.0-rc6
Daniel Wagner [Fri, 11 Mar 2022 16:01:20 +0000 (17:01 +0100)]
doc: Regenerate all documentation

Prepare for next release candiate.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #283 from hreinecke/ana-path
Hannes Reinecke [Fri, 11 Mar 2022 13:43:51 +0000 (14:43 +0100)]
Merge pull request #283 from hreinecke/ana-path

tree: add nvme_ctrl_get_ana_state()

2 years agotree: add nvme_ctrl_get_ana_state()
Hannes Reinecke [Fri, 11 Mar 2022 08:06:36 +0000 (09:06 +0100)]
tree: add nvme_ctrl_get_ana_state()

Add a function to return the ANA state of a namespace on a given
controller.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agotree: link paths to namespaces in nvme_subsystem_scan_namespace()
Hannes Reinecke [Fri, 11 Mar 2022 12:43:08 +0000 (13:43 +0100)]
tree: link paths to namespaces in nvme_subsystem_scan_namespace()

Depending on the order of scanning nvme_subsystem_scan_namespace()
might be called after nvme_scan_ctrl(), causing the links from
paths to namespaces to be missing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoMerge pull request #282 from glimchb/wheel2
Daniel Wagner [Fri, 11 Mar 2022 11:29:44 +0000 (12:29 +0100)]
Merge pull request #282 from glimchb/wheel2

CI: add python wheel build in addition to source package

2 years agoMerge pull request #284 from hreinecke/filter-doc
Hannes Reinecke [Fri, 11 Mar 2022 09:02:11 +0000 (10:02 +0100)]
Merge pull request #284 from hreinecke/filter-doc

Document filter functions

2 years agoDocument filter functions
Hannes Reinecke [Fri, 11 Mar 2022 08:37:37 +0000 (09:37 +0100)]
Document filter functions

Add documentation for the various filter functions.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agoCI: add python wheel build in addition to source package
Boris Glimcher [Mon, 28 Feb 2022 17:24:02 +0000 (19:24 +0200)]
CI: add python wheel build in addition to source package

When using source distribution,
python package will be compiled during pip install.

Wheels make the end-to-end installation of Python packages faster:
- wheels are typically smaller in size than source distributions
- pip fetches a prebuilt wheel and avoids the intermediate step of building

So why cibuildwheel and manylinux?

See https://github.com/pypa/manylinux and https://github.com/pypa/cibuildwheel

The goal of the manylinux project is to provide a convenient way to distribute binary Python extensions as wheels on Linux

See https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml

Skipping musllinux and auditwheel repair.
Skipping MacOS and Windows for now.

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
2 years agoMerge pull request #281 from glimchb/opensslci
Daniel Wagner [Tue, 8 Mar 2022 13:50:54 +0000 (14:50 +0100)]
Merge pull request #281 from glimchb/opensslci

CI: add test for subproject fallbacks compilation

2 years agoCI: add test for subproject fallbacks compilation
Boris Glimcher [Tue, 1 Mar 2022 12:30:36 +0000 (14:30 +0200)]
CI: add test for subproject fallbacks compilation

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
2 years agoMerge pull request #280 from glimchb/test
Daniel Wagner [Tue, 8 Mar 2022 10:09:26 +0000 (11:09 +0100)]
Merge pull request #280 from glimchb/test

test: adding dependency on pynvme