提交 d179acf4 编写于 作者: P Peter Krempa

qemu: driver: Use appropriate job name when setting blockjob speed

qemuDomainBlockJobSetSpeed was not converted to get the job name from
the block job data. This means that after enabling blockdev the API call
would fail as we wouldn't use the appropriate name.

https://bugzilla.redhat.com/show_bug.cgi?id=1780497Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 e3faa848
......@@ -17864,8 +17864,8 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
virDomainDiskDefPtr disk;
int ret = -1;
virDomainObjPtr vm;
g_autofree char *device = NULL;
unsigned long long speed = bandwidth;
g_autoptr(qemuBlockJobData) job = NULL;
virCheckFlags(VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES, -1);
......@@ -17895,12 +17895,15 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
if (!(disk = qemuDomainDiskByName(vm->def, path)))
goto endjob;
if (!(device = qemuAliasDiskDriveFromDisk(disk)))
if (!(job = qemuBlockJobDiskGetJob(disk))) {
virReportError(VIR_ERR_INVALID_ARG,
_("disk %s does not have an active block job"), disk->dst);
goto endjob;
}
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorBlockJobSetSpeed(qemuDomainGetMonitor(vm),
device,
job->name,
speed);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册