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.
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>
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.
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.
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:
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.
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.
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.
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
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>
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.
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/".
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.
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>
Boris Glimcher [Sun, 6 Mar 2022 16:33:12 +0000 (18:33 +0200)]
openssl: update to patch-3 to fix installation issue
Fixes #268
Patch taken from https://mesonbuild.com/Wrapdb-projects.html
Wrap file used https://wrapdb.mesonbuild.com/v2/openssl_1.1.1l-3/openssl.wrap
Fixed by mesonbuild/wrapdb#322
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>