提交 b5c2245b 编写于 作者: L Luyao Huang 提交者: Martin Kletzander

qemu: report error for non-existing disk in blockjobinfo

Before:

 # virsh blockjob r7 vdc
 error: An error occurred, but the cause is unknown

After:

 # virsh blockjob r7 vdc
 error: Disk 'vdc' not found in the domain

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1241355Signed-off-by: NLuyao Huang <lhuang@redhat.com>
上级 2e09729b
......@@ -16414,8 +16414,11 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
if (qemuDomainSupportsBlockJobs(vm, NULL) < 0)
goto endjob;
if (!(disk = virDomainDiskByName(vm->def, path, true)))
if (!(disk = virDomainDiskByName(vm->def, path, true))) {
virReportError(VIR_ERR_INVALID_ARG,
_("disk %s not found in the domain"), path);
goto endjob;
}
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorGetBlockJobInfo(qemuDomainGetMonitor(vm),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册