int do_migrate_set_downtime(Monitor *mon, const QDict *qdict, QObject **ret_data) { double d; d = qdict_get_double(qdict, "value") * 1e9; d = MAX(0, MIN(UINT64_MAX, d)); max_downtime = (uint64_t)d; return 0; }
int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data) { double d; FdMigrationState *s; d = qdict_get_double(qdict, "value"); d = MAX(0, MIN(UINT32_MAX, d)); max_throttle = d; s = migrate_to_fms(current_migration); if (s && s->file) { qemu_file_set_rate_limit(s->file, max_throttle); } return 0; }