@@ -138,7 +138,8 @@ static struct nvme_global_ctx *create_tree()
138138 for (int i = 0 ; i < ARRAY_SIZE (test_data ); i ++ ) {
139139 struct test_data * d = & test_data [i ];
140140
141- d -> s = nvme_lookup_subsystem (h , d -> subsysname , d -> subsysnqn );
141+ assert (!nvme_subsystem_get (ctx , h , d -> subsysname ,
142+ d -> subsysnqn , & d -> s ));
142143 assert (d -> s );
143144 d -> c = nvme_lookup_ctrl (d -> s , d -> transport , d -> traddr ,
144145 d -> host_traddr , d -> host_iface ,
@@ -235,7 +236,7 @@ static bool ctrl_lookups(struct nvme_global_ctx *ctx)
235236 bool pass = true;
236237
237238 h = nvme_first_host (ctx );
238- s = nvme_lookup_subsystem ( h , DEFAULT_SUBSYSNAME , DEFAULT_SUBSYSNQN );
239+ nvme_subsystem_get ( ctx , h , DEFAULT_SUBSYSNAME , DEFAULT_SUBSYSNQN , & s );
239240
240241 printf (" lookup controller:\n" );
241242 for (int i = 0 ; i < ARRAY_SIZE (test_data ); i ++ ) {
@@ -290,7 +291,7 @@ static bool test_src_addr()
290291 nvme_host_get (ctx , DEFAULT_HOSTNQN , DEFAULT_HOSTID , & h );
291292 assert (h );
292293
293- s = nvme_lookup_subsystem ( h , DEFAULT_SUBSYSNAME , DEFAULT_SUBSYSNQN );
294+ nvme_subsystem_get ( ctx , h , DEFAULT_SUBSYSNAME , DEFAULT_SUBSYSNQN , & s );
294295 assert (s );
295296
296297 c = nvme_lookup_ctrl (s , "tcp" , "192.168.56.1" , NULL , NULL , "8009" , NULL );
@@ -466,7 +467,10 @@ static bool ctrl_match(const char *tag,
466467 nvme_host_get (ctx , DEFAULT_HOSTNQN , DEFAULT_HOSTID , & h );
467468 assert (h );
468469
469- s = nvme_lookup_subsystem (h , DEFAULT_SUBSYSNAME , reference -> subsysnqn ? reference -> subsysnqn : DEFAULT_SUBSYSNQN );
470+ assert (!nvme_subsystem_get (ctx , h , DEFAULT_SUBSYSNAME ,
471+ reference -> subsysnqn ?
472+ reference -> subsysnqn : DEFAULT_SUBSYSNQN ,
473+ & s ));
470474 assert (s );
471475
472476 reference_ctrl = nvme_lookup_ctrl (s , reference -> transport , reference -> traddr ,
@@ -1079,7 +1083,10 @@ static bool ctrl_config_match(const char *tag,
10791083 nvme_host_get (ctx , DEFAULT_HOSTNQN , DEFAULT_HOSTID , & h );
10801084 assert (h );
10811085
1082- s = nvme_lookup_subsystem (h , DEFAULT_SUBSYSNAME , reference -> subsysnqn ? reference -> subsysnqn : DEFAULT_SUBSYSNQN );
1086+ assert (!nvme_subsystem_get (ctx , h , DEFAULT_SUBSYSNAME ,
1087+ reference -> subsysnqn ?
1088+ reference -> subsysnqn : DEFAULT_SUBSYSNQN ,
1089+ & s ));
10831090 assert (s );
10841091
10851092 reference_ctrl = nvme_lookup_ctrl (s , reference -> transport , reference -> traddr ,
0 commit comments