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

qemu: driver: Use qemuDomainDiskByName instead of virDomainDiskByName

Where appropriate replace the open coded call with the qemu wrapper
which already reports the error.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 ca67d02f
......@@ -11890,12 +11890,8 @@ qemuDomainBlockPeek(virDomainPtr dom,
if (virDomainBlockPeekEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
/* Check the path belongs to this domain. */
if (!(disk = virDomainDiskByName(vm->def, path, true))) {
virReportError(VIR_ERR_INVALID_ARG,
_("invalid disk or path '%s'"), path);
if (!(disk = qemuDomainDiskByName(vm->def, path)))
goto cleanup;
}
if (disk->src->format != VIR_STORAGE_FILE_RAW) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
......@@ -17828,11 +17824,8 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
if (virDomainObjCheckActive(vm) < 0)
goto endjob;
if (!(disk = virDomainDiskByName(vm->def, path, true))) {
virReportError(VIR_ERR_INVALID_ARG,
_("disk %s not found in the domain"), path);
if (!(disk = qemuDomainDiskByName(vm->def, path)))
goto endjob;
}
if (!(job = qemuBlockJobDiskGetJob(disk))) {
ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册