[RFC v4 21/21] Only set qemu file error if saving state so the file exists

John Johnson posted 21 patches 4 years ago
Maintainers: Alex Williamson <alex.williamson@redhat.com>, Thanos Makatos <thanos.makatos@nutanix.com>, Eric Farman <farman@linux.ibm.com>, Cornelia Huck <cohuck@redhat.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Elena Ufimtseva <elena.ufimtseva@oracle.com>, John G Johnson <john.g.johnson@oracle.com>, Thomas Huth <thuth@redhat.com>, Jagannathan Raman <jag.raman@oracle.com>
There is a newer version of this series
[RFC v4 21/21] Only set qemu file error if saving state so the file exists
Posted by John Johnson 4 years ago
Signed-off-by: John G Johnson <john.g.johnson@oracle.com>
Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
---
 hw/vfio/migration.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index df63f5c..e72241d 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -742,7 +742,9 @@ static void vfio_vmstate_change(void *opaque, bool running, RunState state)
          */
         error_report("%s: Failed to set device state 0x%x", vbasedev->name,
                      (migration->device_state & mask) | value);
-        qemu_file_set_error(migrate_get_current()->to_dst_file, ret);
+        if (value != 0) {
+            qemu_file_set_error(migrate_get_current()->to_dst_file, ret);
+        }
     }
     vbasedev->migration->vm_running = running;
     trace_vfio_vmstate_change(vbasedev->name, running, RunState_str(state),
-- 
1.8.3.1