Commit e9cd107
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 70be264 commit e9cd107
2 files changed
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
| |||
725 | 726 | | |
726 | 727 | | |
727 | 728 | | |
728 | | - | |
729 | | - | |
| 729 | + | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | 759 | | |
767 | 760 | | |
768 | 761 | | |
| |||
| 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