From nobody Sun Feb 8 19:57:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1560937142; cv=none; d=zoho.com; s=zohoarc; b=Ta4xI595AiHLdgdf1Aatpw5hu1xeAb+XMvs3+VNa1LC7TT1aWs68M6SmCciJXFIwZ8YzrXhq6fdUZu+ctoOu/V/tV+skc80P2FZChhbwdKDD4UyjQbs2rKUTYFZvm3bLy9aiEloLNMM+Wz2g/PlS5h0Fa4I3RnVOV8lvNZRsXKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560937142; 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:ARC-Authentication-Results; bh=RbAUGbnqJj1tFansVs7xz4yVItoo3z7bLavW9f12nM8=; b=BfX/3sIdnrpHvVHIGPajb1gTvvi9Mly64S2n8uCM+jDP/cmnUCuFodEr2I6gZAFq5mazRjRb9rF+5eIhZJnphkqCteSxW6PT9W7KHnXaX1mxEjnkkcuaXEKjidDRMI0+al/+1qIqcZIArFqW83tFUPQUfnQBfcpNKwZhVq8nRgQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560937142514667.0116106969487; Wed, 19 Jun 2019 02:39:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 360617FDF9; Wed, 19 Jun 2019 09:38:47 +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 0E3F519C6F; Wed, 19 Jun 2019 09:38:41 +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 95B921806B18; Wed, 19 Jun 2019 09:38:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5J9cRnl024303 for ; Wed, 19 Jun 2019 05:38:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id E2F5C5C221; Wed, 19 Jun 2019 09:38:27 +0000 (UTC) Received: from orkuz.int.mamuti.net (ovpn-204-21.brq.redhat.com [10.40.204.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B51A45C207 for ; Wed, 19 Jun 2019 09:38:25 +0000 (UTC) Received: by orkuz.int.mamuti.net (Postfix, from userid 500) id 83E642A25B5; Wed, 19 Jun 2019 11:38:23 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 19 Jun 2019 11:38:01 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/24] qemu: Filter CPU features in active XML 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 19 Jun 2019 09:38:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Properly filter features which should not be passed to QEMU because they were never supported by QEMU or they did nothing and QEMU dropped them. Currently they are just silently ignored by the command line generator. Let's make this process more visible and clean by dropping the features from the domain's active definition in qemuProcessUpdateGuestCPU. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 3 --- src/qemu/qemu_process.c | 38 +++++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6cc165a118..a23e428322 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7106,9 +7106,6 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, virBufferAsprintf(buf, ",vendor=3D%s", cpu->vendor_id); =20 for (i =3D 0; i < cpu->nfeatures; i++) { - if (!virQEMUCapsCPUFilterFeatures(cpu->features[i].name, - (virArch *)&def->os.arch)) - continue; switch ((virCPUFeaturePolicy) cpu->features[i].policy) { case VIR_CPU_FEATURE_FORCE: case VIR_CPU_FEATURE_REQUIRE: diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 144328c148..47e84e5ef0 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5928,26 +5928,30 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, return -1; =20 /* nothing to update for host-passthrough */ - if (def->cpu->mode =3D=3D VIR_CPU_MODE_HOST_PASSTHROUGH) - return 0; + if (def->cpu->mode !=3D VIR_CPU_MODE_HOST_PASSTHROUGH) { + if (def->cpu->check =3D=3D VIR_CPU_CHECK_PARTIAL && + virCPUCompare(caps->host.arch, + virQEMUCapsGetHostModel(qemuCaps, def->virtType, + VIR_QEMU_CAPS_HOST_CPU_F= ULL), + def->cpu, true) < 0) + return -1; =20 - if (def->cpu->check =3D=3D VIR_CPU_CHECK_PARTIAL && - virCPUCompare(caps->host.arch, - virQEMUCapsGetHostModel(qemuCaps, def->virtType, - VIR_QEMU_CAPS_HOST_CPU_FULL), - def->cpu, true) < 0) + if (virCPUUpdate(def->os.arch, def->cpu, + virQEMUCapsGetHostModel(qemuCaps, def->virtType, + VIR_QEMU_CAPS_HOST_CPU_MI= GRATABLE)) < 0) + return -1; + + if (virCPUTranslate(def->os.arch, def->cpu, + virQEMUCapsGetCPUDefinitions(qemuCaps, def->vi= rtType)) < 0) + return -1; + + def->cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; + } + + if (virCPUDefFilterFeatures(def->cpu, virQEMUCapsCPUFilterFeatures, + &def->os.arch) < 0) return -1; =20 - if (virCPUUpdate(def->os.arch, def->cpu, - virQEMUCapsGetHostModel(qemuCaps, def->virtType, - VIR_QEMU_CAPS_HOST_CPU_MIGRAT= ABLE)) < 0) - return -1; - - if (virCPUTranslate(def->os.arch, def->cpu, - virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtTy= pe)) < 0) - return -1; - - def->cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; return 0; } =20 --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list