@@ -2765,25 +2765,26 @@ void nvmf_nbft_free(struct nvme_global_ctx *ctx, struct nbft_file_entry *head)
27652765 }
27662766}
27672767
2768- static bool validate_uri (struct nbft_info_discovery * dd ,
2768+ static bool validate_uri (struct nvme_global_ctx * ctx ,
2769+ struct nbft_info_discovery * dd ,
27692770 struct nvme_fabrics_uri * uri )
27702771{
27712772 if (!uri ) {
2772- fprintf ( stderr ,
2773- "Discovery Descriptor %d: failed to parse URI %s\n" ,
2774- dd -> index , dd -> uri );
2773+ nvme_msg ( ctx , LOG_ERR ,
2774+ "Discovery Descriptor %d: failed to parse URI %s\n" ,
2775+ dd -> index , dd -> uri );
27752776 return false;
27762777 }
27772778 if (strcmp (uri -> scheme , "nvme" ) != 0 ) {
2778- fprintf ( stderr ,
2779- "Discovery Descriptor %d: unsupported scheme '%s'\n" ,
2780- dd -> index , uri -> scheme );
2779+ nvme_msg ( ctx , LOG_ERR ,
2780+ "Discovery Descriptor %d: unsupported scheme '%s'\n" ,
2781+ dd -> index , uri -> scheme );
27812782 return false;
27822783 }
27832784 if (!uri -> protocol || strcmp (uri -> protocol , "tcp" ) != 0 ) {
2784- fprintf ( stderr ,
2785- "Discovery Descriptor %d: unsupported transport '%s'\n" ,
2786- dd -> index , uri -> protocol );
2785+ nvme_msg ( ctx , LOG_ERR ,
2786+ "Discovery Descriptor %d: unsupported transport '%s'\n" ,
2787+ dd -> index , uri -> protocol );
27872788 return false;
27882789 }
27892790
@@ -3110,7 +3111,7 @@ int nvmf_discovery_nbft(struct nvme_global_ctx *ctx,
31103111 ret = nvme_parse_uri ((* dd )-> uri , & uri );
31113112 if (ret )
31123113 continue ;
3113- if (!validate_uri (* dd , uri ))
3114+ if (!validate_uri (ctx , * dd , uri ))
31143115 continue ;
31153116
31163117 host_traddr = NULL ;
0 commit comments