Commit 1dfe1c0
Martin Belanger
swig: fix bugs introduced in libnvmf_context refactor
Three bugs were introduced when libnvmf_context replaced the old
libnvme_fabrics_config parameter in the connect/create flow:
1. The %pythonappend GC guard for connect() had a stale signature that
still included the removed fctx parameter. SWIG silently ignores a
mismatched %pythonappend, so self.__host = h never ran, leaving a
latent use-after-free where Python could collect the host object
while the ctrl was still alive.
2. The duplicate_connect check in connect() had an inverted condition
(missing !) and belonged in the library, not the binding. Move it
to libnvmf_add_ctrl() in fabrics.c where it applies uniformly to
all callers, C and Python alike.
3. fctx_set_fabrics_config was missing its %rename directive, exposing
it to Python as fctx.fctx_set_fabrics_config() instead of
fctx.set_fabrics_config() like all other libnvmf_context methods.
Signed-off-by: Martin Belanger <[email protected]>
Assisted-by: Claude Sonnet 4.6 <[email protected]>1 parent af40e0b commit 1dfe1c0
2 files changed
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| 456 | + | |
456 | 457 | | |
457 | 458 | | |
458 | 459 | | |
| |||
735 | 736 | | |
736 | 737 | | |
737 | 738 | | |
738 | | - | |
739 | | - | |
| 739 | + | |
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | 769 | | |
777 | 770 | | |
778 | 771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1105 | 1109 | | |
1106 | 1110 | | |
1107 | 1111 | | |
| |||
0 commit comments