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

util: storagefile: Don't report errors from virStorageSourceUpdatePhysicalSize

virStorageSourceUpdatePhysicalSize is called only from
qemuDomainStorageUpdatePhysical and all callers of it reset the libvirt
error if -1 is returned.

Don't bother setting the error in the first place.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 ba6c12df
...@@ -3748,7 +3748,7 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent) ...@@ -3748,7 +3748,7 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent)
* To be called for domain storage source reporting as the volume code does * To be called for domain storage source reporting as the volume code does
* not set/use the 'type' field for the voldef->source.target * not set/use the 'type' field for the voldef->source.target
* *
* Returns 0 on success, -1 on error. * Returns 0 on success, -1 on error. No libvirt errors are reported.
*/ */
int int
virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src, virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
...@@ -3765,11 +3765,8 @@ virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src, ...@@ -3765,11 +3765,8 @@ virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
break; break;
case VIR_STORAGE_TYPE_BLOCK: case VIR_STORAGE_TYPE_BLOCK:
if ((end = lseek(fd, 0, SEEK_END)) == (off_t) -1) { if ((end = lseek(fd, 0, SEEK_END)) == (off_t) -1)
virReportSystemError(errno, _("failed to seek to end of '%s'"),
src->path);
return -1; return -1;
}
src->physical = end; src->physical = end;
break; break;
...@@ -3782,12 +3779,7 @@ virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src, ...@@ -3782,12 +3779,7 @@ virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
case VIR_STORAGE_TYPE_VOLUME: case VIR_STORAGE_TYPE_VOLUME:
case VIR_STORAGE_TYPE_NONE: case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST: case VIR_STORAGE_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot retrieve physical for path '%s' type '%s'"),
NULLSTR(src->path),
virStorageTypeToString(actual_type));
return -1; return -1;
break;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册