blob: 12fd399f0c521c5c28535b58f24feab6845947fd [file] [log] [blame]
Thomas Huth43bd0bf2021-04-14 13:20:02 +02001/*
2 * QEMU live migration - functions that need to be compiled target-specific
3 *
4 * This work is licensed under the terms of the GNU GPL, version 2
5 * or (at your option) any later version.
6 */
7
8#include "qemu/osdep.h"
9#include "qapi/qapi-types-migration.h"
10#include "migration.h"
Steve Sistarefa76c852023-02-07 10:47:03 -080011#include CONFIG_DEVICES
Thomas Huth43bd0bf2021-04-14 13:20:02 +020012
13#ifdef CONFIG_VFIO
Cédric Le Goatere1d4ea52025-03-26 08:50:48 +010014#include "hw/vfio/vfio-migration.h"
Thomas Huth43bd0bf2021-04-14 13:20:02 +020015#endif
16
Avihai Horon808642a2023-06-28 10:31:11 +030017#ifdef CONFIG_VFIO
Avihai Horon38c482b2023-09-06 18:08:48 +030018void migration_populate_vfio_info(MigrationInfo *info)
Thomas Huth43bd0bf2021-04-14 13:20:02 +020019{
Cédric Le Goatere1d4ea52025-03-26 08:50:48 +010020 if (vfio_migration_active()) {
Thomas Huth43bd0bf2021-04-14 13:20:02 +020021 info->vfio = g_malloc0(sizeof(*info->vfio));
Cédric Le Goatere1d4ea52025-03-26 08:50:48 +010022 info->vfio->transferred = vfio_migration_bytes_transferred();
Thomas Huth43bd0bf2021-04-14 13:20:02 +020023 }
Thomas Huth43bd0bf2021-04-14 13:20:02 +020024}
Avihai Horon808642a2023-06-28 10:31:11 +030025
Avihai Horon38c482b2023-09-06 18:08:48 +030026void migration_reset_vfio_bytes_transferred(void)
Avihai Horon808642a2023-06-28 10:31:11 +030027{
Cédric Le Goatere1d4ea52025-03-26 08:50:48 +010028 vfio_migration_reset_bytes_transferred();
Avihai Horon808642a2023-06-28 10:31:11 +030029}
30#else
Avihai Horon38c482b2023-09-06 18:08:48 +030031void migration_populate_vfio_info(MigrationInfo *info)
Avihai Horon808642a2023-06-28 10:31:11 +030032{
33}
34
Avihai Horon38c482b2023-09-06 18:08:48 +030035void migration_reset_vfio_bytes_transferred(void)
Avihai Horon808642a2023-06-28 10:31:11 +030036{
37}
38#endif