[libvirt] [PATCH 2/3] storage: Create common file/dir pool backend helpers

Roman Bogorodskiy bogorodskiy at gmail.com
Thu Jan 26 16:39:07 UTC 2017


  John Ferlan wrote:

> Move some pool functions to storage_util to create local/common helpers
> using the same naming syntax as the existing upload, download, and wipe
> virStorageBackend*Local API's.
> 
> In the process of doing so, found a few API's that can now become local
> to storage_util. In order to distinguish between local/external - I
> changed the names of the now local only ones from "virStorageBackend..."
> to just "storageBackend..."
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/storage/storage_backend_fs.c | 383 ++---------------------------------
>  src/storage/storage_util.c       | 420 ++++++++++++++++++++++++++++++++++++---
>  src/storage/storage_util.h       |  37 ++--
>  3 files changed, 432 insertions(+), 408 deletions(-)
> 
> diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c

...

> +int
> +virStorageBackendUmountLocal(virStoragePoolObjPtr pool)
> +{
> +    int ret = -1;
> +    virCommandPtr cmd = virCommandNewArgList(UMOUNT, pool->def->target.path,
> +                                             NULL);
> +
> +    if (virCommandRun(cmd, NULL) < 0)
> +        goto cleanup;
> +
> +    ret = 0;
> +
> + cleanup:
> +    virCommandFree(cmd);
> +    return ret;
> +}

This fails to build if the fs storage backend is not enabled:

gmake[3]: Entering directory '/usr/home/novel/code/libvirt/src'
  CC       storage/libvirt_driver_storage_impl_la-storage_util.lo
storage/storage_util.c:2810:46: error: use of undeclared identifier 'UMOUNT'
    virCommandPtr cmd = virCommandNewArgList(UMOUNT, pool->def->target.path,
                                             ^
1 error generated.
gmake[3]: *** [Makefile:9325: storage/libvirt_driver_storage_impl_la-storage_util.lo] Error 1

Because UMOUNT is only checked in m4/virt-storage-fs.m4. So I guess it
either needs to be moved back to storage_backend_fs.c (which is unlikely
because I guess you moved that for a reason) or the UMOUNT check moved
to some more generic place.

Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170126/5a066feb/attachment-0001.sig>


More information about the libvir-list mailing list