diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a150b08f5f..eca32b4bbd 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9418,8 +9418,14 @@ static int qemuDomainBlockPull(virDomainPtr dom, const char *path, unsigned long bandwidth, unsigned int flags) { + int ret; + virCheckFlags(0, -1); - return qemuDomainBlockJobImpl(dom, path, bandwidth, NULL, BLOCK_JOB_PULL); + ret = qemuDomainBlockJobImpl(dom, path, bandwidth, NULL, BLOCK_JOB_PULL); + if (ret == 0 && bandwidth != 0) + ret = qemuDomainBlockJobImpl(dom, path, bandwidth, NULL, + BLOCK_JOB_SPEED); + return ret; } static virDriver qemuDriver = { diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 715b26e97b..4ceb536538 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2956,10 +2956,6 @@ int qemuMonitorJSONBlockJob(qemuMonitorPtr mon, if (ret == 0 && mode == BLOCK_JOB_INFO) ret = qemuMonitorJSONGetBlockJobInfo(reply, device, info); - if (ret == 0 && mode == BLOCK_JOB_PULL && bandwidth != 0) - ret = qemuMonitorJSONBlockJob(mon, device, bandwidth, NULL, - BLOCK_JOB_SPEED); - virJSONValueFree(cmd); virJSONValueFree(reply); return ret;