[libvirt] [PATCH v1.5 2/6] storage: Split utility functions from storage_backend.(ch)

Peter Krempa pkrempa at redhat.com
Thu Jan 19 08:23:42 UTC 2017


On Wed, Jan 18, 2017 at 18:52:51 -0500, John Ferlan wrote:
> 
> 
> On 01/18/2017 01:47 PM, Peter Krempa wrote:
> > The file became a garbage dump for all kinds of utility functions over
> > time. Move them to a separate file so that the files can become a clean
> > interface for the storage backends.
> > ---
> >  po/POTFILES.in                         |    1 +
> >  src/Makefile.am                        |    3 +-
> >  src/storage/storage_backend.c          | 2954 +-------------------------------
> >  src/storage/storage_backend.h          |  125 --
> >  src/storage/storage_backend_disk.c     |    1 +
> >  src/storage/storage_backend_fs.c       |    1 +
> >  src/storage/storage_backend_gluster.c  |    1 +
> >  src/storage/storage_backend_iscsi.c    |    1 +
> >  src/storage/storage_backend_logical.c  |    1 +
> >  src/storage/storage_backend_mpath.c    |    1 +
> >  src/storage/storage_backend_rbd.c      |    1 +
> >  src/storage/storage_backend_scsi.c     |    1 +
> >  src/storage/storage_backend_sheepdog.c |    1 +
> >  src/storage/storage_backend_zfs.c      |    1 +
> >  src/storage/storage_driver.c           |    1 +
> >  src/storage/storage_util.c             | 2919 +++++++++++++++++++++++++++++++
> >  src/storage/storage_util.h             |  149 ++
> >  tests/storagevolxml2argvtest.c         |    2 +-
> >  18 files changed, 3117 insertions(+), 3047 deletions(-)
> >  create mode 100644 src/storage/storage_util.c
> >  create mode 100644 src/storage/storage_util.h
> > 
> 
> Rather than adding #include "storage_util.h", why not add it to
> src/storage/storage_backend.h since that's included by all that need it.
> IDC either way.

That include is going to be dropped soon in the patch that I did not
send yet. storage_backend.h will become the interface where storage
backends are registered/loaded. The point of this patch was to actually
allow this by moving the utility code one layer dow, so that this file
becomes clean.

> 
> While looking at what includes storage_backend.h I note that
> *_mpath.{ch} both include storage_backend.h, but *_mpath.c doesn't
> include *_mpath.h. It's the only one...

That one will be fixed as well by the upcoming patch, since it will add
public API of all the storage drivers to register themselves.

> 
> ACK -

Thanks.
-------------- 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/20170119/1418197e/attachment-0001.sig>


More information about the libvir-list mailing list