aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/common.c
diff options
context:
space:
mode:
authorKirti Wankhede <kwankhede@nvidia.com>2020-10-26 15:06:27 +0530
committerAlex Williamson <alex.williamson@redhat.com>2020-11-01 12:30:51 -0700
commit3710586caa5d91a52c0cf247e1c829a50f2e7b98 (patch)
tree4c9b1e449ace7dcd6ff85756a4771dd84305d359 /hw/vfio/common.c
parenta22651053b59b7d40bf921e8819ea696a3b0a9d2 (diff)
qapi: Add VFIO devices migration stats in Migration stats
Added amount of bytes transferred to the VM at destination by all VFIO devices Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio/common.c')
-rw-r--r--hw/vfio/common.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 620358a3d8..d41ba67ffb 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -292,6 +292,25 @@ const MemoryRegionOps vfio_region_ops = {
* Device state interfaces
*/
+bool vfio_mig_active(void)
+{
+ VFIOGroup *group;
+ VFIODevice *vbasedev;
+
+ if (QLIST_EMPTY(&vfio_group_list)) {
+ return false;
+ }
+
+ QLIST_FOREACH(group, &vfio_group_list, next) {
+ QLIST_FOREACH(vbasedev, &group->device_list, next) {
+ if (vbasedev->migration_blocker) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
static bool vfio_devices_all_stopped_and_saving(VFIOContainer *container)
{
VFIOGroup *group;