libnvme(2)

πŸ’– libnvme(2) β€” API Manual, bestie edition πŸ’–

okay so this is a page from the libnvme API manual, and today's main character is a lil struct called nvme_self_test_log. it's literally the Device Self-test log (Log Identifier 06h) β€” the receipts your drive keeps about the self-tests it's been running. no cap.


✨ NAME ✨

struct nvme_self_test_log β€” Device Self-test (Log Identifier 06h)

like… that's it. that's the name. iconic.


🌸 SYNOPSIS 🌸

struct nvme_self_test_log {
    __u8 current_operation;
    __u8 completion;
    __u8 rsvd[2];
    struct nvme_st_result   result[NVME_LOG_ST_MAX_RESULTS];
 };

look at her. four fields and a whole lot of lore. πŸ’…


πŸŽ€ Members πŸŽ€

  • current_operation β€” Current Device Self-Test Operation: tells you the status of the self-test that's happening right now. and bestie, there's a rule here: if a device self-test operation is in process (meaning this field is set to #NVME_ST_CURR_OP_SHORT or #NVME_ST_CURR_OP_EXTENDED), then the controller shall not set this field to #NVME_ST_CURR_OP_NOT_RUNNING until a new Self-test Result Data Structure is created. fr fr β€” that means if a device self-test operation completes or gets aborted, the controller has to create a Self-test Result Data Structure before it sets this field to #NVME_ST_CURR_OP_NOT_RUNNING. see enum nvme_st_curr_op. πŸ‘‘
  • completion β€” Current Device Self-Test Completion: the percentage of the device self-test operation that's done. like, a value of 25 means 25% of the device self-test operation is complete and a whole 75% is still waiting to be tested. 😭 and lowkey important: if the current_operation field is cleared to #NVME_ST_CURR_OP_NOT_RUNNING (which means there is no device self-test operation in progress), then this field is straight up ignored. she said don't perceive me.
  • rsvd β€” Reserved. it's giving "do not touch, not for you". πŸ™ˆ
  • result β€” Self-test Result Data Structures, see struct nvme_st_result. the actual tea. πŸ“

vibe check: the result array is sized NVME_LOG_ST_MAX_RESULTS, and the struct it holds is struct nvme_st_result β€” don't go renaming those, they're load-bearing. πŸ’€

and that's the whole page, babes. this was libnvme(2), the struct nvme_self_test_log page, dated July 2026. mwah. go forth and read your drive's self-test receipts. 🫢✨

πŸ“¦ where this page comes from