Skip to content

Commit fbf64ca

Browse files
MaisenbacherDigaw
authored andcommitted
python: adjust README to use global_ctx
As we have renamed nvme_root to nvme_global_ctx, the Python bindings example needs to be adjusted to reflect the refactoring. Signed-off-by: Dennis Maisenbacher <[email protected]>
1 parent baac23b commit fbf64ca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libnvme/libnvme/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ def disc_supp_str(dlp_supp_opts):
1818
}
1919
return [txt for msk, txt in bitmap.items() if dlp_supp_opts & msk]
2020

21-
root = nvme.root() # This is a singleton
22-
root.log_level('debug') # Optional: extra debug info
21+
ctx = nvme.global_ctx() # This is a singleton
22+
ctx.log_level('debug') # Optional: extra debug info
2323

24-
host = nvme.host(root) # This "may be" a singleton.
24+
host = nvme.host(ctx) # This "may be" a singleton.
2525
subsysnqn = [string] # e.g. nvme.NVME_DISC_SUBSYS_NAME, ...
2626
transport = [string] # One of: 'tcp', 'rdma', 'fc', 'loop'.
2727
traddr = [IPv4 or IPv6] # e.g. '192.168.10.10', 'fd2e:853b:3cad:e135:506a:65ee:29f2:1b18', ...
2828
trsvcid = [string] # e.g. '8009', '4420', ...
2929
host_iface = [interface] # e.g. 'eth1', ens256', ...
30-
ctrl = nvme.ctrl(root, subsysnqn=subsysnqn, transport=transport, traddr=traddr, trsvcid=trsvcid, host_iface=host_iface)
30+
ctrl = nvme.ctrl(ctx, subsysnqn=subsysnqn, transport=transport, traddr=traddr, trsvcid=trsvcid, host_iface=host_iface)
3131

3232
try:
3333
cfg = {
@@ -61,6 +61,6 @@ except Exception as e:
6161

6262
ctrl = None
6363
host = None
64-
root = None
64+
ctx = None
6565
```
6666

0 commit comments

Comments
 (0)