lsm_target_port_list(3)

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

πŸ’– lsm_target_port_list πŸ’–

okay bestie, welcome to the Libstoragemgmt C API Manual ✨ this one's about lsm_target_port_list(3) and it's genuinely so good, we're just gonna get into it 🫢


✨ NAME ✨

lsm_target_port_list β€” gets a list of target ports on this connection. that's it, that's the job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

int lsm_target_port_list (lsm_connect *conn, const char *search_key,
const char *search_value, lsm_target_port **target_ports[], uint32_t
*count, lsm_flag flags);

like. look at her. six arguments, zero notes. icon behavior πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • conn β€” a valid connection. no connection, no vibes, no list. sorry bestie 😭
  • search_key β€” the search key, or NULL if you want literally everything. the valid search keys are: "id" and "system_id". that's the whole menu, don't go inventing new ones πŸ™ˆ
  • search_value β€” the search value. the thing you're searching for. matching the key. yeah πŸ’–
  • target_ports[] β€” output pointer to an lsm_target_port array. important: the return value must be freed with a call to lsm_target_port_record_array_free. not optional. free your memory, bestie, it's self care 🧚
  • count β€” output pointer of uint32_t. this is how many target ports you got back. the number. the tally 🌈
  • flags β€” reserved for future use, must be LSM_CLIENT_FLAG_RSVD. put anything else and the vibe check fails πŸ’€

πŸ¦‹ VERSION πŸ¦‹

1.0 ✨ baby's first release and she's already perfect


🌟 DESCRIPTION 🌟

okay so here's the tea: this function gets a list of target ports on this connection. πŸ«–

and what even is a target port, you ask? bestie, a target port is the front-end port of the storage system which the storage user/client connects to and gets storage service from. that's the whole thing. she's the door, you're the guest, she hands you storage. iconic ✨

and once you've got your ports, you can pull all their properties with these functions:

  • lsm_target_port_id_get
  • lsm_target_port_type_get
  • lsm_target_port_system_id_get
  • lsm_target_port_network_address_get
  • lsm_target_port_physical_address_get
  • lsm_target_port_physical_name_get
  • lsm_target_port_service_address_get

seven little getters, all lined up, all serving looks πŸ’…


πŸ’« CAPABILITY πŸ’«

LSM_CAP_TARGET_PORTS

(you need this capability for the function to be supported. check it first, bestie, don't just roll up uninvited πŸŽ€)


πŸ”₯ RETURN πŸ”₯

returns an error code as enumerated by lsm_error_number:

  • LSM_ERR_OK β€” on success, or when the searched value isn't found. either way she's chill, no drama 🌸
  • LSM_ERR_INVALID_ARGUMENT β€” when any argument is NULL, or the flags are invalid, or the search key is invalid. she will not be accepting that energy πŸ™…
  • LSM_ERR_NO_SUPPORT β€” not supported. it's giving "not my department" πŸ’€

reminder bestie: that target_ports[] array does NOT free itself. call lsm_target_port_record_array_free. i'm not gonna say it again. (i will say it again.) 🫢

and that's the whole page!! this was the lsm_target_port_list manual, part of the Libstoragemgmt C API Manual, last updated February 2026, and honestly? she ate. go free your arrays. mwah πŸ’–πŸ’…βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from