From nobody Mon Sep 16 19:46:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1693924188; cv=none; d=zohomail.com; s=zohoarc; b=a2fM8bz9hRLshw9Xxl+PlyxtmlJC2INGe2AbAoYA/z4Rzk2XfLiCarPABqHoGdUdnEEz1t1QDH5cdDSwEZDYTCAb39IjBSXn4nw6H+EDpzvfFAhEahWrcfNwUyl5suH/20ORuh+Mt55bB5qlDGYAGHqLo3lG5iI0w+nVSkHioUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693924188; 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=ljcNNqP5MtiYs4GrHoiTgQMANGmAjOMtvRILDVUDtRQ=; b=gXbYXVHpskshu+2UxmPx1jHHkmMN7s31AX8wX2HayMW34rM8vey8E7E82WPgiG6ucQZyWCxzNPMWgRZFSP/am8gn6gMYeQ4xHkdIUK2s8r2yP38FNaox7uz+nrzQXuMPsvyoNX+WE/elmaUItFDn+OhI85AaK3H5ybdqPARCc/c= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1693924188518731.4463628448085; Tue, 5 Sep 2023 07:29:48 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-695-bzpkN9zqNNyLagIEgzd-JQ-1; Tue, 05 Sep 2023 10:29:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51D101C0724B; Tue, 5 Sep 2023 14:25:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A46021EE56A; Tue, 5 Sep 2023 14:25:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1B05519465BC; Tue, 5 Sep 2023 14:25:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 704D11946589 for ; Tue, 5 Sep 2023 14:25:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4FEBB1121318; Tue, 5 Sep 2023 14:25:15 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id C39E21121314 for ; Tue, 5 Sep 2023 14:25:14 +0000 (UTC) X-MC-Unique: bzpkN9zqNNyLagIEgzd-JQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 50/51] qemuxml2argvtest: Remove cpu model faking for fake-caps tests Date: Tue, 5 Sep 2023 16:24:17 +0200 Message-ID: <1a194fce4cbc2899db14bf80900ade9a7dcb0c11.1693923601.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1693924190384100001 Content-Type: text/plain; charset="utf-8" Now that all fake-caps testing was removed we can also remove the filling of the fake caps by cpu models. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 49 ---------------------------------------- 1 file changed, 49 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 99e0d3aa0d..2d06e2a0d1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -256,32 +256,6 @@ static virNWFilterDriver fakeNWFilterDriver =3D { }; -static int -testAddCPUModels(virQEMUCaps *caps) -{ - virArch arch =3D virQEMUCapsGetArch(caps); - const char *x86Models[] =3D { - "n270", "athlon", "pentium3", "pentium2", "pentium", - "486", "coreduo", "kvm32", "qemu32", "kvm64", - "core2duo", "phenom", "qemu64", - "Opteron_G3", "Opteron_G2", "Opteron_G1", - "Nehalem", "Penryn", "Conroe", - "Haswell-noTSX", "Haswell", - }; - - if (ARCH_IS_X86(arch)) { - if (virQEMUCapsAddCPUDefinitions(caps, VIR_DOMAIN_VIRT_KVM, x86Mod= els, - G_N_ELEMENTS(x86Models), - VIR_DOMCAPS_CPU_USABLE_UNKNOWN) <= 0 || - virQEMUCapsAddCPUDefinitions(caps, VIR_DOMAIN_VIRT_QEMU, x86Mo= dels, - G_N_ELEMENTS(x86Models), - VIR_DOMCAPS_CPU_USABLE_UNKNOWN) <= 0) - return -1; - } - - return 0; -} - static void testUpdateQEMUCapsHostCPUModel(virQEMUCaps *qemuCaps, virArch hostArch) { @@ -289,24 +263,6 @@ testUpdateQEMUCapsHostCPUModel(virQEMUCaps *qemuCaps, = virArch hostArch) virQEMUCapsUpdateHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU= ); } -static int -testUpdateQEMUCaps(const struct testQemuInfo *info, - virArch arch, - virCaps *caps) -{ - if (!caps) - return -1; - - virQEMUCapsSetArch(info->qemuCaps, arch); - - if (testAddCPUModels(info->qemuCaps) < 0) - return -1; - - testUpdateQEMUCapsHostCPUModel(info->qemuCaps, caps->host.arch); - - return 0; -} - static int testCheckExclusiveFlags(int flags) @@ -554,11 +510,6 @@ testCompareXMLToArgv(const void *data) if (arch =3D=3D VIR_ARCH_NONE) arch =3D virArchFromHost(); - if (!(info->flags & FLAG_REAL_CAPS)) { - if (testUpdateQEMUCaps(info, arch, driver.caps) < 0) - goto cleanup; - } - virFileCacheClear(driver.qemuCapsCache); if (qemuTestCapsCacheInsert(driver.qemuCapsCache, info->qemuCaps) < 0) --=20 2.41.0