提交 5d39c799 编写于 作者: J Jan Kiszka 提交者: Anthony Liguori

migration: Fix use of file after release

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: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 be73cfe2
......@@ -118,12 +118,11 @@ void do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data)
}
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.
......@@ -209,6 +208,7 @@ void migrate_fd_cleanup(FdMigrationState *s)
if (s->file) {
dprintf("closing file\n");
qemu_fclose(s->file);
s->file = NULL;
}
if (s->fd != -1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册