.params = "value",
.help = "set maximum speed (in bytes) for migrations. "
"Defaults to MB if no size suffix is specified, ie. B/K/M/G/T",
- .user_print = monitor_user_noop,
- .mhandler.cmd_new = do_migrate_set_speed,
+ .mhandler.cmd = hmp_migrate_set_speed,
},
STEXI
double value = qdict_get_double(qdict, "value");
qmp_migrate_set_downtime(value, NULL);
}
+
+void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict)
+{
+ int64_t value = qdict_get_int(qdict, "value");
+ qmp_migrate_set_speed(value, NULL);
+}
void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict);
void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict);
+void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict);
#endif
migrate_fd_cancel(migrate_get_current());
}
-int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data)
+void qmp_migrate_set_speed(int64_t value, Error **errp)
{
- int64_t d;
MigrationState *s;
- d = qdict_get_int(qdict, "value");
- if (d < 0) {
- d = 0;
+ if (value < 0) {
+ value = 0;
}
s = migrate_get_current();
- s->bandwidth_limit = d;
+ s->bandwidth_limit = value;
qemu_file_set_rate_limit(s->file, s->bandwidth_limit);
-
- return 0;
}
void qmp_migrate_set_downtime(double value, Error **errp)
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data);
-int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data);
-
uint64_t migrate_max_downtime(void);
void do_info_migrate_print(Monitor *mon, const QObject *data);
# Since: 0.14.0
##
{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
+
+##
+# @migrate_set_speed
+#
+# Set maximum speed for migration.
+#
+# @value: maximum speed in bytes.
+#
+# Returns: nothing on success
+#
+# Notes: A value lesser than zero will be automatically round up to zero.
+#
+# Since: 0.14.0
+##
+{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
{
.name = "migrate_set_speed",
.args_type = "value:o",
- .params = "value",
- .help = "set maximum speed (in bytes) for migrations",
- .user_print = monitor_user_noop,
- .mhandler.cmd_new = do_migrate_set_speed,
+ .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
},
SQMP