summaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/savevm.c b/savevm.c
index 113f2207c7..181c088494 100644
--- a/savevm.c
+++ b/savevm.c
@@ -556,7 +556,9 @@ int qemu_file_rate_limit(QEMUFile *f)
size_t qemu_file_set_rate_limit(QEMUFile *f, size_t new_rate)
{
- if (f->set_rate_limit)
+ /* any failed or completed migration keeps its state to allow probing of
+ * migration data, but has no associated file anymore */
+ if (f && f->set_rate_limit)
return f->set_rate_limit(f->opaque, new_rate);
return 0;