mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
vhost-user: Interface for migration state transfer
Add the interface for transferring the back-end's state during migration as defined previously in vhost-user.rst. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Hanna Czenczek <hreitz@redhat.com> Message-Id: <20231016134243.68248-6-hreitz@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
019233096c
commit
cda83adc62
5 changed files with 286 additions and 0 deletions
|
@ -2159,3 +2159,40 @@ int vhost_reset_device(struct vhost_dev *hdev)
|
|||
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
bool vhost_supports_device_state(struct vhost_dev *dev)
|
||||
{
|
||||
if (dev->vhost_ops->vhost_supports_device_state) {
|
||||
return dev->vhost_ops->vhost_supports_device_state(dev);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int vhost_set_device_state_fd(struct vhost_dev *dev,
|
||||
VhostDeviceStateDirection direction,
|
||||
VhostDeviceStatePhase phase,
|
||||
int fd,
|
||||
int *reply_fd,
|
||||
Error **errp)
|
||||
{
|
||||
if (dev->vhost_ops->vhost_set_device_state_fd) {
|
||||
return dev->vhost_ops->vhost_set_device_state_fd(dev, direction, phase,
|
||||
fd, reply_fd, errp);
|
||||
}
|
||||
|
||||
error_setg(errp,
|
||||
"vhost transport does not support migration state transfer");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
int vhost_check_device_state(struct vhost_dev *dev, Error **errp)
|
||||
{
|
||||
if (dev->vhost_ops->vhost_check_device_state) {
|
||||
return dev->vhost_ops->vhost_check_device_state(dev, errp);
|
||||
}
|
||||
|
||||
error_setg(errp,
|
||||
"vhost transport does not support migration state transfer");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue