lsm_disk_list(3)

πŸ“¦
version 1.10.3 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– lsm_disk_list β€” from the Libstoragemgmt C API Manual, bestie πŸ’–

Okay so hi, welcome, this is lsm_disk_list(3) and she's the moment. She's a C API function and she gets you a whole list of disks on this connection. Iconic behaviour, no notes. Let's get into it πŸ¦‹


✨ SYNOPSIS ✨

int lsm_disk_list (lsm_connect *conn, const char *search_key, const char
*search_value, lsm_disk **disks[], uint32_t *count, lsm_flag flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • conn β€” a valid lsm_connect pointer, bestie. Gotta be valid or we're not doing this.
  • search_key β€” your search key, or NULL if you want everything (yes, all of it, she's generous). The valid search keys are: "id", "system_id".
  • search_value β€” the value you're searching for. Matching key + matching value, that's the vibe.
  • disks[] β€” output pointer to an lsm_disk array. Heads up: you have to free this yourself with lsm_disk_record_array_free. She does not clean up after herself, that's on you πŸ™ˆ
  • count β€” output pointer of uint32_t. It's the number of disks. The math. The tally. The headcount 🫢
  • flags β€” reserved for future use, so it must be LSM_CLIENT_FLAG_RSVD. Don't get creative, okay?

🌸 VERSION 🌸

1.0 β€” she's been here, she's been serving ✨


πŸ’… DESCRIPTION πŸ’…

Gets a list of disks on this connection. That's it, that's the whole gig, and she ate.

Once you've got your disks, the disk properties can be retrieved with these functions β€” collect them all like little PokΓ©mon:

  • lsm_disk_id_get
  • lsm_disk_name_get
  • lsm_disk_system_id_get
  • lsm_disk_type_get
  • lsm_disk_number_of_blocks_get
  • lsm_disk_block_size_get
  • lsm_disk_status_get
  • lsm_disk_location_get
  • lsm_disk_rpm_get
  • lsm_disk_link_type_get
  • lsm_disk_vpd83_get

πŸ‘‘ CAPABILITY πŸ‘‘

LSM_CAP_DISKS

That's the capability check, bestie. She needs it, she has it. Periodt.


πŸ”₯ RETURN πŸ”₯

The return value is an error code as enumerated by lsm_error_number. Let's go through them one by one because we're thorough in this household:

  • LSM_ERR_OK
    • On success, or when the searched value just isn't found. Either way we're chilling 🧘
  • LSM_ERR_INVALID_ARGUMENT
    • When any argument is NULL, or the flags are invalid, or the search key is invalid. Read the rules, babe.
  • LSM_ERR_NO_SUPPORT
    • Not supported. It's giving sorry-not-sorry πŸ’€

Lowkey the main takeaway: valid conn, valid search key, LSM_CLIENT_FLAG_RSVD for flags, and free your array. That's the whole vibe check. iykyk πŸ’œ

And that's the page, bestie! This was lsm_disk_list from the lsm_disk_list(3) manual, February 2026 edition β€” mwah, slay, go forth and list those disks πŸŒˆπŸ’–βœ¨

πŸ“¦ where this page comes from