提交 78d9325d 编写于 作者: A Adam Litke 提交者: Eric Blake

BlockJob: Bandwidth parameter is in MB when using text monitor

Due to an unfortunate precedent in qemu, the units for the bandwidth parameter
to block_job_set_speed are different between the text monitor and the qmp
monitor.  While the qmp monitor uses bytes/s, the text monitor expects MB/s.

Correct the units for the text interface.
Signed-off-by: NAdam Litke <agl@us.ibm.com>
上级 57c95175
......@@ -3067,8 +3067,7 @@ int qemuMonitorTextBlockJob(qemuMonitorPtr mon,
ret = virAsprintf(&cmd, "%s", cmd_name);
} else if (mode == BLOCK_JOB_SPEED) {
cmd_name = "block_job_set_speed";
ret = virAsprintf(&cmd, "%s %s %llu", cmd_name, device,
bandwidth * 1024ULL * 1024ULL);
ret = virAsprintf(&cmd, "%s %s %luM", cmd_name, device, bandwidth);
} else if (mode == BLOCK_JOB_PULL) {
cmd_name = "block_stream";
ret = virAsprintf(&cmd, "%s %s", cmd_name, device);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册