From nobody Mon Feb 9 10:57:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1618835970; cv=none; d=zohomail.com; s=zohoarc; b=e0E34VDqvWEcld5pwk2EDdkIRIkX286hbPmxheh+4aeeBEucURtwYMQojK3CIty+qBQ5/paofadLu/R/cTBHTeJqaU22J4fGo5OjaJQBVGgw9PMOupTEzGL4O10Q47ppCZ4yXXYJrffL6l5p/uZJvER2nirwHTToAlzQpSc/VSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618835970; 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=BzobTf2gWz8dSkLXtNX5VSXBuM8ZKera7jDimNCX8h0=; b=AlKdBZ3UDTBLk6K89+VEHdw/eF+c7Rfau02ZbQYdbU6UNVyFyTaQEtkVa+7SrcQ2qNc+jwK50n412MLpLIJLF72c8OFQ991KN1KGtvKV/CrPK8z9tkqVy/9YFHp17wbD3kO+WZW3FOJyPiYNGHCJzLpDBpGbmAjStb4306JHXZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1618835970973745.6912045251075; Mon, 19 Apr 2021 05:39:30 -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-598-l3APLJ2GO5-srRLvxN9Rgg-1; Mon, 19 Apr 2021 08:39:27 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5908C6D25B; Mon, 19 Apr 2021 12:39:22 +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 384832BFE6; Mon, 19 Apr 2021 12:39: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 F270A44A63; Mon, 19 Apr 2021 12:39:21 +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 13JCZuAB019057 for ; Mon, 19 Apr 2021 08:35:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6E0C619C66; Mon, 19 Apr 2021 12:35:56 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6BBA19C79 for ; Mon, 19 Apr 2021 12:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618835969; 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=BzobTf2gWz8dSkLXtNX5VSXBuM8ZKera7jDimNCX8h0=; b=gI2ulM80cGpKN7EgHd1SA9+t/ss4vWC27c3jjvM7/IWu7tvPXWesZhccd78f69EOMHxqAJ 9jNc1SVXAmFM+2v60wTlIiv69SagTQ7tQ8DsxsR1ijijh+w99WT452C1gl3qnxkQkjZaBE wBo0yYkQI4d4se2SjsniivH7rlgz6js= X-MC-Unique: l3APLJ2GO5-srRLvxN9Rgg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/38] virQEMUCapsHasPCIMultiBus: Remove logic for PPC multibus support check Date: Mon, 19 Apr 2021 14:35:10 +0200 Message-Id: <916b866320edb2ff43c3814f0b34439f42b4518a.1618834490.git.pkrempa@redhat.com> In-Reply-To: References: 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.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) All machine types which have PCI support multibus since qemu 2.0 according to the logic we had, thus we can remove all the machine type and version checks which are now dead code. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko Reviewed-by: Pavel Hrdina Reviewed-by: Neal Gompa --- src/qemu/qemu_alias.c | 4 ++-- src/qemu/qemu_capabilities.c | 42 +++--------------------------------- src/qemu/qemu_capabilities.h | 3 +-- src/qemu/qemu_command.c | 4 ++-- 4 files changed, 8 insertions(+), 45 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index 7c86a6eeaa..695e150c43 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -122,7 +122,7 @@ qemuAssignDeviceChrAlias(virDomainDef *def, int qemuAssignDeviceControllerAlias(virDomainDef *domainDef, - virQEMUCaps *qemuCaps, + virQEMUCaps *qemuCaps G_GNUC_UNUSED, virDomainControllerDef *controller) { const char *prefix =3D virDomainControllerTypeToString(controller->typ= e); @@ -131,7 +131,7 @@ qemuAssignDeviceControllerAlias(virDomainDef *domainDef, return 0; if (controller->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI) { - if (!virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef)) { + if (!virQEMUCapsHasPCIMultiBus(domainDef)) { /* qemus that don't support multiple PCI buses have * hardcoded the name of their single PCI controller as * "pci". diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 030779902d..e5d7f87221 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2059,53 +2059,17 @@ virQEMUCapsGet(virQEMUCaps *qemuCaps, } -bool virQEMUCapsHasPCIMultiBus(virQEMUCaps *qemuCaps, - const virDomainDef *def) +bool virQEMUCapsHasPCIMultiBus(const virDomainDef *def) { /* x86_64 and i686 support PCI-multibus on all machine types * since forever */ if (ARCH_IS_X86(def->os.arch)) return true; + /* PPC supports multibus on all machine types which have pci since qem= u-2.0.0 */ if (def->os.arch =3D=3D VIR_ARCH_PPC || ARCH_IS_PPC64(def->os.arch)) { - /* - * Usage of pci.0 naming: - * - * ref405ep: no pci - * taihu: no pci - * bamboo: 1.1.0 (<=3D 1.5.0, so basically forever) - * mac99: 2.0.0 - * g3beige: 2.0.0 - * prep: 1.4.0 (<=3D 1.5.0, so basically forever) - * pseries: 2.0.0 - * mpc8544ds: forever - * virtex-m507: no pci - * ppce500: 1.6.0 - */ - - /* We do not store the qemu version in domain status XML. - * Hope the user is using a QEMU new enough to use 'pci.0', - * otherwise the results of this function will be wrong - * for domains already running at the time of daemon - * restart */ - if (qemuCaps->version =3D=3D 0) - return true; - - if (qemuCaps->version >=3D 2000000) - return true; - - if (qemuCaps->version >=3D 1006000 && - STREQ(def->os.machine, "ppce500")) - return true; - - if (STREQ(def->os.machine, "bamboo") || - STREQ(def->os.machine, "mpc8544ds") || - STREQ(def->os.machine, "prep")) { - return true; - } - - return false; + return true; } /* S390 supports PCI-multibus. */ diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index f54aad5dfd..b3844e5ba6 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -633,8 +633,7 @@ bool virQEMUCapsGet(virQEMUCaps *qemuCaps, void virQEMUCapsInitProcessCapsInterlock(virQEMUCaps *qemuCaps); -bool virQEMUCapsHasPCIMultiBus(virQEMUCaps *qemuCaps, - const virDomainDef *def); +bool virQEMUCapsHasPCIMultiBus(const virDomainDef *def); bool virQEMUCapsSupportsVmport(virQEMUCaps *qemuCaps, const virDomainDef *def); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 77d8e3f38c..63b6533c68 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -344,7 +344,7 @@ static int qemuBuildDeviceAddressStr(virBuffer *buf, const virDomainDef *domainDef, virDomainDeviceInfo *info, - virQEMUCaps *qemuCaps) + virQEMUCaps *qemuCaps G_GNUC_UNUSED) { g_autofree char *devStr =3D NULL; const char *contAlias =3D NULL; @@ -381,7 +381,7 @@ qemuBuildDeviceAddressStr(virBuffer *buf, * case, use the default one. */ if (!qemuDomainIsPSeries(domainDef) && cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI= _ROOT) { - if (virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef)) + if (virQEMUCapsHasPCIMultiBus(domainDef)) contAlias =3D "pci.0"; else contAlias =3D "pci"; --=20 2.30.2