Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ subprojects/*
cscope.*
compile_commands.json

tests/__pycache__
__pycache__/
tests/nvmetests
tests/*.pyc

Expand Down
26 changes: 26 additions & 0 deletions libnvme/libnvme/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,32 @@ if want_python
test_env.set('PYTHONMALLOC', 'malloc')

# Test section
_priv_hdr_args = [
'--private-header',
meson.current_source_dir() / '..' / 'src' / 'nvme' / 'private.h',
'--private-header',
meson.current_source_dir() / '..' / 'src' / 'nvme' / 'private-fabrics.h',
]
_swig_pub_hdr_args = []
foreach hdr : headers
_swig_pub_hdr_args += [
'--public-header',
meson.current_source_dir() / '..' / 'src' / hdr,
]
endforeach
test(
'libnvme - check-nvme-i-consistency',
python3,
args: [
files('../tools/check-nvme-i-consistency.py'),
] + _priv_hdr_args + _swig_pub_hdr_args + [
'--swig-interface',
meson.current_source_dir() / 'nvme.i',
'--swig-accessors',
meson.current_source_dir() / 'nvme-swig-accessors.i',
],
)

test('libnvme - python-import-libnvme', python3, args: ['-c', 'from libnvme import nvme'], env: test_env, depends: pynvme_clib)

py_tests = [
Expand Down
27 changes: 14 additions & 13 deletions libnvme/libnvme/nvme.i
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,10 @@ struct libnvme_host {
%immutable hostnqn;
%immutable hostid;
%immutable hostsymname;
char *hostnqn;
char *hostid;
char *hostsymname;
%extend {
char *hostnqn;
char *hostid;
char *hostsymname;
char *dhchap_host_key;
}
};
Expand All @@ -598,13 +598,13 @@ struct libnvme_subsystem {
%immutable firmware;
%immutable subsystype;
%immutable iopolicy;
char *subsysnqn;
char *model;
char *serial;
char *firmware;
char *subsystype;

%extend {
char *subsysnqn;
char *model;
char *serial;
char *firmware;
char *subsystype;
const char *sysfs_dir;
const char *application;
const char *iopolicy;
Expand Down Expand Up @@ -633,10 +633,6 @@ struct libnvme_ctrl {
%immutable phy_slot;
%immutable discovered;

const char *cntrltype; // Do not put in %extend because there's no getter method in libnvme.map
const char *dctype; // Do not put in %extend because there's no getter method in libnvme.map
const bool discovered; // Do not put in %extend because there's no getter method in libnvme.map

%extend {
/**
* By putting these attributes in an %extend block, we're
Expand Down Expand Up @@ -665,10 +661,13 @@ struct libnvme_ctrl {
const char *trsvcid;
const char *cntlid;
const char *phy_slot;
const char *cntrltype;
const char *dctype;

bool unique_discovery_ctrl;
bool discovery_ctrl;
bool persistent;
bool discovered;

char *keyring;
char *tls_key_identity;
Expand All @@ -695,7 +694,9 @@ struct libnvme_ns {
%immutable eui64;
%immutable nguid;
%immutable uuid;
unsigned int nsid;
%extend {
unsigned int nsid;
}
uint8_t eui64[8];
uint8_t nguid[16];
uint8_t uuid[16];
Expand Down
Loading
Loading