From nobody Mon Feb 9 19:55:40 2026 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=1617980663; cv=none; d=zohomail.com; s=zohoarc; b=m7uhf3vTpUEllNvv1rceJAH5f7x9iq1td97dOO5wMSjYffxgMVQewplZvab7R8opIS8jV2KtFvCKdCbxpK7Fqdb5T8N2uXXzwvKlvoxOi2uJ3wmqQuFWk3G+kJdI3sGL8wUI72jpRaTQYJUT/15sH26r+/SO8IPtDCnYm4JjMnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617980663; 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=DhSXYcjDUGcKWmbQ8/SW9T4LYwEFzIU24vxQtt60OgA=; b=L1pa7OwfP7Uk1RqpUANKe4lMv+TkSKnaZ5Am/xvHiJUFv1pdV5pfD1eRwZelAO0+cQ5Exo9fOe413b1OJeaf3X2Bk6QB0uyHcdXIpZ6sws1GePSsqvkp2hODsUQQ6Y3LBAQigcv+4RPtN0Lmy8GhwzSS0DoZLJar3OsZDqq81Ts= 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) header.from= 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 1617980659076523.3001470771574; Fri, 9 Apr 2021 08:04:19 -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-150-hfX8eKEAOBKsxJT8s93LEA-1; Fri, 09 Apr 2021 11:00:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E6E6100A618; Fri, 9 Apr 2021 15:00:22 +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 5ACD65D6AB; Fri, 9 Apr 2021 15:00:22 +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 021BE1806D17; Fri, 9 Apr 2021 15:00:22 +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 139EvhNn023801 for ; Fri, 9 Apr 2021 10:57:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id DCFB414106; Fri, 9 Apr 2021 14:57:43 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 477E160D79 for ; Fri, 9 Apr 2021 14:57:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617980651; 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=DhSXYcjDUGcKWmbQ8/SW9T4LYwEFzIU24vxQtt60OgA=; b=SCfGsnctQJG/nHUzddo/HCZx6+uJv8LjoyyZ7vI1q1gR0C7pDcrhOnT+QSVSgwvCcP4Kws uSDa/5sWinsq1hR8XXr6ABtCocVbc1WOyAD8feoQm2POR15FQPucEU+xkpHvngh9No0fvI d6qZOr3xAZW7Ojm7RI80OOeJVLfdvtc= X-MC-Unique: hfX8eKEAOBKsxJT8s93LEA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 15/43] virQEMUCapsInitQMPVersionCaps: Remove unneeded version checks Date: Fri, 9 Apr 2021 16:56:51 +0200 Message-Id: <3305b414d63415b00847494ae85848b7216592e6.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.15 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" Now that minimum supported qemu version is 2.11, we can remove the conditions. Note that the check enabling QEMU_CAPS_TCG was for < 2.10. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 65 +++++++++--------------------------- 1 file changed, 15 insertions(+), 50 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ec5fcc72b5..f5d72e3ef0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5067,66 +5067,31 @@ virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps) static void virQEMUCapsInitQMPVersionCaps(virQEMUCapsPtr qemuCaps) { - if (qemuCaps->version >=3D 1006000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); - - /* vmport option is supported v2.2.0 onwards */ - if (qemuCaps->version >=3D 2002000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_VMPORT_OPT); + /* Following caps were asserted by a version check for pre 2.11 qemus = */ + virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_VMPORT_OPT); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_VHOSTUSER_MULTIQUEUE); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_SMM_OPT); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_SDL_GL); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACH_VIRT_GIC_VERSION); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_EGL_HEADLESS); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_NUMA_DIST); /* -cpu ...,aarch64=3Doff supported in v2.3.0 and onwards. But it isn't detectable via qmp at this point */ - if (qemuCaps->arch =3D=3D VIR_ARCH_AARCH64 && - qemuCaps->version >=3D 2003000) + if (qemuCaps->arch =3D=3D VIR_ARCH_AARCH64) virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_AARCH64_OFF); - /* vhost-user supports multi-queue from v2.4.0 onwards, - * but there is no way to query for that capability */ - if (qemuCaps->version >=3D 2004000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_VHOSTUSER_MULTIQUEUE); - - /* smm option is supported from v2.4.0 */ - if (qemuCaps->version >=3D 2004000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_SMM_OPT); - - /* sdl -gl option is supported from v2.4.0 (qemu commit id 0b71a5d5) */ - if (qemuCaps->version >=3D 2004000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_SDL_GL); - - /* Since 2.4.50 ARM virt machine supports gic-version option */ - if (qemuCaps->version >=3D 2004050) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - - /* no way to query if -machine kernel_irqchip supports split */ - if (qemuCaps->version >=3D 2006000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT); - - /* HPT resizing is supported since QEMU 2.10 on ppc64; unfortunately - * there's no sane way to probe for it */ - if (qemuCaps->version >=3D 2010000 && - ARCH_IS_PPC64(qemuCaps->arch)) { + if (ARCH_IS_PPC64(qemuCaps->arch)) { + /* HPT resizing is supported since QEMU 2.10 on ppc64; unfortunate= ly + * there's no sane way to probe for it */ virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); - } - - /* '-display egl-headless' cmdline option is supported since QEMU 2.10= , but - * there's no way to probe it */ - if (qemuCaps->version >=3D 2010000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_EGL_HEADLESS); - /* no way to query for -numa dist */ - if (qemuCaps->version >=3D 2010000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_NUMA_DIST); - - /* no way to query max-cpu-compat */ - if (qemuCaps->version >=3D 2010000 && - ARCH_IS_PPC64(qemuCaps->arch)) { + /* no way to query max-cpu-compat */ virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT); } - /* TCG couldn't be disabled nor queried until QEMU 2.10 */ - if (qemuCaps->version < 2010000) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_TCG); - /* -enable-fips is deprecated in QEMU 5.2.0, and QEMU * should be built with gcrypt to achieve FIPS compliance * automatically / implicitly --=20 2.30.2