summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Congyang <wency@cn.fujitsu.com>2010-11-25 16:38:32 +0800
committerEric Blake <eblake@redhat.com>2010-11-29 15:11:03 -0700
commit4f7162d1066c15e21123ab7665c390007745328a (patch)
treef5553758f56b0ef75d93e871760290a01524ac99
parenttests: Fix detection of expected errors (diff)
downloadlibvirt-4f7162d1066c15e21123ab7665c390007745328a.tar.gz
libvirt-4f7162d1066c15e21123ab7665c390007745328a.tar.bz2
libvirt-4f7162d1066c15e21123ab7665c390007745328a.zip
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>
-rw-r--r--AUTHORS1
-rw-r--r--src/qemu/qemu_monitor_json.c8
2 files changed, 2 insertions, 7 deletions
diff --git a/AUTHORS b/AUTHORS
index 449a45032..16c755daa 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -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....]
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index da51a4f5a..ec6b720fa 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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;