1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00

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: Wen Congyang <wency@cn.fujitsu.com>
This commit is contained in:
Wen Congyang 2010-11-25 16:38:32 +08:00 committed by Eric Blake
parent 645c92297a
commit 4f7162d106
2 changed files with 2 additions and 7 deletions

View File

@ -135,6 +135,7 @@ Patches have also been contributed by:
John Morrissey <jwm@horde.net> John Morrissey <jwm@horde.net>
Osier Yang <jyang@redhat.com> Osier Yang <jyang@redhat.com>
Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Wen Congyang <wency@cn.fujitsu.com>
[....send patches to get your name here....] [....send patches to get your name here....]

View File

@ -1453,17 +1453,11 @@ int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon,
unsigned long bandwidth) unsigned long bandwidth)
{ {
int ret; int ret;
char *bandwidthstr;
virJSONValuePtr cmd; virJSONValuePtr cmd;
virJSONValuePtr reply = NULL; virJSONValuePtr reply = NULL;
if (virAsprintf(&bandwidthstr, "%lum", bandwidth) < 0) {
virReportOOMError();
return -1;
}
cmd = qemuMonitorJSONMakeCommand("migrate_set_speed", cmd = qemuMonitorJSONMakeCommand("migrate_set_speed",
"s:value", bandwidthstr, "U:value", bandwidth * 1024ULL * 1024ULL,
NULL); NULL);
VIR_FREE(bandwidthstr);
if (!cmd) if (!cmd)
return -1; return -1;