qemu_fclose frees the passed file structure, but do_migrate_set_speed
may access it later on. Fix it by setting file NULL in
migrate_fd_cleanup and checking for this.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
}
max_throttle = (uint32_t)d;
- s = migrate_to_fms(current_migration);
- if (s) {
+ s = migrate_to_fms(current_migration);
+ if (s && s->file) {
qemu_file_set_rate_limit(s->file, max_throttle);
}
-
}
/* amount of nanoseconds we are willing to wait for migration to be down.
if (s->file) {
dprintf("closing file\n");
qemu_fclose(s->file);
+ s->file = NULL;
}
if (s->fd != -1)