Commit 1538a8a4 authored by Sebastien Boeuf's avatar Sebastien Boeuf Committed by Michael S. Tsirkin

vdpa: Add resume operation

Add a new operation to allow a vDPA device to be resumed after it has
been suspended. Trying to resume a device that wasn't suspended will
result in a no-op.

This operation is optional. If it's not implemented, the associated
backend feature bit will not be exposed. And if the feature bit is not
exposed, invoking this operation will return an error.
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarSebastien Boeuf <sebastien.boeuf@intel.com>
Message-Id: <6e05c4b31b47f3e29cb2bd7ebd56c81f84b8f48a.1672742878.git.sebastien.boeuf@intel.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
parent 51a8f9d7
...@@ -219,7 +219,10 @@ struct vdpa_map_file { ...@@ -219,7 +219,10 @@ struct vdpa_map_file {
* @reset: Reset device * @reset: Reset device
* @vdev: vdpa device * @vdev: vdpa device
* Returns integer: success (0) or error (< 0) * Returns integer: success (0) or error (< 0)
* @suspend: Suspend or resume the device (optional) * @suspend: Suspend the device (optional)
* @vdev: vdpa device
* Returns integer: success (0) or error (< 0)
* @resume: Resume the device (optional)
* @vdev: vdpa device * @vdev: vdpa device
* Returns integer: success (0) or error (< 0) * Returns integer: success (0) or error (< 0)
* @get_config_size: Get the size of the configuration space includes * @get_config_size: Get the size of the configuration space includes
...@@ -324,6 +327,7 @@ struct vdpa_config_ops { ...@@ -324,6 +327,7 @@ struct vdpa_config_ops {
void (*set_status)(struct vdpa_device *vdev, u8 status); void (*set_status)(struct vdpa_device *vdev, u8 status);
int (*reset)(struct vdpa_device *vdev); int (*reset)(struct vdpa_device *vdev);
int (*suspend)(struct vdpa_device *vdev); int (*suspend)(struct vdpa_device *vdev);
int (*resume)(struct vdpa_device *vdev);
size_t (*get_config_size)(struct vdpa_device *vdev); size_t (*get_config_size)(struct vdpa_device *vdev);
void (*get_config)(struct vdpa_device *vdev, unsigned int offset, void (*get_config)(struct vdpa_device *vdev, unsigned int offset,
void *buf, unsigned int len); void *buf, unsigned int len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment