Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not print error message if ACPI tables are no present #2202

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions nbft.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
#include <fnmatch.h>
#include <stdlib.h>

#include <libnvme.h>

#include "nvme.h"
#include "nbft.h"
#include "libnvme.h"
#include "fabrics.h"
#include "nvme-print.h"

#include "util/types.h"

Expand Down Expand Up @@ -47,10 +49,8 @@ int read_nbft_files(struct list_head *nbft_list, char *path)
struct nbft_info *nbft;

count = scandir(path, &dent, nbft_filter, NULL);
if (count < 0) {
fprintf(stderr, "Failed to open %s.\n", path);
return -1;
}
if (count < 0)
return -errno;

for (i = 0; i < count; i++) {
snprintf(filename, sizeof(filename), "%s/%s", path, dent[i]->d_name);
Expand Down Expand Up @@ -97,8 +97,11 @@ int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg,

list_head_init(&nbft_list);
ret = read_nbft_files(&nbft_list, nbft_path);
if (ret)
if (ret) {
if (ret != ENOENT)
nvme_show_perror("Failed to access ACPI tables directory");
goto out_free_2;
}

list_for_each(&nbft_list, entry, node)
for (ss = entry->nbft->subsystem_ns_list; ss && *ss; ss++)
Expand Down
Loading