From nobody Sun Apr 28 15:27:55 2024 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=1643210060; cv=none; d=zohomail.com; s=zohoarc; b=mVsE/6tNYKYRY5APpSxVU5N0LiIBNgj51fIV9f+jGhURQ3Cu/gU8a6W8OU93tKkum8Tl7W4vhN2tROHjYJgHmxHMyP5xR/oShufEjT5F2YduslLijhAAf+jT/B0Pl7mCut0vX8wO456R7meOp3TskuKKl9P+HoWZC+a9qc7HM1o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643210060; 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=jkrN5jqfNjgKTDhti1kqny0ScIn3W/0wMjS3qQ1/Wwk=; b=JpXsAbrnEAsGe9MRWGs7e2L2aJfRrRzx1V25EBfCouo3VbhrRh4XOpKGSiKxobH+zMC2Nl9l1rMOkMEyEGg5rxfnVhpAGZ6LJSimrxvjBuRCd3G7CQM05OLHwqLld8T7DDrLBnqyTM+t6wISG+VTQ0fp6DZ5kFk//+xHCWCyGM0= 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 1643210060027605.097833140944; Wed, 26 Jan 2022 07:14:20 -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-201-LxU3ubrXO3-0Ql3aycX12Q-1; Wed, 26 Jan 2022 10:13:49 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CE0931006AAD; Wed, 26 Jan 2022 15:13:25 +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 9B484798B6; Wed, 26 Jan 2022 15:13:25 +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 A89354CA93; Wed, 26 Jan 2022 15:13:23 +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 20QFDKEP016835 for ; Wed, 26 Jan 2022 10:13:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id D928623764; Wed, 26 Jan 2022 15:13:20 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.193.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C9A723763 for ; Wed, 26 Jan 2022 15:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643210059; 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=jkrN5jqfNjgKTDhti1kqny0ScIn3W/0wMjS3qQ1/Wwk=; b=N2DUtc7IZB7hN44T8++K++ClOQ2wV6hpU60Ci+UwR3loC+sF8KZAflrg8qhQ2dgjBmGS0p xQWUIt7AnT9HGHFkTiM/kxWOJgY1duDsm23nhmW+U4B9NZ4ovC0o1ZqQBx11pgV2r2US6S DQVQ/LKt1m/zqsOy5uQ+O8ITokLICQY= X-MC-Unique: LxU3ubrXO3-0Ql3aycX12Q-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] meson: Don't require /etc/os-release to be present Date: Wed, 26 Jan 2022 16:13:12 +0100 Message-Id: <20220126151316.26825-2-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.79 on 10.5.11.14 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: 1643210062263100001 Content-Type: text/plain; charset="utf-8" It might be part of some non-mandatory package on certain distros, and our logic deals just fine with its contents not being available. Fixes: 4c69d64efa3731d074d198f871fd42e74c4a39f6 Reported-by: Olaf Hering Signed-off-by: Andrea Bolognani --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 0f0a71a2da..ab5f7433a6 100644 --- a/meson.build +++ b/meson.build @@ -1659,7 +1659,7 @@ if not get_option('driver_qemu').disabled() default_qemu_user =3D 'root' default_qemu_group =3D 'wheel' else - os_release =3D run_command('grep', '^ID=3D', '/etc/os-release', chec= k: true).stdout() + os_release =3D run_command('grep', '^ID=3D', '/etc/os-release', chec= k: false).stdout() if os_release.contains('arch') default_qemu_user =3D 'nobody' default_qemu_group =3D 'nobody' --=20 2.34.1 From nobody Sun Apr 28 15:27:55 2024 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=1643210039; cv=none; d=zohomail.com; s=zohoarc; b=hgCK8gytkVydRbFxWHy4/zCCQSRt2Yk1ZxDMolUD+OcVrSUPgscZVKTv7+2ZiFzFickOMIsbvOihQJw37AuJgLX1n27hgBWuZmTyr0W54ttrRkxOiSG818RVBoOpI1p54+4pmT6TqqyQQ3LW5P/RQsD4LSON2IAtLzIzgavYiC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643210039; 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=A+TWzPnicLQJOMvgvoO6dZG4zvSg3GauxF28oaJ/Mi4=; b=JPAAamTQJ2pEEe8v9dlSpHsfNes/RpWyJWCEGmn/A/QgZp5+2XQEDuaRzQkCWcxy/Fryx1nZeKJnCNVmegzKq8Xg9JMviOgMgmfUwlFl2asTsIAffRbxENzhoZxagRXYW50F1DXnHkKoK7+b1/snzsoID/RTbr/XPdAZU9BZ4GU= 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 1643210039943862.8597905814476; Wed, 26 Jan 2022 07:13:59 -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-659-v-dFe8UUOc-1lqWaRM5cfQ-1; Wed, 26 Jan 2022 10:13:53 -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 E6FDD196632C; Wed, 26 Jan 2022 15:13:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E5FF1091EF4; Wed, 26 Jan 2022 15:13:25 +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 9011E1809CB9; Wed, 26 Jan 2022 15:13:23 +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 20QFDLO9016844 for ; Wed, 26 Jan 2022 10:13:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id E500423764; Wed, 26 Jan 2022 15:13:21 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.193.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A92623763 for ; Wed, 26 Jan 2022 15:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643210039; 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=A+TWzPnicLQJOMvgvoO6dZG4zvSg3GauxF28oaJ/Mi4=; b=ezxXtwHkbtrTzqMkuZBBpM9kz0qsRrg5i8eF3kzIlmoFUZe7mSYcP7F6G6Y8GENMQseIHt zOEGbafSFD9hRGIR10I6zugQ6hcw1l6wsCjFcBW7JEdeyZ3iQfZGnRsIJB/qmk2FTYMepw /COs02JwKquXg0Ts1WZP8b8IL+Vd0Fw= X-MC-Unique: v-dFe8UUOc-1lqWaRM5cfQ-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/5] meson: Check for os-release's ID_LIKE in addition to ID Date: Wed, 26 Jan 2022 16:13:13 +0100 Message-Id: <20220126151316.26825-3-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: 1643210042130100001 Content-Type: text/plain; charset="utf-8" This makes is possible to reduce the number of cases we have to consider, because 'sles' declares itself to be like 'suse' and both 'rhel' and 'centos' declare themselves to be like 'fedora'. We have to move the check for Ubuntu before the one for Debian, however, because 'ubuntu' declares itself to be like 'debian' and it would end up with the wrong defaults otherwise. Suggested-by: Olaf Hering Signed-off-by: Andrea Bolognani --- meson.build | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index ab5f7433a6..388e2cfa5e 100644 --- a/meson.build +++ b/meson.build @@ -1659,24 +1659,21 @@ if not get_option('driver_qemu').disabled() default_qemu_user =3D 'root' default_qemu_group =3D 'wheel' else - os_release =3D run_command('grep', '^ID=3D', '/etc/os-release', chec= k: false).stdout() + 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('centos') or - os_release.contains('fedora') or + elif (os_release.contains('fedora') or os_release.contains('gentoo') or - os_release.contains('rhel') or - os_release.contains('sles') or os_release.contains('suse')) default_qemu_user =3D 'qemu' default_qemu_group =3D 'qemu' - elif os_release.contains('debian') - default_qemu_user =3D 'libvirt-qemu' - default_qemu_group =3D 'libvirt-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' --=20 2.34.1 From nobody Sun Apr 28 15:27:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1643210041; cv=none; d=zohomail.com; s=zohoarc; b=PxU4cYDrBNW6M+jdKLIB1dANxCmG0q4RDTtHDkJqlGoWU+XUAWrtKyL1b/aKic8NdQ5yvheqTrIgAcKne2/uC1FzTY491/srGSfpJIh8YXKtx7rRddGb8YPilJe7p04TAPqpXT57r3Y8NLYqYqtzo+ThtUcTFSAdMZzNRF89gsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643210041; 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=xHU5LTTD10J0C/+eiHAZRxELsp1EhfywnAauaRlBPro=; b=be0QmkgXO89XS+LlzuaoQyBxq2yLyk8CGVOoEzbVaEM5CQODDtEhroRKZbZ/44C4ZOjngy/KwmdRTRuJ1h95Wngci+torDQl3q6L5beti431jnuNfoTYNf++o4NkujW8yFrOpMz8DYhcYQz4gjefj1FKJLp5xUtQSxW0LaSLDmI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1643210041736897.5679040729578; Wed, 26 Jan 2022 07:14:01 -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-286-1VPt3ifUP0Sfscfu6VCr3w-1; Wed, 26 Jan 2022 10:13:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E06921966329; Wed, 26 Jan 2022 15:13:39 +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 BA5CB23767; 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 87EDC4A7C8; 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 20QFDMIZ016851 for ; Wed, 26 Jan 2022 10:13:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id F1A1323763; Wed, 26 Jan 2022 15:13:22 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.193.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 569FE23764 for ; Wed, 26 Jan 2022 15:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643210041; 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=xHU5LTTD10J0C/+eiHAZRxELsp1EhfywnAauaRlBPro=; b=Fu3chFFL1Qi6roKdEawDJTNdG1k3xak5TQ/QaiUAoZXk3GKdqsD4ixd3Fj8CObVHGbJvU3 FHngzBx0baQ3bMnABq29JJBe0+T7j3mUiJ+GNuU+M/z+GKDAFLyqV668AZZ4v0bux3nw7j 4wduIeTf1C6BX5cHOiANyq/HjABc7Uo= X-MC-Unique: 1VPt3ifUP0Sfscfu6VCr3w-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 3/5] meson: Don't check whether qemu_user and qemu_group exist Date: Wed, 26 Jan 2022 16:13:14 +0100 Message-Id: <20220126151316.26825-4-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.23 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: 1643210044839100001 Content-Type: text/plain; charset="utf-8" QEMU might not be installed on the build system, in which case the user and group will not be present. We should avoid falling back to root:root in that case, and assume the user and group are going to be present in the target system instead. Suggested-by: Olaf Hering Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- meson.build | 8 -------- 1 file changed, 8 deletions(-) diff --git a/meson.build b/meson.build index 388e2cfa5e..f08a25f53c 100644 --- a/meson.build +++ b/meson.build @@ -1678,14 +1678,6 @@ if not get_option('driver_qemu').disabled() default_qemu_user =3D 'root' default_qemu_group =3D 'root' endif - # If the expected user and group don't exist, or we haven't hit any - # of the cases above bacuse we're running on an unknown OS, the only - # sensible fallback is root:root - if (run_command('getent', 'passwd', default_qemu_user, check: false)= .returncode() !=3D 0 and - run_command('getent', 'group', default_qemu_group, check: false)= .returncode() !=3D 0) - default_qemu_user =3D 'root' - default_qemu_group =3D 'root' - endif endif qemu_user =3D get_option('qemu_user') if qemu_user =3D=3D '' --=20 2.34.1 From nobody Sun Apr 28 15:27:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1643210044; cv=none; d=zohomail.com; s=zohoarc; b=f3dWDW83lQX5P4gBgQemOFHhGBVmMQPbQ94en0TfGcDjZt9upJANhdMwIaTE0vSR8U5EKTF9Gw9DPbCOvAtDBu1qZbvO/BJXwnY5h45rK0P0rxy3o1W2chlvVw0JDO7S4D3yerI1JCLAZ8a1Jed/cspcWtM7DD/MMG/Glil7340= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643210044; 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=a/WK76h/aDweM5TR7e28wdWfTfeHTPQ0+qiqACiSZ4s=; b=Gddmcjg7Dmoqc4qPZ03iXOwlEIPIYRt826JoY+1NGmcdWexPTEb7lSQuvu3RUpwvYUmn7rCpeCpdfPn3yKogA1y+jAuAHh+3KiXje4WkSZocPPCuQClYOTVw3rBAp7FIiql/29IayaPt4MqOfg1yhi6ThQYU3LbHAw8pxja6aL0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1643210044566651.7609694704436; Wed, 26 Jan 2022 07:14:04 -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-190-H2Is3rbvO1WtH3m_fNibaw-1; Wed, 26 Jan 2022 10:14:00 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6A7EA1083F9B; Wed, 26 Jan 2022 15:13:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 507D223765; Wed, 26 Jan 2022 15:13:43 +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 128CF1809CBF; Wed, 26 Jan 2022 15:13:43 +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 20QFDOwA016861 for ; Wed, 26 Jan 2022 10:13:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0A44B23764; Wed, 26 Jan 2022 15:13:24 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.193.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62E3A23763 for ; Wed, 26 Jan 2022 15:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643210043; 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=a/WK76h/aDweM5TR7e28wdWfTfeHTPQ0+qiqACiSZ4s=; b=V4saWKdTay4nM7Q1imdUsWqsZV8tLnu/k9oxov3yXTK8dFh1XlpIt82wXjJ2vwXst8/wpr CvdZeuL8NnE0eOChEGytNKxde27lxwBwfj3cJzrJA3x0tzchFcdoJvPnc1bB7KiXRb3HwT h8JC94YCRLazQwEYc3YtpbgNnoEFE7c= X-MC-Unique: H2Is3rbvO1WtH3m_fNibaw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 4/5] meson: Require that both qemu_user and qemu_group are provided Date: Wed, 26 Jan 2022 16:13:15 +0100 Message-Id: <20220126151316.26825-5-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.23 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: 1643210045433100003 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Pavel Hrdina --- 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 =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 - qemu_group =3D get_option('qemu_group') if qemu_group =3D=3D '' qemu_group =3D default_qemu_group endif --=20 2.34.1 From nobody Sun Apr 28 15:27:55 2024 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