@@ -2376,8 +2376,9 @@ static int nvmf_create_discovery_ctrl(struct nvme_global_ctx *ctx,
23762376 /* Find out the name of discovery controller */
23772377 ret = nvme_ctrl_identify (c , id );
23782378 if (ret ) {
2379- fprintf (stderr , "failed to identify controller, error %s\n" ,
2380- nvme_strerror (- ret ));
2379+ nvme_msg (ctx , LOG_ERR ,
2380+ "failed to identify controller, error %s\n" ,
2381+ nvme_strerror (- ret ));
23812382 nvme_disconnect_ctrl (c );
23822383 nvme_free_ctrl (c );
23832384 return ret ;
@@ -2431,16 +2432,16 @@ int _discovery_config_json(struct nvme_global_ctx *ctx,
24312432 /* ignore if no host_traddr for fc */
24322433 if (!strcmp (transport , "fc" )) {
24332434 if (!host_traddr ) {
2434- fprintf ( stderr , "host_traddr required for fc\n" );
2435+ nvme_msg ( ctx , LOG_ERR , "host_traddr required for fc\n" );
24352436 return 0 ;
24362437 }
24372438 }
24382439
24392440 /* ignore if host_iface set for any transport other than tcp */
24402441 if (!strcmp (transport , "rdma" ) || !strcmp (transport , "fc" )) {
24412442 if (host_iface ) {
2442- fprintf ( stderr ,
2443- "host_iface not permitted for rdma or fc\n" );
2443+ nvme_msg ( ctx , LOG_ERR ,
2444+ "host_iface not permitted for rdma or fc\n" );
24442445 return 0 ;
24452446 }
24462447 }
@@ -2580,11 +2581,11 @@ int nvmf_connect_config_json(struct nvme_global_ctx *ctx,
25802581 if (err == - ENVME_CONNECT_ALREADY )
25812582 continue ;
25822583
2583- fprintf ( stderr ,
2584- "failed to connect to hostnqn=%s,nqn=%s,%s\n" ,
2585- nvme_host_get_hostnqn (h ),
2586- nvme_subsystem_get_name (s ),
2587- nvme_ctrl_get_address (c ));
2584+ nvme_msg ( ctx , LOG_ERR ,
2585+ "failed to connect to hostnqn=%s,nqn=%s,%s\n" ,
2586+ nvme_host_get_hostnqn (h ),
2587+ nvme_subsystem_get_name (s ),
2588+ nvme_ctrl_get_address (c ));
25882589
25892590 if (!ret )
25902591 ret = err ;
@@ -3233,8 +3234,9 @@ static int nvmf_create_discover_ctrl(struct nvme_global_ctx *ctx,
32333234 /* Find out the name of discovery controller */
32343235 ret = nvme_ctrl_identify (c , id );
32353236 if (ret ) {
3236- fprintf (stderr , "failed to identify controller, error %s\n" ,
3237- nvme_strerror (- ret ));
3237+ nvme_msg (ctx , LOG_ERR ,
3238+ "failed to identify controller, error %s\n" ,
3239+ nvme_strerror (- ret ));
32383240 nvme_disconnect_ctrl (c );
32393241 nvme_free_ctrl (c );
32403242 return ret ;
0 commit comments