dmmp_...y_get(3)

πŸ“¦
version 0.15.1 Β· 3 versions
, in arch rolling, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– dmmp_mpath_array_get πŸ’–

okay bestie, so this one lives in the Device Mapper Multipath API - libdmmp Manual, and it's genuinely one of the most useful little functions in the whole libdmmp lineup. it's giving "show me every multipath device that exists right now" and honestly? iconic.


✨ NAME ✨

dmmp_mpath_array_get β€” query all existing multipath devices. all of them. every single one. no crumbs left behind. πŸ¦‹


✨ SYNOPSIS ✨

int dmmp_mpath_array_get (struct dmmp_context *ctx, struct dmmp_mpath
***dmmp_mps, uint32_t *dmmp_mp_count);

look at her. three arguments. not one, not two. three. and every one of them matters, so don't get cute and skip any πŸ’…


✨ ARGUMENTS ✨

  • ctx β€” pointer of struct dmmp_context. this is your context bestie, the main character. if this pointer is NULL, your program will be terminated by assert. like, straight up. no warning text, no graceful exit, just gone. so pls do not pass NULL πŸ™ˆ
  • dmmp_mps β€” output pointer array of struct dmmp_mpath. this is where the results land. if this pointer is NULL, your program will be terminated by assert. same deal. do not test her.
  • dmmp_mp_count β€” output pointer of uint32_t. it holds the size of the dmmp_mps pointer array, aka "how many multipath devices did we just find". if this pointer is NULL, your program will be terminated by assert. yes, all three of them assert. it's a whole thing. 🫢

✨ DESCRIPTION ✨

so what does she actually do? she queries all existing multipath devices and stores them into a pointer array. that's the whole vibe. every multipath device that exists, swept up into dmmp_mps like the universe collecting its faves. 🌈

⚠️ real talk though: the memory of dmmp_mps should be freed via dmmp_mpath_array_free. do NOT forget this. do not leave her hanging. free your memory, bestie, that's the rule. πŸ’€

✨ RETURN ✨

returns an int. the valid error codes are:

  • DMMP_OK
  • DMMP_ERR_BUG
  • DMMP_ERR_NO_MEMORY
  • DMMP_ERR_NO_DAEMON
  • DMMP_ERR_INCONSISTENT_DATA

and if you get one of these numbers back and you're like "what does that even mean 😭" β€” the error number could be converted to string by dmmp_strerror. she translates. she's helpful like that. ⭐


and that's the whole page, bestie! this one's from the <strong>libdmmp</strong> manual, page <code>dmmp_...y_get(3)</code>, all about <code>dmmp_mpath_array_get</code>, dated <strong>June 2025</strong>. go forth, query your multipath devices, and free that array. periodt. πŸ‘‘βœ¨πŸ’œ