From nobody Mon Feb 9 10:33:19 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=1617980541; cv=none; d=zohomail.com; s=zohoarc; b=WuVf3p0R0iy1/IYoT90Lhh1zxaGid9UShrksBwVscqyk8Fbg33mb4LvB8oMP54cEhmWmYizIc6XNjTfMkK7+l7mnDFQdSTJl4EQaHdGTCyD+c1+MOJcH4ceVU1lRG5guLd0vvo+PfylE2uaXmsRmZkGEv2VDbXTa0I2P1KrXPU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617980541; 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=3798nBODPir2rdJ1F5UkRJ+g1gnWXlV75BCc2sOexmE=; b=Ag86CVFDX7uU3QFJghzanRHfTNK4g6qg0nobt1a+ZtxGAJ82yj3Ozoj5f/FkqGh+aN5QiLAzCFLIOTQ8S5j6vbdgb5Mys0tUQ6Eg/vt4jUE+GTzJud4Qm7sNmaVj5RxhEB4Xppz2X6GFYBDFSAQ0n9BiGalwcZHLPhzpqkRqqFU= 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 1617980541517600.1326143166812; Fri, 9 Apr 2021 08:02:21 -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-600-olUYlORqOVmRoPofIj55Uw-1; Fri, 09 Apr 2021 11:00:49 -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 F050D10866A4; Fri, 9 Apr 2021 15:00:10 +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 33396830E4; Fri, 9 Apr 2021 15:00:10 +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 BA22A1806D0E; Fri, 9 Apr 2021 15:00:09 +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 139EvabB023739 for ; Fri, 9 Apr 2021 10:57:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8F2986EF41; Fri, 9 Apr 2021 14:57:36 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA0A060D79 for ; Fri, 9 Apr 2021 14:57:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617980452; 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=3798nBODPir2rdJ1F5UkRJ+g1gnWXlV75BCc2sOexmE=; b=i0PGaW5e2YA+rikfFZ3ZA5FVrr+8x6apZi+z1oWuZSMj0bPoMcdi4XlGFuLOD3fXBAxRIl XKxvmEFilmX94pL/JahVW2HU1c5z/IakzGSfdBhQLB/GyKFyqzSsElSdn1MQkRvO+MaXPx XlTJ3N78/Vi8dIdFegRaTLIzmoR/wW8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617980540; 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=3798nBODPir2rdJ1F5UkRJ+g1gnWXlV75BCc2sOexmE=; b=GE4Fpr/+ymuigf3S6sfyDaUgU+QPIDUNFq0/FA8MoD7w4DPLU7kMmKyZ2jAbdXm75tII5U TxE5t2rWz+8lvIXmd0N4JXCZTYrQPfjzJaQT/vjcYkBI5JyLyjee8M41FRIDdtXLyssMav VCxuMldvaLyzLK7xhxI2ORg0SUFOcEk= X-MC-Unique: olUYlORqOVmRoPofIj55Uw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 11/43] virQEMUCapsHasPCIMultiBus: Remove logic for PPC multibus support check Date: Fri, 9 Apr 2021 16:56:47 +0200 Message-Id: <87406e4927d74f497779e0d99e2183ef14a12a0f.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) (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- 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 1c6f04c0ba..a36b245811 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -122,7 +122,7 @@ qemuAssignDeviceChrAlias(virDomainDefPtr def, int qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef, - virQEMUCapsPtr qemuCaps, + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED, virDomainControllerDefPtr controller) { const char *prefix =3D virDomainControllerTypeToString(controller->typ= e); @@ -131,7 +131,7 @@ qemuAssignDeviceControllerAlias(virDomainDefPtr domainD= ef, 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 37ed750f8b..e7ae174bcc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2062,53 +2062,17 @@ virQEMUCapsGet(virQEMUCapsPtr qemuCaps, } -bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr 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 1ca9c1ea7b..b521383f7b 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -634,8 +634,7 @@ bool virQEMUCapsGet(virQEMUCapsPtr qemuCaps, void virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps); -bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps, - const virDomainDef *def); +bool virQEMUCapsHasPCIMultiBus(const virDomainDef *def); bool virQEMUCapsSupportsVmport(virQEMUCapsPtr qemuCaps, const virDomainDef *def); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 45eb0dc976..0ac899ba80 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -344,7 +344,7 @@ static int qemuBuildDeviceAddressStr(virBufferPtr buf, const virDomainDef *domainDef, virDomainDeviceInfoPtr info, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_autofree char *devStr =3D NULL; const char *contAlias =3D NULL; @@ -381,7 +381,7 @@ qemuBuildDeviceAddressStr(virBufferPtr 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