提交 4f7162d1 编写于 作者: W Wen Congyang 提交者: Eric Blake

correct the arguments of migrate_speed

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: NWen Congyang <wency@cn.fujitsu.com>
上级 645c9229
......@@ -135,6 +135,7 @@ Patches have also been contributed by:
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....]
......
......@@ -1453,17 +1453,11 @@ int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon,
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册