static int spdk_nvmf_parse_port(struct spdk_conf_section *sp) { struct spdk_nvmf_port *port; struct spdk_nvmf_fabric_intf *fabric_intf; char *listen_addr, *host, *listen_port; int i = 0, rc = 0; /* Create the Subsystem Port */ port = spdk_nvmf_port_create(sp->num); if (!port) { SPDK_ERRLOG("Port create failed\n"); return -1; } /* Loop over the fabric interfaces and add them to the port */ for (i = 0; ; i++) { listen_addr = spdk_conf_section_get_nmval(sp, "FabricIntf", i, 0); if (listen_addr == NULL) { break; } rc = spdk_nvmf_parse_addr(listen_addr, &host, &listen_port); if (rc < 0) { continue; } fabric_intf = spdk_nvmf_fabric_intf_create(host, listen_port); if (!fabric_intf) { continue; } spdk_nvmf_port_add_fabric_intf(port, fabric_intf); } if (TAILQ_EMPTY(&port->head)) { SPDK_ERRLOG("No fabric interface found\n"); return -1; } return 0; }
static int blockdev_aio_initialize(void) { struct spdk_bdev *bdev; int i; const char *val = NULL; char *file; struct spdk_conf_section *sp = spdk_conf_find_section(NULL, "AIO"); bool skip_missing = false; if (sp != NULL) { val = spdk_conf_section_get_val(sp, "SkipMissingFiles"); } if (val != NULL && !strcmp(val, "Yes")) { skip_missing = true; } if (sp != NULL) { for (i = 0; ; i++) { val = spdk_conf_section_get_nval(sp, "AIO", i); if (val == NULL) break; file = spdk_conf_section_get_nmval(sp, "AIO", i, 0); if (file == NULL) { SPDK_ERRLOG("AIO%d: format error\n", i); return -1; } bdev = create_aio_disk(file); if (bdev == NULL && !skip_missing) { return -1; } } } return 0; }