nvmf_get_discovery_log(2)

πŸ’– nvmf_get_discovery_log β€” bestie edition πŸ’–

okay so this is a page from the libnvme API manual (that's the (2) vibe, iykyk) and it's all about one lil function called nvmf_get_discovery_log. buckle up πŸŽ€


✨ NAME ✨

nvmf_get_discovery_log β€” returns the discovery log page, periodt.


🌸 SYNOPSIS 🌸

int nvmf_get_discovery_log (nvme_ctrl_t c , struct nvmf_discovery_log
**logp , int max_retries );

like… it takes three things and gives you back an int. slay.


πŸ¦‹ ARGUMENTS πŸ¦‹

  • c β€” the discovery controller you're using, bestie. that's your entry point πŸ’…
  • logp β€” a pointer to the log page that's gonna get handed back to you 🌈
  • max_retries β€” how many times you wanna retry if things go sideways 😭

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea: the memory that gets allocated for the log page β€” the stuff that comes back to you in logp β€” must be freed by the caller using free. yep, that's on YOU. no one else is coming to clean that up, so don't ghost it πŸ™ˆ


πŸ’€ NOTE πŸ’€

ngl, consider using nvmf_get_discovery_wargs instead. just saying. the way that this one is lowkey the older option… 🫢


🌟 RETURN 🌟

  • 0 on success β€” we love a win ✨
  • on failure, -1 is returned and errno is set πŸ’€
fr fr, always check that return value. the errno is giving you the actual reason and it's not gonna say it twice.

and that's the whole page, babe πŸ§šπŸ’œ this one came from the libnvme API manual, dated July 2026, and it's filed under nvmf_get_discovery_log in section (2) β€” mwah, go free your memory bestie πŸ’–

πŸ“¦ where this page comes from