lsm_battery_list(3)
π lsm_battery_list(3) β the Libstoragemgmt C API Manual, bestie edition β¨
okay so bestie, pull up a chair, we're getting a list of batteries π and honestly? iconic behaviour. this is lsm_battery_list from the Libstoragemgmt C API, and yes she's a whole queen. no cap.
πΈ NAME πΈ
lsm_battery_list β gets a list of batteries on this connection. that's it, that's the job, and she does it flawlessly π
β¨ SYNOPSIS β¨
int lsm_battery_list (lsm_connect *conn, const char *search_key, const
char *search_value, lsm_battery **bs[], uint32_t *count, lsm_flag
flags);
look at her. six arguments. main character energy fr fr π«Ά
π ARGUMENTS π
connβ a validlsm_connectpointer. like, an actually valid one. she's not doing charity work for a NULL, sorry babe πsearch_keyβ the search key. passNULLif you want everything (yes, everything, we love a generous moment π). the valid search keys are:"id"and"system_id". those two, periodt.search_valueβ the search value. the matching half of the search key situation, iykyk.bs[]β output pointer of anlsm_batteryarray. and listen, listen: the returned value must be freed by callinglsm_battery_record_array_free. no leaking, bestie, that's not the vibe π«πcountβ output pointer ofuint32_t. number of batteries. she'll tell you how many she found πflagsβ reserved for future use, so you must passLSM_CLIENT_FLAG_RSVD. not a suggestion, that's the rule π
π VERSION π
1.3.
π¦ DESCRIPTION π¦
Gets a list of batteries on this connection. and here's the fun part β when present, super capacitors will also be included. surprise! extra credit! we love a bonus β‘π
you can grab all the battery properties using these little cuties:
lsm_battery_id_getlsm_battery_name_getlsm_battery_system_id_getlsm_battery_type_getlsm_battery_status_get
five functions, all obsessed with getting you the details. go off, besties π
π CAPABILITY π
LSM_CAP_BATTERIES
that's the one you need. check it, love it, respect it π
π RETURN π
Error code as enumerated by lsm_error_number. here's the rundown:
LSM_ERR_OKβ on success or when the searched value isn't found. yes, "not found" still counts as OK around here, she's chill like that πLSM_ERR_INVALID_ARGUMENTβ when any argument isNULL, or the flags are invalid, or the search key is invalid. basically if you're being messy, she's gonna tell you πLSM_ERR_NO_SUPPORTβ not supported. she simply cannot, will not, and is not about to π
fr fr reminder: free that array with lsm_battery_record_array_free. your future self will thank you π«Άβ¨
okay that's the whole page, you ate, go be a main character with your battery list πΈπ π
later bestie, mwah π β this was lsm_battery_list(3) from the Libstoragemgmt C API Manual, source version 1.3., dated February 2026 βππ¦
π¦ where this page comes from
- fedora 43: libstoragemgmt-devel 1.10.3-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: libstoragemgmt-devel 1.10.3-1.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms