mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
vfio/migration: Add x-migration-multifd-transfer VFIO property
This property allows configuring whether to transfer the particular device state via multifd channels when live migrating that device. It defaults to AUTO, which means that VFIO device state transfer via multifd channels is attempted in configurations that otherwise support it. Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/d6dbb326e3d53c7104d62c96c9e3dd64e1c7b940.1741124640.git.maciej.szmigiero@oracle.com [ clg: Added documentation ] Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
6d644baef2
commit
623af41dd3
4 changed files with 41 additions and 1 deletions
|
@ -476,18 +476,34 @@ bool vfio_multifd_transfer_supported(void)
|
|||
|
||||
bool vfio_multifd_transfer_enabled(VFIODevice *vbasedev)
|
||||
{
|
||||
return false;
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
|
||||
return migration->multifd_transfer;
|
||||
}
|
||||
|
||||
bool vfio_multifd_setup(VFIODevice *vbasedev, bool alloc_multifd, Error **errp)
|
||||
{
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
|
||||
if (vbasedev->migration_multifd_transfer == ON_OFF_AUTO_AUTO) {
|
||||
migration->multifd_transfer = vfio_multifd_transfer_supported();
|
||||
} else {
|
||||
migration->multifd_transfer =
|
||||
vbasedev->migration_multifd_transfer == ON_OFF_AUTO_ON;
|
||||
}
|
||||
|
||||
if (!vfio_multifd_transfer_enabled(vbasedev)) {
|
||||
/* Nothing further to check or do */
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!vfio_multifd_transfer_supported()) {
|
||||
error_setg(errp,
|
||||
"%s: Multifd device transfer requested but unsupported in the current config",
|
||||
vbasedev->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (alloc_multifd) {
|
||||
assert(!migration->multifd);
|
||||
migration->multifd = vfio_multifd_new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue