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

Eric Blake eblake at redhat.com
Fri Feb 7 00:07:59 UTC 2014


On 02/03/2014 09:54 AM, 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.
> ---
>  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    | 176 +++++++++++++++++++++++++++++++++++++++++++++++
>  src/libvirt_private.h    |  61 ++++++++++++++++
>  src/libvirt_private.syms |   9 +++
>  8 files changed, 281 insertions(+), 2 deletions(-)
>  create mode 100644 src/libvirt_private.c
>  create mode 100644 src/libvirt_private.h
> 

> +++ b/src/Makefile.am
> @@ -173,6 +173,7 @@ DRIVER_SOURCES =							\
>  		fdstream.c fdstream.h					\
>  		$(NODE_INFO_SOURCES)					\
>  		libvirt.c libvirt_internal.h				\
> +		libvirt_private.h libvirt_private.c \
>  		locking/lock_manager.c locking/lock_manager.h		\

Alignment of \ looks off.


> +virStorageFilePtr
> +virStorageFileInitFromDiskDef(virConnectPtr conn,
> +                              virDomainDiskDefPtr disk)
> +{

> +
> +    if (file->driver->storageFileInit) {
> +        if (file->driver->storageFileInit(file) < 0)

This could be joined with && instead of nested if.


> +
> +
> +virStorageFilePtr
> +virStorageFileInitFromSnapshotDef(virConnectPtr conn,
> +                                  virDomainSnapshotDiskDefPtr disk)

> +
> +    if (file->driver->storageFileInit) {
> +        if (file->driver->storageFileInit(file) < 0)
> +            goto error;

Same here.

> +/**
> + * virStorageFileUnlink: Unlink storage file via storage driver
> + *
> + * @file: file structure poiniting to the file

s/poiniting/pointing/

Those are all minor.  Wait for the review of the full series before
pushing this, but I'm okay with ACK for htis one.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list