libnvme(9)

๐Ÿ“ฆ version 3.2, in arch rolling

๐Ÿ’… libnvme(9) โ€” struct nvme_self_test_log

okay so listen, bestie. this is straight out of the API Manual for libnvme, and it's the manual page for the Device Self-test log โ€” that's Log Identifier 06h โ€” and it is, lowkey, one of the most main-character log pages a controller can hand you. no cap. let's get into it โœจ


๐ŸŒธ NAME ๐ŸŒธ

struct nvme_self_test_log โ€” the Device Self-test log, a.k.a. Log Identifier 06h. it's giving "your drive is checking itself before it wrecks itself" energy ๐Ÿซถ


๐ŸŽ€ 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, one iconic little struct, and a whole array of results living its best life at the end ๐Ÿ’–


โœจ Members โœจ

๐Ÿ’ซ current_operation

Current Device Self-Test Operation โ€” this is the vibe check of the whole log, fr fr. it tells you the status of the current device self-test operation.

okay so here's the rule and it's a real one, not a suggestion: 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.

and yes bestie, that applies even when the test finishes or gets aborted ๐Ÿ˜ญ โ€” the controller has to create a Self-test Result Data Structure prior to setting this field to #NVME_ST_CURR_OP_NOT_RUNNING. no skipping steps. the controller does not get to ghost the result struct. periodt.

go peek at enum nvme_st_curr_op for the actual values ๐Ÿ‘‘

๐Ÿ“Š completion

Current Device Self-Test Completion โ€” the progress bar of the situation, literally. it indicates the percentage of the device self-test operation that's complete.

the example they give is kind of perfect: a value of 25 indicates that 25% of the device self-test operation is complete and 75% remains to be tested. math ate, honestly ๐Ÿงฎโœจ

๐Ÿšจ but wait โ€” if the current_operation field is cleared to #NVME_ST_CURR_OP_NOT_RUNNING (which means there's no device self-test operation in progress), then this field is just ignored. it's giving "nobody's home, don't knock." ๐Ÿ™ˆ

๐Ÿซง rsvd

Reserved. that's it. that's the whole member. nothing to see here, she's reserved, she's mysterious, we respect her privacy ๐Ÿ’…

๐Ÿฆ‹ result

Self-test Result Data Structures โ€” the receipts, bestie. the actual results live here. for the full tea, go see struct nvme_st_result. ๐Ÿ‘‘


โญ quick recap because i love you ๐ŸŒˆ

  • the struct is struct nvme_self_test_log and it's Log Identifier 06h ๐Ÿ’œ
  • current_operation = status of the current self-test, and it can't go to #NVME_ST_CURR_OP_NOT_RUNNING without a fresh Self-test Result Data Structure first โ€” not on my watch ๐ŸŽ€
  • completion = the percentage done (value 25 = 25% done, 75% to go), and it's ignored when current_operation is #NVME_ST_CURR_OP_NOT_RUNNING
  • rsvd = reserved ๐Ÿซถ
  • result = the Self-test Result Data Structures, see struct nvme_st_result ๐ŸŒธ
  • related enum: enum nvme_st_curr_op

๐Ÿ’€ important reminder: these are the fields and the rules as the page lays them out โ€” don't invent extra behaviour, don't assume a new field, don't guess. iykyk.

and that's the whole page, bestie ๐Ÿฅน this was the API Manual page for struct nvme_self_test_log, dated October 2026, and if you ever need to cite it, it's libnvme(9) โ€” struct nvme_self_test_log. now go read struct nvme_st_result, slay, and hydrate ๐Ÿ’–๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from