[libvirt] [PATCH 1/3] virfile: Provide stub for virFileInData
Peter Krempa
pkrempa at redhat.com
Fri May 19 10:28:42 UTC 2017
On Thu, May 18, 2017 at 15:46:44 +0200, Michal Privoznik wrote:
> Some older systems (such as RHEL6) lack SEEK_HOLE and SEEK_DATA
> which virFileInData relies on. Provide a stub for these systems.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> configure.ac | 5 +++++
> src/util/virfile.c | 15 +++++++++++++++
> 2 files changed, 20 insertions(+)
[...]
> @@ -3904,6 +3905,20 @@ virFileInData(int fd,
> return ret;
> }
>
> +#else /* !HAVE_DECL_SEEK_HOLE */
> +
> +int
> +virFileInData(int fd ATTRIBUTE_UNUSED,
> + int *inData ATTRIBUTE_UNUSED,
> + long long *length ATTRIBUTE_UNUSED)
> +{
> + virReportSystemError(ENOSYS, "%s",
> + _("sparse files not supported"));
> + return -1;
Wouldn't it be better as a fallback always return that data is present
rather than failing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170519/af284a96/attachment-0001.sig>
More information about the libvir-list
mailing list