[PATCH v2] meson: build vstorage only on linux

Nikolay Shirokovskiy posted 1 patch 3 years, 2 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1611073902-306752-1-git-send-email-nshirokovskiy@virtuozzo.com
meson.build | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
[PATCH v2] meson: build vstorage only on linux
Posted by Nikolay Shirokovskiy 3 years, 2 months ago
This should fix CI error:

    ../dist-unpack/libvirt-7.1.0/src/storage/storage_backend_vstorage.c:10:10: fatal error: 'mntent.h' file not found
    #include <mntent.h>
    ^~~~~~~~~~

on freebsd and mac.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
---
 meson.build | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index e3e7ff7..d8a63ba 100644
--- a/meson.build
+++ b/meson.build
@@ -1957,8 +1957,19 @@ if conf.has('WITH_LIBVIRTD')
   endif
 
   if not get_option('storage_vstorage').disabled()
-    use_storage = true
-    conf.set('WITH_STORAGE_VSTORAGE', 1)
+    vstorage_enable = true
+    if host_machine.system() != 'linux'
+      if get_option('storage_fs').enabled()
+        error('Vstorage is supported only on Linux')
+      else
+        vstorage_enable = false
+      endif
+    endif
+
+    if vstorage_enable
+      use_storage = true
+      conf.set('WITH_STORAGE_VSTORAGE', 1)
+    endif
   endif
 
   if not get_option('storage_zfs').disabled()
-- 
1.8.3.1

Re: [PATCH v2] meson: build vstorage only on linux
Posted by Daniel P. Berrangé 3 years, 2 months ago
On Tue, Jan 19, 2021 at 07:31:42PM +0300, Nikolay Shirokovskiy wrote:
> This should fix CI error:
> 
>     ../dist-unpack/libvirt-7.1.0/src/storage/storage_backend_vstorage.c:10:10: fatal error: 'mntent.h' file not found
>     #include <mntent.h>
>     ^~~~~~~~~~
> 
> on freebsd and mac.
> 
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
> ---
>  meson.build | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|