]> xenbits.xensource.com Git - libvirt.git/commitdiff
correct the arguments of migrate_speed
authorWen Congyang <wency@cn.fujitsu.com>
Thu, 25 Nov 2010 08:38:32 +0000 (16:38 +0800)
committerEric Blake <eblake@redhat.com>
Mon, 29 Nov 2010 22:11:03 +0000 (15:11 -0700)
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>
AUTHORS
src/qemu/qemu_monitor_json.c

diff --git a/AUTHORS b/AUTHORS
index 449a45032b8743729914ce3f6d1b05237a3b4494..16c755daa1a7f4440008a56da1fa7f1716de3e56 100644 (file)
--- 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....]
 
index da51a4f5a8528f4416691642a774b0f8c9ce2866..ec6b720fa0339448331b237c9b66c367d88e69d9 100644 (file)
@@ -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;