const struct nvme_fabrics_config *cfg)
{
nvme_subsystem_t s;
+ const char *root_app, *app;
char *argstr;
int ret;
}
+ root_app = nvme_root_get_application(h->r);
+ app = nvme_subsystem_get_application(s);
+ if (root_app) {
+ /*
+ * configuration is managed by an application,
+ * refuse to act on subsystems which either have
+ * no application set or which habe a different
+ * application string.
+ */
+ if (!app || strcmp(app, root_app)) {
+ nvme_msg(h->r, LOG_INFO, "skip %s, not managed by %s\n",
+ nvme_subsystem_get_nqn(s), root_app);
+ errno = ENVME_CONNECT_INVAL;
+ return -1;
+ }
+ }
+
nvme_ctrl_set_discovered(c, true);
if (traddr_is_hostname(h->r, c)) {
char *traddr = c->traddr;
if (name && s->name &&
strcmp(s->name, name))
continue;
+ if (h->r->application) {
+ if (!s->application)
+ continue;
+ if (strcmp(h->r->application, s->application))
+ continue;
+ }
return s;
}
return nvme_alloc_subsystem(h, name, subsysnqn);
}
s->name = strdup(name);
s->sysfs_dir = (char *)path;
+ if (s->h->r->application)
+ s->application = strdup(s->h->r->application);
return 0;
}