From 4f7162d1066c15e21123ab7665c390007745328a Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Thu, 25 Nov 2010 16:38:32 +0800 Subject: [PATCH] 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 --- AUTHORS | 1 + src/qemu/qemu_monitor_json.c | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/AUTHORS b/AUTHORS index 449a45032b..16c755daa1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -135,6 +135,7 @@ Patches have also been contributed by: John Morrissey Osier Yang Kamezawa Hiroyuki + Wen Congyang [....send patches to get your name here....] diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index da51a4f5a8..ec6b720fa0 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; -- GitLab