aboutsummaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/migration.c b/migration.c
index 8280d7189a..412fdfe5bf 100644
--- a/migration.c
+++ b/migration.c
@@ -174,9 +174,7 @@ static int migrate_fd_cleanup(MigrationState *s)
if (s->file) {
DPRINTF("closing file\n");
- if (qemu_fclose(s->file) != 0) {
- ret = -1;
- }
+ ret = qemu_fclose(s->file);
s->file = NULL;
} else {
if (s->mon) {
@@ -468,37 +466,27 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
return 0;
}
-int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data)
+void qmp_migrate_cancel(Error **errp)
{
migrate_fd_cancel(migrate_get_current());
- return 0;
}
-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;
}
-int do_migrate_set_downtime(Monitor *mon, const QDict *qdict,
- QObject **ret_data)
+void qmp_migrate_set_downtime(double value, Error **errp)
{
- double d;
-
- d = qdict_get_double(qdict, "value") * 1e9;
- d = MAX(0, MIN(UINT64_MAX, d));
- max_downtime = (uint64_t)d;
-
- return 0;
+ value *= 1e9;
+ value = MAX(0, MIN(UINT64_MAX, value));
+ max_downtime = (uint64_t)value;
}