spdk_env_opts_init() reinitializes the whole spdk_env_opts struct,
overwriting pci_allowed/pci_whitelist and num_pci_addr that were set
just above it. As a result the local PCI device restriction never took
effect. Initialize opts first, then fill in the PCI address fields.
Fixes: https://tracker.ceph.com/issues/77802
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
struct spdk_pci_addr addr;
int r;
+ spdk_env_opts_init(&opts);
+
bool local_pci_device = false;
int rc = spdk_pci_addr_parse(&addr, trid.traddr);
if (!rc) {
opts.num_pci_addr = 1;
}
- spdk_env_opts_init(&opts);
opts.name = "nvme-device-manager";
opts.core_mask = coremask_arg.c_str();
#if SPDK_VERSION >= SPDK_VERSION_NUM(21, 1, 0)