Skip to content

Commit 0a0bfc9

Browse files
Martin Belangerigaw
authored andcommitted
Python: Add hostnqn_from_file() and hostid_from_file()
Signed-off-by: Martin Belanger <[email protected]>
1 parent 0d30777 commit 0a0bfc9

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

libnvme/nvme.i

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,21 @@
4040
PyDict_SetItemString(p, key, val); /* Does NOT steal reference to val .. */
4141
Py_XDECREF(val); /* .. therefore decrement ref. count. */
4242
}
43+
PyObject *hostnqn_from_file() {
44+
char * val = nvmf_hostnqn_from_file();
45+
PyObject * obj = PyUnicode_FromString(val);
46+
free(val);
47+
return obj;
48+
}
49+
PyObject *hostid_from_file() {
50+
char * val = nvmf_hostid_from_file();
51+
PyObject * obj = PyUnicode_FromString(val);
52+
free(val);
53+
return obj;
54+
}
4355
%}
56+
PyObject *hostnqn_from_file();
57+
PyObject *hostid_from_file();
4458

4559
%inline %{
4660
struct host_iter {

0 commit comments

Comments
 (0)