nvme_set_root(2)

πŸ’– nvme_set_root β€” the libnvme API manual (section 2, bestie) πŸ’–

okay so welcome to the nvme_set_root(2) page from the libnvme API manual, and yes we ARE doing this, sit down, hydrate 🫢


✨ NAME ✨

nvme_set_root β€” set that nvme_root_t context, periodt πŸ’…


🌸 SYNOPSIS 🌸

void nvme_set_root (nvme_root_t r );

πŸŽ€ ARGUMENTS πŸŽ€

  • r β€” the nvme_root_t context. that's it, that's the whole arg, she's simple and she knows it πŸ¦‹

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea β˜• sometimes you're deep in some code path and nobody handed you a root object as an argument, and you still gotta log. like, you NEED to log. and you can't, because no root object. tragic. devastating, even 😭

that's what this call is for!! it lets you set a default root object, so those root-less code paths can grab it and log anyway. main character energy fr fr ✨

and get this β€” when you create a brand new root object with nvme_create_root, the global root object gets set too. so the global root object is always pointing to the latest created root object πŸ‘‘ it's giving "newest one wins."

⚠️ heads up bestie, the first nvme_free_tree call will reset the global root object. so don't be out here assuming it's still there after that, because it is NOT πŸ’€
🚨 ALSO, and I need you to hear me on this one: this function is deprecated. don't start anything new with it, okay? use nvme_init_default_logging or/and nvme_init_logging instead. the way that those two are the moment and this one is so 2024 πŸ™ˆ

and that's the whole page!! tysm for reading, you ate, no cap πŸ’œ

β€” from the libnvme API manual, this nvme_set_root page, dated July 2026, signed off with a lil sparkle ⭐ mwah πŸ’‹

πŸ“¦ where this page comes from