2
0

target.c 815 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. #include "qemu/osdep.h"
  8. #include "qapi/qapi-types-migration.h"
  9. #include "migration.h"
  10. #include CONFIG_DEVICES
  11. #ifdef CONFIG_VFIO
  12. #include "hw/vfio/vfio-common.h"
  13. #endif
  14. #ifdef CONFIG_VFIO
  15. void migration_populate_vfio_info(MigrationInfo *info)
  16. {
  17. if (vfio_mig_active()) {
  18. info->vfio = g_malloc0(sizeof(*info->vfio));
  19. info->vfio->transferred = vfio_mig_bytes_transferred();
  20. }
  21. }
  22. void migration_reset_vfio_bytes_transferred(void)
  23. {
  24. vfio_reset_bytes_transferred();
  25. }
  26. #else
  27. void migration_populate_vfio_info(MigrationInfo *info)
  28. {
  29. }
  30. void migration_reset_vfio_bytes_transferred(void)
  31. {
  32. }
  33. #endif