On 10/15/2021 7:38 PM, Alex Williamson wrote:
On Wed, 13 Oct 2021 12:47:01 +0300
Yishai Hadas <yishaih@xxxxxxxxxx> wrote:
Add 'invalid' state definition to be used by drivers to set/check
invalid state.
In addition dropped the non complied macro VFIO_DEVICE_STATE_SET_ERROR
(i.e SATE instead of STATE) which seems unusable.
s/non complied/non-compiled/
We can certainly assume it's unused based on the typo, but removing it
or fixing it should be a separate patch.
OK, will come with a separate patch to fix the typo and leave it for now.
Fixes: a8a24f3f6e38 ("vfio: UAPI for migration interface for device state")
Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxx>
Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
---
include/linux/vfio.h | 5 +++++
include/uapi/linux/vfio.h | 4 +---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index b53a9557884a..6a8cf6637333 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -252,4 +252,9 @@ extern int vfio_virqfd_enable(void *opaque,
void *data, struct virqfd **pvirqfd, int fd);
extern void vfio_virqfd_disable(struct virqfd **pvirqfd);
+static inline bool vfio_is_state_invalid(u32 state)
+{
+ return state >= VFIO_DEVICE_STATE_INVALID;
+}
Redundant, we already have !VFIO_DEVICE_STATE_VALID(state)
OK, may drop this part.
Yishai