if (params->has_max_bandwidth) {
s->parameters.max_bandwidth = params->max_bandwidth;
- if (s->to_dst_file) {
+ if (s->to_dst_file && !migration_in_postcopy()) {
qemu_file_set_rate_limit(s->to_dst_file,
s->parameters.max_bandwidth / XFER_LIMIT_RATIO);
}
}
if (params->has_max_postcopy_bandwidth) {
s->parameters.max_postcopy_bandwidth = params->max_postcopy_bandwidth;
+ if (s->to_dst_file && migration_in_postcopy()) {
+ qemu_file_set_rate_limit(s->to_dst_file,
+ s->parameters.max_postcopy_bandwidth / XFER_LIMIT_RATIO);
+ }
}
if (params->has_max_cpu_throttle) {
s->parameters.max_cpu_throttle = params->max_cpu_throttle;
bool migration_is_idle(void)
{
- MigrationState *s = migrate_get_current();
+ MigrationState *s = current_migration;
+
+ if (!s) {
+ return true;
+ }
switch (s->state) {
case MIGRATION_STATUS_NONE:
int migrate_add_blocker(Error *reason, Error **errp)
{
- if (migrate_get_current()->only_migratable) {
+ if (only_migratable) {
error_propagate_prepend(errp, error_copy(reason),
"disallowing migration blocker "
"(--only_migratable) for: ");
monitor_printf(mon, "store-global-state: %s\n",
ms->store_global_state ? "on" : "off");
monitor_printf(mon, "only-migratable: %s\n",
- ms->only_migratable ? "on" : "off");
+ only_migratable ? "on" : "off");
monitor_printf(mon, "send-configuration: %s\n",
ms->send_configuration ? "on" : "off");
monitor_printf(mon, "send-section-footer: %s\n",
static Property migration_properties[] = {
DEFINE_PROP_BOOL("store-global-state", MigrationState,
store_global_state, true),
- DEFINE_PROP_BOOL("only-migratable", MigrationState, only_migratable, false),
DEFINE_PROP_BOOL("send-configuration", MigrationState,
send_configuration, true),
DEFINE_PROP_BOOL("send-section-footer", MigrationState,