]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: Require that both qemu_user and qemu_group are provided
authorAndrea Bolognani <abologna@redhat.com>
Wed, 26 Jan 2022 14:14:13 +0000 (15:14 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 27 Jan 2022 10:48:35 +0000 (11:48 +0100)
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>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
meson.build

index 5d8029a6561a115c846a5c906c056eaa05a4ce20..79c9fedea147b6715db76b712ebfd31c1d67957d 100644 (file)
@@ -1683,10 +1683,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