[libvirt PATCH 4/5] meson: Require that both qemu_user and qemu_group are provided

Andrea Bolognani posted 5 patches 4 years ago
There is a newer version of this series
[libvirt PATCH 4/5] meson: Require that both qemu_user and qemu_group are provided
Posted by Andrea Bolognani 4 years ago
Or that neither is. The current implementation, where if only
one of the two is provided the other one will be based on
OS-specific defaults is more likely to cause confusion than it
is to be helpful.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 meson.build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index f08a25f53c..36ebe9aa2a 100644
--- a/meson.build
+++ b/meson.build
@@ -1680,10 +1680,13 @@ if not get_option('driver_qemu').disabled()
       endif
     endif
     qemu_user = get_option('qemu_user')
+    qemu_group = get_option('qemu_group')
+    if (qemu_user == '' and qemu_group != '') or (qemu_user != '' and qemu_group == '')
+      error('Please specify both qemu_user and qemu_group or neither of them')
+    endif
     if qemu_user == ''
       qemu_user = default_qemu_user
     endif
-    qemu_group = get_option('qemu_group')
     if qemu_group == ''
       qemu_group = default_qemu_group
     endif
-- 
2.34.1

Re: [libvirt PATCH 4/5] meson: Require that both qemu_user and qemu_group are provided
Posted by Pavel Hrdina 4 years ago
On Wed, Jan 26, 2022 at 04:13:15PM +0100, Andrea Bolognani wrote:
> Or that neither is. The current implementation, where if only
> one of the two is provided the other one will be based on
> OS-specific defaults is more likely to cause confusion than it
> is to be helpful.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  meson.build | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>