[libvirt] [PATCHv5 1/7] storage: Add APIs for internal handling of files via the storage driver

Peter Krempa pkrempa at redhat.com
Wed Feb 12 14:00:23 UTC 2014


On 02/11/14 17:26, Peter Krempa wrote:
> Some remote filesystems are not accessible via the local filesystem
> calls, but libvirt needs means to do operations on such files.
> 
> This patch adds internal APIs into the storage driver that will allow
> operations on various networked and other filesystems.
> ---
> 
> Notes:
>     Version 5:
>     - changed error reporting scheme and re-documented
>     - fix indentation of makefile
>     - simplified conditions according to review
>     - fixed typos
> 
>  docs/hvsupport.pl        |   4 +-
>  po/POTFILES.in           |   1 +
>  src/Makefile.am          |   1 +
>  src/check-drivername.pl  |   1 +
>  src/driver.h             |  30 +++++++-
>  src/libvirt_private.c    | 180 +++++++++++++++++++++++++++++++++++++++++++++++
>  src/libvirt_private.h    |  61 ++++++++++++++++
>  src/libvirt_private.syms |   9 +++
>  8 files changed, 285 insertions(+), 2 deletions(-)
>  create mode 100644 src/libvirt_private.c
>  create mode 100644 src/libvirt_private.h
> 

> diff --git a/src/libvirt_private.c b/src/libvirt_private.c
> new file mode 100644
> index 0000000..330dd88
> --- /dev/null
> +++ b/src/libvirt_private.c

...

> +/**
> + * virStorageFileStat: returns stat struct of a file via storage driver
> + *
> + * @file: file structure pointing to the file
> + * @stat: stat structure to return data
> + *
> + * Returns 0 on success, -2 if the function isn't supported by the backend,
> + * -1 on other failure. Errno is set in case of failure.
> +*/
> +int
> +virStorageFileStat(virStorageFilePtr file,
> +                   struct stat *stat)

Older complilers complain here that "stat" shadows a global symbol. I'll
change this variable name to st.

> +{
> +    if (file->driver->storageFileStat)
> +        return file->driver->storageFileStat(file, stat);
> +
> +    errno = ENOSYS;
> +    return -2;
> +}

Peter




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140212/49115a78/attachment-0001.sig>


More information about the libvir-list mailing list