qapi: Convert migrate_set_downtime
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
6cdedb075f
commit
4f0a993bf3
@ -801,8 +801,7 @@ ETEXI
|
|||||||
.args_type = "value:T",
|
.args_type = "value:T",
|
||||||
.params = "value",
|
.params = "value",
|
||||||
.help = "set maximum tolerated downtime (in seconds) for migrations",
|
.help = "set maximum tolerated downtime (in seconds) for migrations",
|
||||||
.user_print = monitor_user_noop,
|
.mhandler.cmd = hmp_migrate_set_downtime,
|
||||||
.mhandler.cmd_new = do_migrate_set_downtime,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
STEXI
|
STEXI
|
||||||
|
6
hmp.c
6
hmp.c
@ -667,3 +667,9 @@ void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
|
|||||||
{
|
{
|
||||||
qmp_migrate_cancel(NULL);
|
qmp_migrate_cancel(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict)
|
||||||
|
{
|
||||||
|
double value = qdict_get_double(qdict, "value");
|
||||||
|
qmp_migrate_set_downtime(value, NULL);
|
||||||
|
}
|
||||||
|
1
hmp.h
1
hmp.h
@ -47,5 +47,6 @@ void hmp_balloon(Monitor *mon, const QDict *qdict);
|
|||||||
void hmp_block_resize(Monitor *mon, const QDict *qdict);
|
void hmp_block_resize(Monitor *mon, const QDict *qdict);
|
||||||
void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict);
|
void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict);
|
||||||
void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
|
void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
|
||||||
|
void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
13
migration.c
13
migration.c
@ -490,14 +490,9 @@ int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_migrate_set_downtime(Monitor *mon, const QDict *qdict,
|
void qmp_migrate_set_downtime(double value, Error **errp)
|
||||||
QObject **ret_data)
|
|
||||||
{
|
{
|
||||||
double d;
|
value *= 1e9;
|
||||||
|
value = MAX(0, MIN(UINT64_MAX, value));
|
||||||
d = qdict_get_double(qdict, "value") * 1e9;
|
max_downtime = (uint64_t)value;
|
||||||
d = MAX(0, MIN(UINT64_MAX, d));
|
|
||||||
max_downtime = (uint64_t)d;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,6 @@ int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data);
|
|||||||
|
|
||||||
uint64_t migrate_max_downtime(void);
|
uint64_t migrate_max_downtime(void);
|
||||||
|
|
||||||
int do_migrate_set_downtime(Monitor *mon, const QDict *qdict,
|
|
||||||
QObject **ret_data);
|
|
||||||
|
|
||||||
void do_info_migrate_print(Monitor *mon, const QObject *data);
|
void do_info_migrate_print(Monitor *mon, const QObject *data);
|
||||||
|
|
||||||
void do_info_migrate(Monitor *mon, QObject **ret_data);
|
void do_info_migrate(Monitor *mon, QObject **ret_data);
|
||||||
|
@ -1140,3 +1140,16 @@
|
|||||||
# Since: 0.14.0
|
# Since: 0.14.0
|
||||||
##
|
##
|
||||||
{ 'command': 'migrate_cancel' }
|
{ 'command': 'migrate_cancel' }
|
||||||
|
|
||||||
|
##
|
||||||
|
# @migrate_set_downtime
|
||||||
|
#
|
||||||
|
# Set maximum tolerated downtime for migration.
|
||||||
|
#
|
||||||
|
# @value: maximum downtime in seconds
|
||||||
|
#
|
||||||
|
# Returns: nothing on success
|
||||||
|
#
|
||||||
|
# Since: 0.14.0
|
||||||
|
##
|
||||||
|
{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
|
||||||
|
@ -518,10 +518,7 @@ EQMP
|
|||||||
{
|
{
|
||||||
.name = "migrate_set_downtime",
|
.name = "migrate_set_downtime",
|
||||||
.args_type = "value:T",
|
.args_type = "value:T",
|
||||||
.params = "value",
|
.mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
|
||||||
.help = "set maximum tolerated downtime (in seconds) for migrations",
|
|
||||||
.user_print = monitor_user_noop,
|
|
||||||
.mhandler.cmd_new = do_migrate_set_downtime,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
SQMP
|
SQMP
|
||||||
|
Loading…
Reference in New Issue
Block a user