Commit 4c3d3bae authored by jiangdongxu's avatar jiangdongxu
Browse files

vdpa: add vdpa device migration status ops

virt inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I86ITO



----------------------------------------------------------------------

Introduce a new interface to set vdpa device migration status, Such as
migration start/stop, pre_start/pre_stop, etc.

Some vdpa device need to do some job in different state. As not all vdpa
devices need to do this, this interface is optional.

Signed-off-by: default avatarjiangdongxu <jiangdongxu1@huawei.com>
parent 4eba0eab
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -315,6 +315,9 @@ struct vdpa_map_file {
 *				@offset: offset of src addr of device state.
 *				@src: userspace addr of device state
 *				@len: device state buffer length.
 * @set_mig_state		Set device migration status. (optional)
 *				@vdev: vdpa device
 *				@status: migration status
 * @free:			Free resources that belongs to vDPA (optional)
 *				@vdev: vdpa device
 */
@@ -391,6 +394,9 @@ struct vdpa_config_ops {
	int (*set_dev_buffer)(struct vdpa_device *vdev, unsigned int offset,
			      const void __user *src, unsigned int len);

	/* device mig state ops */
	int (*set_mig_state)(struct vdpa_device *v, u8 state);

	/* Free device resources */
	void (*free)(struct vdpa_device *vdev);
};