When we set migrate_speed by json, we receive the following
error message:
libvirtError: internal error unable to execute QEMU command
'migrate_set_speed': Invalid parameter type, expected: number
The reason is that: the arguments of migrate_set_speed
by json is json number, not json string.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
John Morrissey <jwm@horde.net>
Osier Yang <jyang@redhat.com>
Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
+ Wen Congyang <wency@cn.fujitsu.com>
[....send patches to get your name here....]
unsigned long bandwidth)
{
int ret;
- char *bandwidthstr;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
- if (virAsprintf(&bandwidthstr, "%lum", bandwidth) < 0) {
- virReportOOMError();
- return -1;
- }
cmd = qemuMonitorJSONMakeCommand("migrate_set_speed",
- "s:value", bandwidthstr,
+ "U:value", bandwidth * 1024ULL * 1024ULL,
NULL);
- VIR_FREE(bandwidthstr);
if (!cmd)
return -1;