s390/vfio-ap: add status attribute to AP queue device's sysfs dir
authorTony Krowiak <akrowiak@linux.ibm.com>
Wed, 27 Oct 2021 15:20:14 +0000 (11:20 -0400)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 6 Dec 2021 13:42:26 +0000 (14:42 +0100)
commitf139862b92cf85bd25cbe7c8683d63c037e6562c
tree3641ed8f70efb0962922b24f091084e12209bc01
parent402ff5a3387dc8ec6987a80d3ce26b0c25773622
s390/vfio-ap: add status attribute to AP queue device's sysfs dir

This patch adds a sysfs 'status' attribute to a queue device when it is
bound to the vfio_ap device driver. The field displays a string indicating
the status of the queue device:

Status String:  Indicates:
-------------   ---------
"assigned"      the queue is assigned to an mdev, but is not in use by a
                KVM guest.
"in use"        the queue is assigned to an mdev and is in use by a KVM
                guest.
"unassigned"    the queue is not assigned to an mdev.

The status string will be displayed by the 'lszcrypt' command if the queue
device is bound to the vfio_ap device driver.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
[akrowiak@linux.ibm.com: added check for queue in use by guest]
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/crypto/vfio_ap_drv.c