From nobody Mon May 6 06:20:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1600977928; cv=none; d=zohomail.com; s=zohoarc; b=Yq4CH/4+IklQ1fIblTYUwY9NHUA1TQnLgUJAR3TBYqSPbUlkzwtWo3/hz/6lO+/eEXJFJG9tp92lY8JOWIU2QADUM3byAzBW5ItxRoMvcAUxI668UzODq5pJfqixl7eVwP6tl7AbtBTQZwDKWcOM4HTuw+uYe4MOeWsF7nk/IEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600977928; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ZtVvTSJmA263cK/H7DVlaKMZTF9tUFsNklHgQXOox+Q=; b=gKOOqmU9wUYprKl5SvLnCW6Fy2+0qcgLE4Yl9B4u9Nxai6nJSeLePBtVQ/jtxdn4a+Zzsf//Wy7E8bznPdAs15eYXC543X3WtqrFqGsjaMQE889GsI+HfGmWhYM+oGA9a3RUOeDlRyl2CGhNjfjMmvUkApJit/A1q0yWTyYkkP8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600977928188288.08583961427144; Thu, 24 Sep 2020 13:05:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-aTO76PipOTWOlIYvk4jsAQ-1; Thu, 24 Sep 2020 16:05:23 -0400 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 2616010BBECE; Thu, 24 Sep 2020 20:05:15 +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 64A811002C05; Thu, 24 Sep 2020 20:05:14 +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 666AC8C7A4; Thu, 24 Sep 2020 20:05:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08OK5BBF009237 for ; Thu, 24 Sep 2020 16:05:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5EC35110E9F; Thu, 24 Sep 2020 20:05:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5337D115E16 for ; Thu, 24 Sep 2020 20:05:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA1ED800296 for ; Thu, 24 Sep 2020 20:05:08 +0000 (UTC) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-TamFiRXPMnqxxxGC5O5y_A-1; Thu, 24 Sep 2020 16:05:05 -0400 Received: by mail-qk1-f195.google.com with SMTP id o5so679231qke.12 for ; Thu, 24 Sep 2020 13:05:05 -0700 (PDT) Received: from f32-ryo-ohki-winvm.datto.lan (ool-18e49371.dyn.optonline.net. [24.228.147.113]) by smtp.gmail.com with ESMTPSA id c1sm476526qta.86.2020.09.24.13.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 13:05:03 -0700 (PDT) X-MC-Unique: aTO76PipOTWOlIYvk4jsAQ-1 X-MC-Unique: TamFiRXPMnqxxxGC5O5y_A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZtVvTSJmA263cK/H7DVlaKMZTF9tUFsNklHgQXOox+Q=; b=rNagihMPsy56lC2cWUe1vYaKKODyGlApljFtfFxN6lgzkZIWgXhu5pIW3ZLMYxED+O ZCZZvSArC4bxCeMX7v3uf+DJOgSeQGFrH7gPrHzfUVXiFlJKbjoBa8qthSL9W/gF9GKj U0w9Y9RWOEBmj0PFUOJT/gMoBXvqbFcOGfiIi31xj0jOVWjjG8Y9BNZV71tKZPPeVgJn h3TnFTOTq1TuTShhwiu13Df8cSomJJqj+yY9fusjU07c9KSjusw2Ne/u9+prcidnzUod I8J5m86dGTecVtUWFoedZkXiukfkNA2xrzDR/rAA/8NlZFxvtwudxHSq5ujNTfhSMPq9 t0Tw== X-Gm-Message-State: AOAM531QpkEWqWRgTkKASNZILoGpuvwpK0Nvl8dUks0B4d9jIn83IsyR 4O3w8r3/A62lS8xKc8/RiJa2E7a8B0viTuD6 X-Google-Smtp-Source: ABdhPJzfsHmiOSIAk3xrYqWN9BHXOE7Yks2XADxIhoD5GdIeWTBaqZQsU68NQJJLNRWpmUWuWiWQkg== X-Received: by 2002:a37:c88:: with SMTP id 130mr800890qkm.67.1600977904183; Thu, 24 Sep 2020 13:05:04 -0700 (PDT) From: Neal Gompa To: libvir-list@redhat.com Subject: [PATCH] rpm: Simplify qemu+kvm conditionals and eliminate duplication Date: Thu, 24 Sep 2020 16:04:38 -0400 Message-Id: <20200924200438.92820-1-ngompa13@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Neal Gompa 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 Content-Type: text/plain; charset="utf-8" The conditionals for enabling qemu+kvm were unnecessarily complex. In practice, there were far fewer cases where the functionality would be disabled than what the conditional logic expressed, and this change simplifies it to the realistic set of options. Signed-off-by: Neal Gompa --- libvirt.spec.in | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index c4a7c30737..6940066de9 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -20,31 +20,12 @@ =20 %define with_qemu_tcg %{with_qemu} =20 -%define qemu_kvm_arches %{ix86} x86_64 - -%if 0%{?fedora} - %define qemu_kvm_arches %{ix86} x86_64 %{power64} s390x %{arm} aarch64 -%endif - -%if 0%{?rhel} - %define with_qemu_tcg 0 - %define qemu_kvm_arches x86_64 %{power64} aarch64 s390x -%endif - # On RHEL 7 and older macro _vpath_builddir is not defined. %if 0%{?rhel} && 0%{?rhel} <=3D 7 %define _vpath_builddir %{_target_platform} %endif =20 -%ifarch %{qemu_kvm_arches} - %define with_qemu_kvm %{with_qemu} -%else - %define with_qemu_kvm 0 -%endif - -%if ! %{with_qemu_tcg} && ! %{with_qemu_kvm} - %define with_qemu 0 -%endif +%define with_qemu_kvm %{with_qemu} =20 # Then the hypervisor drivers that run outside libvirtd, in libvirt.so %define with_openvz 0%{!?_without_openvz:1} @@ -61,12 +42,6 @@ %endif =20 %define with_storage_gluster 0%{!?_without_storage_gluster:1} -%ifnarch %{qemu_kvm_arches} - # gluster is only built where qemu driver is enabled on RHEL 8 - %if 0%{?rhel} >=3D 8 - %define with_storage_gluster 0 - %endif -%endif =20 %define with_numactl 0%{!?_without_numactl:1} =20 @@ -97,6 +72,11 @@ =20 # Finally set the OS / architecture specific special cases =20 +# KVM is available on most architectures +%ifnarch %{ix86} x86_64 %{power64} s390x %{arm} aarch64 + %define with_qemu_kvm 0 +%endif + # Xen is available only on i386 x86_64 ia64 %ifnarch %{ix86} x86_64 ia64 %define with_libxl 0 @@ -122,6 +102,23 @@ %define with_storage_rbd 0 %endif =20 +# RHEL does not ship qemu-tcg +%if 0%{?rhel} + %define with_qemu_tcg 0 +%endif + +# In the event that qemu-tcg and qemu-kvm are unavailable, don't ship qemu +%if ! %{with_qemu_tcg} && ! %{with_qemu_kvm} + %define with_qemu 0 +%endif + +%if ! %{with_qemu_kvm} + # gluster is only built where qemu driver is enabled on RHEL 8 + %if 0%{?rhel} >=3D 8 + %define with_storage_gluster 0 + %endif +%endif + # RHEL doesn't ship OpenVZ, VBox, PowerHypervisor, # VMware, libxenlight (Xen 4.1 and newer), # or HyperV. --=20 2.26.2