Thomas Huth | 43bd0bf | 2021-04-14 13:20:02 +0200 | [diff] [blame] | 1 | /* |
| 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 Sistare | fa76c85 | 2023-02-07 10:47:03 -0800 | [diff] [blame] | 11 | #include CONFIG_DEVICES |
Thomas Huth | 43bd0bf | 2021-04-14 13:20:02 +0200 | [diff] [blame] | 12 | |
| 13 | #ifdef CONFIG_VFIO |
| 14 | #include "hw/vfio/vfio-common.h" |
| 15 | #endif |
| 16 | |
Avihai Horon | 808642a | 2023-06-28 10:31:11 +0300 | [diff] [blame] | 17 | #ifdef CONFIG_VFIO |
Avihai Horon | 38c482b | 2023-09-06 18:08:48 +0300 | [diff] [blame] | 18 | void migration_populate_vfio_info(MigrationInfo *info) |
Thomas Huth | 43bd0bf | 2021-04-14 13:20:02 +0200 | [diff] [blame] | 19 | { |
Thomas Huth | 43bd0bf | 2021-04-14 13:20:02 +0200 | [diff] [blame] | 20 | if (vfio_mig_active()) { |
Thomas Huth | 43bd0bf | 2021-04-14 13:20:02 +0200 | [diff] [blame] | 21 | info->vfio = g_malloc0(sizeof(*info->vfio)); |
| 22 | info->vfio->transferred = vfio_mig_bytes_transferred(); |
| 23 | } |
Thomas Huth | 43bd0bf | 2021-04-14 13:20:02 +0200 | [diff] [blame] | 24 | } |
Avihai Horon | 808642a | 2023-06-28 10:31:11 +0300 | [diff] [blame] | 25 | |
Avihai Horon | 38c482b | 2023-09-06 18:08:48 +0300 | [diff] [blame] | 26 | void migration_reset_vfio_bytes_transferred(void) |
Avihai Horon | 808642a | 2023-06-28 10:31:11 +0300 | [diff] [blame] | 27 | { |
| 28 | vfio_reset_bytes_transferred(); |
| 29 | } |
| 30 | #else |
Avihai Horon | 38c482b | 2023-09-06 18:08:48 +0300 | [diff] [blame] | 31 | void migration_populate_vfio_info(MigrationInfo *info) |
Avihai Horon | 808642a | 2023-06-28 10:31:11 +0300 | [diff] [blame] | 32 | { |
| 33 | } |
| 34 | |
Avihai Horon | 38c482b | 2023-09-06 18:08:48 +0300 | [diff] [blame] | 35 | void migration_reset_vfio_bytes_transferred(void) |
Avihai Horon | 808642a | 2023-06-28 10:31:11 +0300 | [diff] [blame] | 36 | { |
| 37 | } |
| 38 | #endif |