vdpa: Track device suspended state
authorDragos Tatulea <dtatulea@nvidia.com>
Mon, 25 Dec 2023 13:42:09 +0000 (15:42 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 10 Jan 2024 18:01:37 +0000 (13:01 -0500)
commitc7e194402be3ed385dfaefaf1681bb731fd776e2
treef55464933cc00857e9d3b4e6fb5ad7e147bf14a3
parent95e7249691f082a5178d4d6f60fcdee91da458ab
vdpa: Track device suspended state

Set vdpa device suspended state on successful suspend. Clear it on
successful resume and reset.

The state will be locked by the vhost_vdpa mutex. The mutex is taken
during suspend, resume and reset in vhost_vdpa_unlocked_ioctl. The
exception is vhost_vdpa_open which does a device reset but that should
be safe because it can only happen before the other ops.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Suggested-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20231225134210.151540-2-dtatulea@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vdpa.c