Skip to content

Commit

Permalink
Temporarily disable asan
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacKhor committed Jul 19, 2024
1 parent 91de7d0 commit 29e48dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(
'cpp_std=c++23',
'warning_level=2',
'b_colorout=always',
'b_sanitize=address,undefined',
# 'b_sanitize=address,undefined',
'b_lto=true',
'b_thinlto_cache=true',
],
Expand All @@ -22,6 +22,7 @@ endif

subdir('src')
lsvd_ar = static_library('lsvd', lsvd_src, dependencies: lsvd_deps)
shared_library('lsvd', lsvd_src, dependencies: lsvd_deps)

executable(
'lsvd',
Expand Down
16 changes: 13 additions & 3 deletions src/spdk_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "spdk/nvmf_spec.h"
#include "utils.h"

enum class frontend { NVMF, ISCSI };

const char *NVME_SS_NQN = "nqn.2019-05.io.lsvd:cnode1";
const char *HOSTNAME = "127.0.0.1";
const char *PORT = "4420";
Expand All @@ -21,8 +23,8 @@ spdk_nvme_transport_id get_trid(const char *host, const char *port)
// They're fixed-size char[] bufs in the struct, so make sure we have space
assert(strlen(host) < sizeof(trid.traddr));
assert(strlen(port) < sizeof(trid.trsvcid));
std::copy(host, host + strlen(host), trid.traddr);
std::copy(port, port + strlen(port), trid.trsvcid);
std::copy(host, host + strlen(host) + 1, trid.traddr);
std::copy(port, port + strlen(port) + 1, trid.trsvcid);
trid.trtype = SPDK_NVME_TRANSPORT_TCP;
trid.adrfam = SPDK_NVMF_ADRFAM_IPV4;
// This is required because spdk looks at trstring, not the trtype
Expand All @@ -47,6 +49,7 @@ void invoke_and_free_cb(void *ctx, int status)
struct start_lsvd_args {
const char *pool_name;
const char *image_name;
frontend fe;
};

spdk_nvmf_tgt *create_target()
Expand Down Expand Up @@ -219,16 +222,23 @@ int main(int argc, const char **argv)
});

if (argc < 3) {
log_error("Usage: {} <pool> <image>", argv[0]);
log_error("Usage: {} <pool> <image> [nvmf|iscsi]", argv[0]);
return 1;
}


auto args = (start_lsvd_args){
.pool_name = argv[1],
.image_name = argv[2],
.fe = frontend::NVMF,
};

if (argc == 4 && std::string(argv[3]) == "iscsi")
args.fe = frontend::ISCSI;

debug("Args: pool={}, image={}", args.pool_name, args.image_name);


spdk_app_opts opts = {.shutdown_cb = []() {
log_info("Shutting down LSVD SPDK program ...");
spdk_app_stop(0);
Expand Down

0 comments on commit 29e48dc

Please sign in to comment.