mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
When a queue is removed from a SE guest which was in a state other than "usable" (for example "unbound") the state displayed by lszcrypt switches to "usable" until the queue device is finally removed by the AP bus scan running every 30s. This intermediate state is caused by reading 0x00000000 on the underlying /sys/devices/cardxx/xx.yyyy/ap_functions. lszcrypt only extracts the BS bits from this value and maps these both bits to string output 0: "usable" 1: "bound" 2: "unbound" 3: "illicit" totally ignoring the fact that there is no AP function at all. Now the code checks for a valid ap_functions value first, before actually extracting and displaying the SE state. In case the ap_functions reads as 0x00000000 lszcrypt now displays the string "invalid". Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Reviewed-by: Holger Dengler <dengler@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>