xref: /qemu/migration/target.c (revision e1d4ea53d6e393def88258a3badf8907db33608e)
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"
11  #include CONFIG_DEVICES
12  
13  #ifdef CONFIG_VFIO
14  #include "hw/vfio/vfio-migration.h"
15  #endif
16  
17  #ifdef CONFIG_VFIO
18  void migration_populate_vfio_info(MigrationInfo *info)
19  {
20      if (vfio_migration_active()) {
21          info->vfio = g_malloc0(sizeof(*info->vfio));
22          info->vfio->transferred = vfio_migration_bytes_transferred();
23      }
24  }
25  
26  void migration_reset_vfio_bytes_transferred(void)
27  {
28      vfio_migration_reset_bytes_transferred();
29  }
30  #else
31  void migration_populate_vfio_info(MigrationInfo *info)
32  {
33  }
34  
35  void migration_reset_vfio_bytes_transferred(void)
36  {
37  }
38  #endif
39