mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-25 00:26:43 +00:00
The scst_user specification copies ioctl structures and command payloads that predate several ABI extensions. Building a handler from those layouts can select the wrong union member, alignment or completion path. Commit3fc775c75a("EXTENDED COPY support") added remapping payloads. Commitdaee4dcb7e("WRITE SAME command improvements") added WRITE SAME descriptors. Commitd1bd22afd9("scst_user: avoid global locks") left the explicit unregister ioctl as an obsolete no-op. Use scst/include/scst_user.h and scst_user.c as the producer-side source of truth. Synchronize registration, command, reply and subcommand layouts, version checks, reserved fields and ioctl rules. Update the fileio_tgt, stpgd and event guides from current code. Make live-storage and event-consumption risks explicit.
SCST events example =================== events is a test and demonstration consumer for the SCST event ABI. The authoritative ioctl definitions, wildcard rules, event codes, and payload layouts are in scst/include/scst_event.h and scst/src/scst_event.c. The example's current behavior is implemented in usr/events/events.c. Build ----- The example is intentionally omitted from the default "make usr" build and install targets. Build it explicitly with "make -C usr/events". Installing or running it is not required for normal SCST operation. Usage ----- events opens /dev/scst_event, registers one or more filters, and prints the events it receives. events [OPTIONS] - -e, --allowed_event=CODE: allow CODE; zero matches any event code - -i, --allowed_issuer=ISSUER: allow ISSUER; "*" matches any issuer - -n, --non_blocking: use nonblocking event retrieval - -v, --version: print the program version - -h, --help: print usage information The -d/--debug option is present only when tracing or debugging is compiled in. Repeat an event-code/issuer pair to add filters, up to the implementation limit. With no filter options, the program subscribes to every event code from every issuer. Safety ------ Do not run this example on a live target or alongside a production event consumer such as stpgd. Its default wildcard subscription can receive an event that requires SCST_EVENT_NOTIFY_DONE, while the example only sends a completion for its synthetic event code 0x12345. A real completion-bearing event can therefore be diverted from its intended consumer and remain pending until the kernel timeout.