Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libnvme for openSUSE:Factory checked in at 2022-04-10 19:05:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libnvme (Old) and /work/SRC/openSUSE:Factory/.libnvme.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libnvme" Sun Apr 10 19:05:25 2022 rev:10 rq:967889 version:1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libnvme/libnvme.changes 2022-04-03 21:30:48.947936559 +0200 +++ /work/SRC/openSUSE:Factory/.libnvme.new.1900/libnvme.changes 2022-04-10 19:05:39.190334381 +0200 @@ -1,0 +2,11 @@ +Fri Apr 08 17:04:22 UTC 2022 - Daniel Wagner <daniel.wag...@suse.com> + +- Update to version 1.0: + * tree: Remove default port setting for TCP and RDMA ports + * tree: add 'f_args' argument to pass user data to the filter function + * tree: remove 'ctrl_get_ana_state()' + * tree: add namespace path iterators + * tree: filter out namespaces + * tree: update nvme_scan_filter_t usage + +------------------------------------------------------------------- Old: ---- libnvme-1.0~8.obscpio New: ---- libnvme-1.0.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libnvme.spec ++++++ --- /var/tmp/diff_new_pack.iMh7vj/_old 2022-04-10 19:05:39.678328978 +0200 +++ /var/tmp/diff_new_pack.iMh7vj/_new 2022-04-10 19:05:39.686328889 +0200 @@ -19,7 +19,7 @@ %define sover 1 Name: libnvme -Version: 1.0~8 +Version: 1.0 Release: 0 Summary: Linux-native nvme device management library License: LGPL-2.1-or-later ++++++ _service ++++++ --- /var/tmp/diff_new_pack.iMh7vj/_old 2022-04-10 19:05:39.738328314 +0200 +++ /var/tmp/diff_new_pack.iMh7vj/_new 2022-04-10 19:05:39.742328270 +0200 @@ -3,12 +3,10 @@ <param name="scm">git</param> <param name="url">https://github.com/linux-nvme/libnvme.git</param> <param name="filename">libnvme</param> - <!-- <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> --> <param name="versionformat">@PARENT_TAG@</param> - <param name="revision">v1.0-rc8</param> - <param name="match-tag">v[01].[0-9]*</param> - <param name="versionrewrite-pattern">v([^+]*)-rc([0-9]+)</param> - <param name="versionrewrite-replacement">\1~\2</param> + <param name="revision">v1.0</param> + <param name="versionrewrite-pattern">v(\d+.\d+)</param> + <param name="versionrewrite-replacement">\1</param> <param name="changesgenerate">enable</param> </service> <service name="set_version" mode="manual"> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.iMh7vj/_old 2022-04-10 19:05:39.762328048 +0200 +++ /var/tmp/diff_new_pack.iMh7vj/_new 2022-04-10 19:05:39.766328004 +0200 @@ -1,7 +1,7 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/linux-nvme/libnvme.git</param> - <param name="changesrevision">008a2dacdc0d29f57ec7cfd5bd6e89bf4d531081</param> + <param name="changesrevision">033449f7c61c130fd21f0a747075dc15069f73f0</param> </service> </servicedata> (No newline at EOF) ++++++ libnvme-1.0~8.obscpio -> libnvme-1.0.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/doc/man/nvme_ctrl_get_ana_state.2 new/libnvme-1.0/doc/man/nvme_ctrl_get_ana_state.2 --- old/libnvme-1.0~8/doc/man/nvme_ctrl_get_ana_state.2 2022-04-01 14:47:29.000000000 +0200 +++ new/libnvme-1.0/doc/man/nvme_ctrl_get_ana_state.2 1970-01-01 01:00:00.000000000 +0100 @@ -1,14 +0,0 @@ -.TH "nvme_ctrl_get_ana_state" 9 "nvme_ctrl_get_ana_state" "April 2022" "libnvme API manual" LINUX -.SH NAME -nvme_ctrl_get_ana_state \- ANA state of a controller path -.SH SYNOPSIS -.B "const char *" nvme_ctrl_get_ana_state -.BI "(nvme_ctrl_t c " "," -.BI "__u32 nsid " ");" -.SH ARGUMENTS -.IP "c" 12 -Constroller instance -.IP "nsid" 12 -Namespace ID to evaluate -.SH "RETURN" -ANA state of the namespace \fInsid\fP on controller \fIc\fP. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/doc/man/nvme_namespace_first_path.2 new/libnvme-1.0/doc/man/nvme_namespace_first_path.2 --- old/libnvme-1.0~8/doc/man/nvme_namespace_first_path.2 1970-01-01 01:00:00.000000000 +0100 +++ new/libnvme-1.0/doc/man/nvme_namespace_first_path.2 2022-04-08 18:14:55.000000000 +0200 @@ -0,0 +1,11 @@ +.TH "nvme_namespace_first_path" 9 "nvme_namespace_first_path" "April 2022" "libnvme API manual" LINUX +.SH NAME +nvme_namespace_first_path \- Start path iterator +.SH SYNOPSIS +.B "nvme_path_t" nvme_namespace_first_path +.BI "(nvme_ns_t ns " ");" +.SH ARGUMENTS +.IP "ns" 12 +Namespace instance +.SH "RETURN" +First \fInvme_path_t\fP object of an \fIns\fP iterator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/doc/man/nvme_namespace_for_each_path.2 new/libnvme-1.0/doc/man/nvme_namespace_for_each_path.2 --- old/libnvme-1.0~8/doc/man/nvme_namespace_for_each_path.2 1970-01-01 01:00:00.000000000 +0100 +++ new/libnvme-1.0/doc/man/nvme_namespace_for_each_path.2 2022-04-08 18:14:55.000000000 +0200 @@ -0,0 +1,12 @@ +.TH "nvme_namespace_for_each_path" 9 "nvme_namespace_for_each_path" "April 2022" "libnvme API manual" LINUX +.SH NAME +nvme_namespace_for_each_path \- Traverse paths +.SH SYNOPSIS +.B "nvme_namespace_for_each_path +.BI "(c " "," +.BI "p " ");" +.SH ARGUMENTS +.IP "c" 12 +-- undescribed -- +.IP "p" 12 +\fInvme_path_t\fP object diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/doc/man/nvme_namespace_for_each_path_safe.2 new/libnvme-1.0/doc/man/nvme_namespace_for_each_path_safe.2 --- old/libnvme-1.0~8/doc/man/nvme_namespace_for_each_path_safe.2 1970-01-01 01:00:00.000000000 +0100 +++ new/libnvme-1.0/doc/man/nvme_namespace_for_each_path_safe.2 2022-04-08 18:14:55.000000000 +0200 @@ -0,0 +1,15 @@ +.TH "nvme_namespace_for_each_path_safe" 9 "nvme_namespace_for_each_path_safe" "April 2022" "libnvme API manual" LINUX +.SH NAME +nvme_namespace_for_each_path_safe \- Traverse paths +.SH SYNOPSIS +.B "nvme_namespace_for_each_path_safe +.BI "(n " "," +.BI "p " "," +.BI "_p " ");" +.SH ARGUMENTS +.IP "n" 12 +-- undescribed -- +.IP "p" 12 +\fInvme_path_t\fP object +.IP "_p" 12 +A \fInvme_path_t_node\fP to use as temporary storage diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/doc/man/nvme_namespace_next_path.2 new/libnvme-1.0/doc/man/nvme_namespace_next_path.2 --- old/libnvme-1.0~8/doc/man/nvme_namespace_next_path.2 1970-01-01 01:00:00.000000000 +0100 +++ new/libnvme-1.0/doc/man/nvme_namespace_next_path.2 2022-04-08 18:14:55.000000000 +0200 @@ -0,0 +1,14 @@ +.TH "nvme_namespace_next_path" 9 "nvme_namespace_next_path" "April 2022" "libnvme API manual" LINUX +.SH NAME +nvme_namespace_next_path \- Next path iterator +.SH SYNOPSIS +.B "nvme_path_t" nvme_namespace_next_path +.BI "(nvme_ns_t c " "," +.BI "nvme_path_t p " ");" +.SH ARGUMENTS +.IP "c" 12 +-- undescribed -- +.IP "p" 12 +Previous \fInvme_path_t\fP object of an \fIns\fP iterator +.SH "RETURN" +Next \fInvme_path_t\fP object of an \fIns\fP iterator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/doc/man/nvme_scan_topology.2 new/libnvme-1.0/doc/man/nvme_scan_topology.2 --- old/libnvme-1.0~8/doc/man/nvme_scan_topology.2 2022-04-01 14:47:29.000000000 +0200 +++ new/libnvme-1.0/doc/man/nvme_scan_topology.2 2022-04-08 18:14:55.000000000 +0200 @@ -4,12 +4,15 @@ .SH SYNOPSIS .B "int" nvme_scan_topology .BI "(nvme_root_t r " "," -.BI "nvme_scan_filter_t f " ");" +.BI "nvme_scan_filter_t f " "," +.BI "void *f_args " ");" .SH ARGUMENTS .IP "r" 12 nvme_root_t object .IP "f" 12 filter to apply +.IP "f_args" 12 +user-specified argument to \fIf\fP .SH "DESCRIPTION" Scans the NVMe topology and filters out the resulting elements by applying \fIf\fP. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/src/libnvme.map new/libnvme-1.0/src/libnvme.map --- old/libnvme-1.0~8/src/libnvme.map 2022-04-01 14:47:29.000000000 +0200 +++ new/libnvme-1.0/src/libnvme.map 2022-04-08 18:14:55.000000000 +0200 @@ -12,7 +12,6 @@ nvme_ctrl_first_ns; nvme_ctrl_first_path; nvme_ctrl_get_address; - nvme_ctrl_get_ana_state; nvme_ctrl_get_dhchap_key; nvme_ctrl_get_discovery_ctrl; nvme_ctrl_get_fd; @@ -185,6 +184,8 @@ nvme_namespace_attach_ctrls; nvme_namespace_detach_ctrls; nvme_namespace_filter; + nvme_namespace_first_path; + nvme_namespace_next_path; nvme_next_host; nvme_next_subsystem; nvme_ns_attach; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/src/nvme/log.h new/libnvme-1.0/src/nvme/log.h --- old/libnvme-1.0~8/src/nvme/log.h 2022-04-01 14:47:29.000000000 +0200 +++ new/libnvme-1.0/src/nvme/log.h 2022-04-08 18:14:55.000000000 +0200 @@ -8,6 +8,9 @@ #include <stdbool.h> #include <syslog.h> +/* for nvme_root_t */ +#include "tree.h" + #ifndef MAX_LOGLEVEL # define MAX_LOGLEVEL LOG_DEBUG #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/src/nvme/tree.c new/libnvme-1.0/src/nvme/tree.c --- old/libnvme-1.0~8/src/nvme/tree.c 2022-04-01 14:47:29.000000000 +0200 +++ new/libnvme-1.0/src/nvme/tree.c 2022-04-08 18:14:55.000000000 +0200 @@ -39,10 +39,11 @@ static void __nvme_free_host(nvme_host_t h); static void __nvme_free_ctrl(nvme_ctrl_t c); static int nvme_subsystem_scan_namespace(nvme_root_t r, - struct nvme_subsystem *s, char *name); + struct nvme_subsystem *s, char *name, + nvme_scan_filter_t f, void *f_args); static int nvme_init_subsystem(nvme_subsystem_t s, const char *name); static int nvme_scan_subsystem(nvme_root_t r, const char *name, - nvme_scan_filter_t f); + nvme_scan_filter_t f, void *f_args); static int nvme_ctrl_scan_namespace(nvme_root_t r, struct nvme_ctrl *c, char *name); static int nvme_ctrl_scan_path(nvme_root_t r, struct nvme_ctrl *c, char *name); @@ -75,7 +76,7 @@ return h; } -int nvme_scan_topology(struct nvme_root *r, nvme_scan_filter_t f) +int nvme_scan_topology(struct nvme_root *r, nvme_scan_filter_t f, void *f_args) { struct dirent **subsys, **ctrls; int i, num_subsys, num_ctrls, ret; @@ -97,7 +98,7 @@ ctrls[i]->d_name, strerror(errno)); continue; } - if ((f) && !f(c->s)) { + if ((f) && !f(NULL, c, NULL, f_args)) { nvme_msg(r, LOG_DEBUG, "filter out controller %s\n", ctrls[i]->d_name); nvme_free_ctrl(c); @@ -114,7 +115,7 @@ } for (i = 0; i < num_subsys; i++) { - ret = nvme_scan_subsystem(r, subsys[i]->d_name, f); + ret = nvme_scan_subsystem(r, subsys[i]->d_name, f, f_args); if (ret < 0) { nvme_msg(r, LOG_DEBUG, "failed to scan subsystem %s: %s\n", @@ -172,7 +173,7 @@ { nvme_root_t r = nvme_create_root(NULL, DEFAULT_LOGLEVEL); - nvme_scan_topology(r, NULL); + nvme_scan_topology(r, NULL, NULL); nvme_read_config(r, config_file); return r; } @@ -266,7 +267,7 @@ nvme_for_each_host_safe(r, h, _h) __nvme_free_host(h); - nvme_scan_topology(r, NULL); + nvme_scan_topology(r, NULL, NULL); } void nvme_free_tree(nvme_root_t r) @@ -325,6 +326,16 @@ return n ? list_next(&s->namespaces, n, entry) : NULL; } +nvme_path_t nvme_namespace_first_path(nvme_ns_t ns) +{ + return list_top(&ns->paths, struct nvme_path, nentry); +} + +nvme_path_t nvme_namespace_next_path(nvme_ns_t ns, nvme_path_t p) +{ + return p ? list_next(&ns->paths, p, nentry) : NULL; +} + static void __nvme_free_ns(struct nvme_ns *n) { list_del_init(&n->entry); @@ -465,7 +476,8 @@ return h; } -static int nvme_subsystem_scan_namespaces(nvme_root_t r, nvme_subsystem_t s) +static int nvme_subsystem_scan_namespaces(nvme_root_t r, nvme_subsystem_t s, + nvme_scan_filter_t f, void *f_args) { struct dirent **namespaces; int i, num_ns, ret; @@ -480,7 +492,7 @@ for (i = 0; i < num_ns; i++) { ret = nvme_subsystem_scan_namespace(r, s, - namespaces[i]->d_name); + namespaces[i]->d_name, f, f_args); if (ret < 0) nvme_msg(r, LOG_DEBUG, "failed to scan namespace %s: %s\n", @@ -517,7 +529,7 @@ } static int nvme_scan_subsystem(struct nvme_root *r, const char *name, - nvme_scan_filter_t f) + nvme_scan_filter_t f, void *f_args) { struct nvme_subsystem *s = NULL, *_s; char *path, *subsysnqn; @@ -573,13 +585,14 @@ if (!s) return -1; - nvme_subsystem_scan_namespaces(r, s); - - if (f && !f(s)) { + if (f && !f(s, NULL, NULL, f_args)) { nvme_msg(r, LOG_DEBUG, "filter out subsystem %s\n", name); __nvme_free_subsystem(s); + return 0; } + nvme_subsystem_scan_namespaces(r, s, f, f_args); + return 0; } @@ -789,19 +802,6 @@ return c->cfg.host_iface; } -const char *nvme_ctrl_get_ana_state(nvme_ctrl_t c, __u32 nsid) -{ - if (nsid != NVME_NSID_ALL) { - nvme_path_t p; - - nvme_ctrl_for_each_path(c, p) { - if (p->n && p->n->nsid == nsid) - return p->ana_state; - } - } - return NULL; -} - struct nvme_fabrics_config *nvme_ctrl_get_config(nvme_ctrl_t c) { return &c->cfg; @@ -951,25 +951,6 @@ __nvme_free_ctrl(c); } -#define ____stringify(x...) #x -#define __stringify(x...) ____stringify(x) - -static void set_default_trsvcid(nvme_ctrl_t c) -{ - if (!strcmp(c->transport, "tcp")) { - if (c->discovery_ctrl) { - /* Default port for NVMe/TCP discovery controllers */ - c->trsvcid = strdup(__stringify(NVME_DISC_IP_PORT)); - } else { - /* Default port for NVMe/TCP io controllers */ - c->trsvcid = strdup(__stringify(NVME_RDMA_IP_PORT)); - } - } else if (!strcmp(c->transport, "rdma")) { - /* Default port for NVMe/RDMA controllers */ - c->trsvcid = strdup(__stringify(NVME_RDMA_IP_PORT)); - } -} - static bool traddr_is_hostname(const char *transport, const char *traddr) { char addrstr[NVMF_TRADDR_SIZE]; @@ -1033,8 +1014,6 @@ c->cfg.host_iface = strdup(host_iface); if (trsvcid) c->trsvcid = strdup(trsvcid); - else - set_default_trsvcid(c); return c; } @@ -1411,9 +1390,9 @@ nvme_root_t r = c->s && c->s->h ? c->s->h->r : NULL; if (!c->s) return; - nvme_subsystem_scan_namespaces(r, c->s); nvme_ctrl_scan_namespaces(r, c); nvme_ctrl_scan_paths(r, c); + nvme_subsystem_scan_namespaces(r, c->s, NULL, NULL); } static int nvme_bytes_to_lba(nvme_ns_t n, off_t offset, size_t count, @@ -1884,7 +1863,7 @@ } static int nvme_subsystem_scan_namespace(nvme_root_t r, nvme_subsystem_t s, - char *name) + char *name, nvme_scan_filter_t f, void *f_args) { struct nvme_ns *n; @@ -1895,7 +1874,11 @@ nvme_msg(r, LOG_DEBUG, "failed to scan namespace %s\n", name); return -1; } - + if (f && !f(NULL, NULL, n, f_args)) { + nvme_msg(r, LOG_DEBUG, "filter out namespace %s\n", name); + __nvme_free_ns(n); + return 0; + } n->s = s; list_add(&s->namespaces, &n->entry); nvme_subsystem_set_ns_path(s, n); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/src/nvme/tree.h new/libnvme-1.0/src/nvme/tree.h --- old/libnvme-1.0~8/src/nvme/tree.h 2022-04-01 14:47:29.000000000 +0200 +++ new/libnvme-1.0/src/nvme/tree.h 2022-04-08 18:14:55.000000000 +0200 @@ -33,7 +33,8 @@ typedef struct nvme_host *nvme_host_t; typedef struct nvme_root *nvme_root_t; -typedef bool (*nvme_scan_filter_t)(nvme_subsystem_t); +typedef bool (*nvme_scan_filter_t)(nvme_subsystem_t, nvme_ctrl_t, + nvme_ns_t, void *); /** * nvme_create_root() - Initialize root object @@ -217,6 +218,23 @@ nvme_ctrl_t nvme_subsystem_next_ctrl(nvme_subsystem_t s, nvme_ctrl_t c); /** + * nvme_namespace_first_path() - Start path iterator + * @ns: Namespace instance + * + * Return: First &nvme_path_t object of an @ns iterator + */ +nvme_path_t nvme_namespace_first_path(nvme_ns_t ns); + +/** + * nvme_namespace_next_path() - Next path iterator + * @ns: Namespace instance + * @p: Previous &nvme_path_t object of an @ns iterator + * + * Return: Next &nvme_path_t object of an @ns iterator + */ +nvme_path_t nvme_namespace_next_path(nvme_ns_t c, nvme_path_t p); + +/** * nvme_lookup_ctrl() - Lookup nvme_ctrl_t object * @s: &nvme_subsystem_t object * @transport: Transport name @@ -404,6 +422,27 @@ n = nvme_subsystem_next_ns(s, n)) /** + * nvme_namespace_for_each_path_safe() - Traverse paths + * @ns: Namespace instance + * @p: &nvme_path_t object + * @_p: A &nvme_path_t_node to use as temporary storage + */ +#define nvme_namespace_for_each_path_safe(n, p, _p) \ + for (p = nvme_namespace_first_path(n), \ + _p = nvme_namespace_next_path(n, p); \ + p != NULL; \ + p = _p, _p = nvme_namespace_next_path(n, p)) + +/** + * nvme_namespace_for_each_path() - Traverse paths + * @ns: Namespace instance + * @p: &nvme_path_t object + */ +#define nvme_namespace_for_each_path(c, p) \ + for (p = nvme_namespace_first_path(c); p != NULL; \ + p = nvme_namespace_next_path(c, p)) + +/** * nvme_ns_get_fd() - Get associated filedescriptor * @n: Namespace instance * @@ -837,15 +876,6 @@ const char *nvme_ctrl_get_host_iface(nvme_ctrl_t c); /** - * nvme_ctrl_get_ana_state() - ANA state of a controller path - * @c: Constroller instance - * @nsid: Namespace ID to evaluate - * - * Return: ANA state of the namespace @nsid on controller @c. - */ -const char *nvme_ctrl_get_ana_state(nvme_ctrl_t c, __u32 nsid); - -/** * nvme_ctrl_get_dhchap_key() - Return controller key * @c: Controller for which the key should be set * @@ -1021,15 +1051,16 @@ /** * nvme_scan_topology() - Scan NVMe topology and apply filter - * @r: nvme_root_t object - * @f: filter to apply + * @r: nvme_root_t object + * @f: filter to apply + * @f_args: user-specified argument to @f * * Scans the NVMe topology and filters out the resulting elements * by applying @f. * * Return: Number of elements scanned */ -int nvme_scan_topology(nvme_root_t r, nvme_scan_filter_t f); +int nvme_scan_topology(nvme_root_t r, nvme_scan_filter_t f, void *f_args); /** * nvme_host_get_hostnqn() - Host NQN of an nvme_host_t object diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/test/meson.build new/libnvme-1.0/test/meson.build --- old/libnvme-1.0~8/test/meson.build 2022-04-01 14:47:29.000000000 +0200 +++ new/libnvme-1.0/test/meson.build 2022-04-08 18:14:55.000000000 +0200 @@ -4,7 +4,11 @@ # Copyright (c) 2021 Dell Inc. # # Authors: Martin Belanger <martin.belan...@dell.com> -# + +# These tests all require interaction with a real NVMe device, so we don't +# define as meson unit-tests, and therefore get run as part of the 'test' +# target. However, they're available for developer use, when hardware is +# available. main = executable( 'main-test', ['test.c'], @@ -33,9 +37,3 @@ link_with: libnvme, include_directories: [incdir, internal_incdir] ) - -test('main', main) -test('main', main, args: ['nvme10']) -test('cpp', main) -test('register', main, args: ['nvme10']) -test('zns', main) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnvme-1.0~8/test/test.c new/libnvme-1.0/test/test.c --- old/libnvme-1.0~8/test/test.c 2022-04-01 14:47:29.000000000 +0200 +++ new/libnvme-1.0/test/test.c 2022-04-08 18:14:55.000000000 +0200 @@ -24,11 +24,14 @@ #include <ccan/endian/endian.h> -static char *nqn_match; - -static bool nvme_match_subsysnqn_filter(nvme_subsystem_t s) +static bool nvme_match_subsysnqn_filter(nvme_subsystem_t s, + nvme_ctrl_t c, nvme_ns_t ns, void *f_args) { - return strcmp(nvme_subsystem_get_nqn(s), nqn_match) == 0; + char *nqn_match = f_args; + + if (s) + return strcmp(nvme_subsystem_get_nqn(s), nqn_match) == 0; + return true; } static int test_ctrl(nvme_ctrl_t c) @@ -321,13 +324,13 @@ nvme_path_t p; nvme_ns_t n; const char *ctrl = "nvme4"; + const char *nqn_match = "testnqn"; printf("Test filter for common loop back target\n"); - nqn_match = "testnqn"; r = nvme_create_root(NULL, DEFAULT_LOGLEVEL); if (!r) return 1; - nvme_scan_topology(r, nvme_match_subsysnqn_filter); + nvme_scan_topology(r, nvme_match_subsysnqn_filter, (void *)nqn_match); nvme_for_each_host(r, h) { nvme_for_each_subsystem(h, s) { printf("%s - NQN=%s\n", nvme_subsystem_get_name(s), ++++++ libnvme.obsinfo ++++++ --- /var/tmp/diff_new_pack.iMh7vj/_old 2022-04-10 19:05:40.110324196 +0200 +++ /var/tmp/diff_new_pack.iMh7vj/_new 2022-04-10 19:05:40.114324152 +0200 @@ -1,5 +1,5 @@ name: libnvme -version: 1.0~8 -mtime: 1648817249 -commit: 008a2dacdc0d29f57ec7cfd5bd6e89bf4d531081 +version: 1.0 +mtime: 1649434495 +commit: 033449f7c61c130fd21f0a747075dc15069f73f0