meson: Require that both qemu_user and qemu_group are provided

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>
This commit is contained in:
Andrea Bolognani 2022-01-26 15:14:13 +01:00
parent 46b5fbd1fe
commit 00c1a47914

View File

@ -1683,10 +1683,13 @@ if not get_option('driver_qemu').disabled()
endif endif
endif endif
qemu_user = get_option('qemu_user') 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 == '' if qemu_user == ''
qemu_user = default_qemu_user qemu_user = default_qemu_user
endif endif
qemu_group = get_option('qemu_group')
if qemu_group == '' if qemu_group == ''
qemu_group = default_qemu_group qemu_group = default_qemu_group
endif endif