From nobody Sat May 4 12:53:23 2024 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=1614237449; cv=none; d=zohomail.com; s=zohoarc; b=nG9xJEu/ea5CYluqq1MxZ0BWd0dfX5aAyU2ckzRwPzcEtjw5iXYM0CK1p31AuAH7IuAPKJe5B5Y65gabAVysvI02mivraef1kqeYbE0QCA+z/A/TQiyccjp0wO5Vx36YqOEVcuo4CamGgYOexrHAP6YvYuw9ipFurcaSS27IIV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614237449; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ew+mV4JLwu4BShU3qyJg3khK92TX+1G5ENzvXNDT6ng=; b=DAjBOBi/cDsjNtXMkIsg0mNuRchevwB8GjHm+pUr7QgjULuVInoVUP4FzE6dUP2yn+YAW6SrX8j4BIDuvOIQZoy5a0lrjdaozd0CxdOiTlJuLYZcGwOeJi/6XWelEy+L5ErHpkz7a6ExtBrX+5XCmpq/vOiWBIwNN5hbGsl8LSw= 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 1614237449202774.3437517698038; Wed, 24 Feb 2021 23:17:29 -0800 (PST) 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-38-kelJ4RKuPfiuC3oBlS-ZRQ-1; Thu, 25 Feb 2021 02:17:20 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9460080197D; Thu, 25 Feb 2021 07:17:15 +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 6497160C4D; Thu, 25 Feb 2021 07:17:15 +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 5A1D74E58E; Thu, 25 Feb 2021 07:17:14 +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 11P7HDKT003906 for ; Thu, 25 Feb 2021 02:17:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7BE90679FA; Thu, 25 Feb 2021 07:17:13 +0000 (UTC) Received: from work.redhat.com (ovpn-112-204.ams2.redhat.com [10.36.112.204]) by smtp.corp.redhat.com (Postfix) with ESMTP id C32A15F9C9; Thu, 25 Feb 2021 07:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614237448; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ew+mV4JLwu4BShU3qyJg3khK92TX+1G5ENzvXNDT6ng=; b=J0ksdd5gyrMxOd22W5vGH5z39qNctY6IeQ/+ExzUhMOA4s9LaUMqEE4CvV99+VlFVsA7up g3+89Pazygdnt3vudmpouQdbAxKfBmzdsg+8lOVBzUMj5vJyc3wJi8ZoQ5c5VzKzLQWd3b UxYmG4CbFFNinGL6RjP3aXVUviBy2eA= X-MC-Unique: kelJ4RKuPfiuC3oBlS-ZRQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH] qemuProcessUpdateGuestCPU: Check cpu if check=full is set Date: Thu, 25 Feb 2021 08:17:09 +0100 Message-Id: <20210225071709.6931-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.12 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" libvirt performs cpu checking if "check" is set to "partial", but skips checking the cpu if "check" is set to "full". See https://bugzilla.redhat.com/show_bug.cgi?id=3D1840770 Signed-off-by: Tim Wiederhake --- src/qemu/qemu_process.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bfa742577f..5b8c1397ef 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6149,6 +6149,14 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, if (virCPUConvertLegacy(hostarch, def->cpu) < 0) return -1; =20 + if (def->cpu->check =3D=3D VIR_CPU_CHECK_FULL) { + virCPUDefPtr host =3D virQEMUCapsGetHostModel(qemuCaps, def->virtT= ype, + VIR_QEMU_CAPS_HOST_CPU= _FULL); + + if (virCPUCompare(hostarch, host, def->cpu, true) < 0) + return -1; + } + /* nothing to update for host-passthrough / maximum */ if (def->cpu->mode !=3D VIR_CPU_MODE_HOST_PASSTHROUGH && def->cpu->mode !=3D VIR_CPU_MODE_MAXIMUM) { --=20 2.26.2