From nobody Tue Feb 10 00:22:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1643210052; cv=none; d=zohomail.com; s=zohoarc; b=VBhnndoSwpZjDuC7kHiYzeFQOqyUriAq/uwaZdMh1FKLi1CqHbiXg2Gp2S825K0HPIg+H6OB7YDWaUumrFNKyCSIV240ANyvhsk0jQN7XtWtRXgjwD9LA6TPOwrVS8+fE8AWupdieKdjR07C9v+VWRthKI/5XPtI/33qdi/1910= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643210052; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RLLESKlpOUSahkOF1iXZNHxyvdaPbdbjCidbOhJ9VNc=; b=n+QuToJCSmIskuMIRMTRQdNyYc9B9ED/4PFHA1fBScoYjJa8mO3wptzybvV0BnpK1Mn1x79seq0HeK88p2MpnaQLdP4lc1FRwm+X720rYwUdsGlHZM33QnY/l+jZmBe47ShthQ/7BrY+mcK+K2l53OxLWHL8LA/waDX+t5oGR90= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 164321005245375.52203469409142; Wed, 26 Jan 2022 07:14:12 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-481-GIdHVSMdO-iELDb2p-RrQg-1; Wed, 26 Jan 2022 10:13:59 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 201F68519F2; Wed, 26 Jan 2022 15:13:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAFBA1091EF4; Wed, 26 Jan 2022 15:13:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B9CA14A7CB; Wed, 26 Jan 2022 15:13:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20QFDPAQ016874 for ; Wed, 26 Jan 2022 10:13:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1721323763; Wed, 26 Jan 2022 15:13:25 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.193.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70AD623764 for ; Wed, 26 Jan 2022 15:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643210051; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RLLESKlpOUSahkOF1iXZNHxyvdaPbdbjCidbOhJ9VNc=; b=eqIDrVRPaX2/+X7w6GgkOE3Y865C+eKMAU1NGskIbPWnJyW+nqIsT8sKUz9yOvX6JXi1Cs cv0Fmhr8xQwM3kxyj7c2FE6VMg/nAqFsoSoXwVg3Bk7+L51fpZq9V9DZPeuBPG3XdyQAYZ XO9shHDPNRFT1UVy68V/WrQ1EHXiFVc= X-MC-Unique: GIdHVSMdO-iELDb2p-RrQg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] meson: Optimize handling of qemu_user and qemu_group Date: Wed, 26 Jan 2022 16:13:16 +0100 Message-Id: <20220126151316.26825-6-abologna@redhat.com> In-Reply-To: <20220126151316.26825-1-abologna@redhat.com> References: <20220126151316.26825-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643210053733100001 Content-Type: text/plain; charset="utf-8" If the user has already provided us with the configuration they want, there's no point in trying to come up with a reasonable OS-specific default. Suggested-by: Olaf Hering Signed-off-by: Andrea Bolognani --- meson.build | 54 +++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/meson.build b/meson.build index 36ebe9aa2a..0e35d64fd1 100644 --- a/meson.build +++ b/meson.build @@ -1655,40 +1655,36 @@ if not get_option('driver_qemu').disabled() endif conf.set_quoted('QEMU_DATADIR', qemu_datadir) =20 - if host_machine.system() in [ 'freebsd', 'darwin' ] - default_qemu_user =3D 'root' - default_qemu_group =3D 'wheel' - else - os_release =3D run_command('grep', '-E', '^ID(_LIKE)*=3D', '/etc/os-= release', check: false).stdout() - if os_release.contains('arch') - default_qemu_user =3D 'nobody' - default_qemu_group =3D 'nobody' - elif (os_release.contains('fedora') or - os_release.contains('gentoo') or - os_release.contains('suse')) - default_qemu_user =3D 'qemu' - default_qemu_group =3D 'qemu' - elif os_release.contains('ubuntu') - default_qemu_user =3D 'libvirt-qemu' - default_qemu_group =3D 'kvm' - elif os_release.contains('debian') - default_qemu_user =3D 'libvirt-qemu' - default_qemu_group =3D 'libvirt-qemu' - else - default_qemu_user =3D 'root' - default_qemu_group =3D 'root' - endif - endif qemu_user =3D get_option('qemu_user') qemu_group =3D get_option('qemu_group') if (qemu_user =3D=3D '' and qemu_group !=3D '') or (qemu_user !=3D '' = and qemu_group =3D=3D '') error('Please specify both qemu_user and qemu_group or neither of th= em') endif - if qemu_user =3D=3D '' - qemu_user =3D default_qemu_user - endif - if qemu_group =3D=3D '' - qemu_group =3D default_qemu_group + if qemu_user =3D=3D '' and qemu_group =3D=3D '' + if host_machine.system() in [ 'freebsd', 'darwin' ] + qemu_user =3D 'root' + qemu_group =3D 'wheel' + else + os_release =3D run_command('grep', '-E', '^ID(_LIKE)*=3D', '/etc/o= s-release', check: false).stdout() + if os_release.contains('arch') + qemu_user =3D 'nobody' + qemu_group =3D 'nobody' + elif (os_release.contains('fedora') or + os_release.contains('gentoo') or + os_release.contains('suse')) + qemu_user =3D 'qemu' + qemu_group =3D 'qemu' + elif os_release.contains('ubuntu') + qemu_user =3D 'libvirt-qemu' + qemu_group =3D 'kvm' + elif os_release.contains('debian') + qemu_user =3D 'libvirt-qemu' + qemu_group =3D 'libvirt-qemu' + else + qemu_user =3D 'root' + qemu_group =3D 'root' + endif + endif endif conf.set_quoted('QEMU_USER', qemu_user) conf.set_quoted('QEMU_GROUP', qemu_group) --=20 2.34.1