From nobody Mon Feb 9 09:28:57 2026 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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=1617980833; cv=none; d=zohomail.com; s=zohoarc; b=a+JaMrQgzEVGpgMA7hpSliVG6sG3lqK+XLREtA418KD2wU6KJLlLHLjjRVS9QWasKVzw1ktKxAjwRjtea0gWkbdWrtKeArE97yYt/nnB3dc6Sb1wspxe+ZGAUhrS2DGaTHIaOZX7jCKQojdF/fepE+SCKkB9q375rVvrNsUL7ew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617980833; 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=WvCDzLUS1wcVLGIKD+lEHQuH0LcAuxG51QPeCGau5T8=; b=G+RCfZfWxar8IxANUIKowBbWzIOyyEdqng4iKePRY4oVOO0/iWEPR8YMRl+pAhulV4KsRGzAjl3U9h9L8vP7Mj6swiUZsANDH+t7kSDIxQ6iFADsjBbwgdRRNBhKmVHPVFTbF1GZCqUf9Z+neXkgaLldXefCLZeqUjxHo3sBjJc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 1617980832997800.1298897452011; Fri, 9 Apr 2021 08:07:12 -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-277--e1ephEVPYSP9Vybxyv3Cw-1; Fri, 09 Apr 2021 11:01:38 -0400 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 C5CA4100A8FF; Fri, 9 Apr 2021 15:01:16 +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 A402E5D9C0; Fri, 9 Apr 2021 15:01:16 +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 6BF4A5534F; Fri, 9 Apr 2021 15:01:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 139EvjH1023813 for ; Fri, 9 Apr 2021 10:57:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1AB0014106; Fri, 9 Apr 2021 14:57:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5668E60D79 for ; Fri, 9 Apr 2021 14:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617980831; 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=WvCDzLUS1wcVLGIKD+lEHQuH0LcAuxG51QPeCGau5T8=; b=Y/nBHAsYKVsEUupfdf+NdBteT1ZIroeA5O1xcI5NJ7Y/EpCl/whNhZB8wFVBi9VFnLgqUf zN6sWRwgqfU7DhFcwxQTBiIZDJY5vuoeJwtoSkS6ryid+LmZauPIHA2JcoyPJt+F92lKSN c5Luuel75+j86zJa+f+ZDNzwURR5IYY= X-MC-Unique: -e1ephEVPYSP9Vybxyv3Cw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 16/43] virQEMUCapsInitQMPBasicArch: Use switch for arch-based decisions Date: Fri, 9 Apr 2021 16:56:52 +0200 Message-Id: <2a4f6fc495283ff93d3df0e484293cc20074a195.1617979432.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 56 ++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f5d72e3ef0..6ac9f8bcf7 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5046,15 +5046,59 @@ virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps, void virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps) { - /* ACPI only works on x86 and aarch64 */ - if (ARCH_IS_X86(qemuCaps->arch) || - qemuCaps->arch =3D=3D VIR_ARCH_AARCH64) { + switch (qemuCaps->arch) { + case VIR_ARCH_I686: + case VIR_ARCH_X86_64: + /* ACPI only works on x86 and aarch64 */ virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI); - } - /* HPET is x86 specific */ - if (ARCH_IS_X86(qemuCaps->arch)) + /* HPET is x86 specific */ virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_HPET); + break; + + case VIR_ARCH_AARCH64: + /* ACPI only works on x86 and aarch64 */ + virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI); + break; + + case VIR_ARCH_PPC64: + case VIR_ARCH_PPC64LE: + case VIR_ARCH_ALPHA: + case VIR_ARCH_PPC: + case VIR_ARCH_PPCEMB: + case VIR_ARCH_SH4: + case VIR_ARCH_SH4EB: + case VIR_ARCH_RISCV32: + case VIR_ARCH_RISCV64: + case VIR_ARCH_S390: + case VIR_ARCH_S390X: + case VIR_ARCH_SPARC: + case VIR_ARCH_SPARC64: + case VIR_ARCH_ARMV6L: + case VIR_ARCH_ARMV7L: + case VIR_ARCH_ARMV7B: + case VIR_ARCH_CRIS: + case VIR_ARCH_ITANIUM: + case VIR_ARCH_LM32: + case VIR_ARCH_M68K: + case VIR_ARCH_MICROBLAZE: + case VIR_ARCH_MICROBLAZEEL: + case VIR_ARCH_MIPS: + case VIR_ARCH_MIPSEL: + case VIR_ARCH_MIPS64: + case VIR_ARCH_MIPS64EL: + case VIR_ARCH_OR32: + case VIR_ARCH_PARISC: + case VIR_ARCH_PARISC64: + case VIR_ARCH_PPCLE: + case VIR_ARCH_UNICORE32: + case VIR_ARCH_XTENSA: + case VIR_ARCH_XTENSAEB: + case VIR_ARCH_NONE: + case VIR_ARCH_LAST: + default: + break; + } } --=20 2.30.2