From nobody Mon Feb 9 03:14:08 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=1560937396; cv=none; d=zoho.com; s=zohoarc; b=eAVBvPi6Ng9RZEbr8/qdKH9zTkh7H0UOFX0ydB1VHiukZmOhwSy2/ivVqimwoogiPQE+DOroK3RwNaAU6+W8pZkP3mYlPwt2BOBFJ98haPg+jh44MVFWBRuRDaz3OEuo8+3f0jrWK9rbGUP7S1UbGtJTxST/jH6ifR8gT1WDk08= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560937396; 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=Q3aG1cLy3HIdJz+eBf6/wR/tLWZa06lbYEVGQPZAo6U=; b=NJRpOvo6YKNP/R04bM3awUGUKJMumqARxMkjjGzHEicHu1GUOfhQTMMQ28EoAA1d3NLmfEJB60NqqVqxH3jLmBFeyeTQ7A1wQvPXZaNojtny6kYCEB3F253jc+bGQ+vtJae+wqoi0vqJFz+VCcwx197Youo5wQDxEhnUSMCufus= 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 1560937396353893.2224240676436; Wed, 19 Jun 2019 02:43:16 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id C3332C1EB1E2; Wed, 19 Jun 2019 09:43:14 +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 A02455D9D6; Wed, 19 Jun 2019 09:43:14 +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 5C1541806B19; Wed, 19 Jun 2019 09:43:14 +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 x5J9cXLf024435 for ; Wed, 19 Jun 2019 05:38:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6362819C6F; Wed, 19 Jun 2019 09:38:33 +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 3540819C6A for ; Wed, 19 Jun 2019 09:38:31 +0000 (UTC) Received: by orkuz.int.mamuti.net (Postfix, from userid 500) id C81C52A412A; Wed, 19 Jun 2019 11:38:23 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 19 Jun 2019 11:38:19 +0200 Message-Id: <37320f029bef0e3a92eca0a8f7657684a229235f.1560936842.git.jdenemar@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 Subject: [libvirt] [PATCH 22/24] qemu_process: Prefer generic qemuMonitorGetGuestCPU 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 19 Jun 2019 09:43:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When updating guest CPU definition according to the vCPU actually created by QEMU, we want to use the generic qemuMonitorGetGuestCPU to get both CPUID and MSR features. Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index db940b02a8..fa82adbc1e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4128,6 +4128,16 @@ qemuProcessVerifyCPUFeatures(virDomainDefPtr def, } =20 =20 +static const char * +qemuProcessTranslateCPUFeatures(const char *name, + void *opaque) +{ + virQEMUCapsPtr qemuCaps =3D opaque; + + return virQEMUCapsCPUFeatureFromQEMU(qemuCaps, name); +} + + static int qemuProcessFetchGuestCPU(virQEMUDriverPtr driver, virDomainObjPtr vm, @@ -4138,18 +4148,28 @@ qemuProcessFetchGuestCPU(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv =3D vm->privateData; virCPUDataPtr dataEnabled =3D NULL; virCPUDataPtr dataDisabled =3D NULL; + bool generic; int rc; =20 *enabled =3D NULL; *disabled =3D NULL; =20 - if (!ARCH_IS_X86(vm->def->os.arch)) + generic =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CPU_UNAVAILABLE_F= EATURES); + + if (!generic && !ARCH_IS_X86(vm->def->os.arch)) return 0; =20 if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) goto error; =20 - rc =3D qemuMonitorGetGuestCPUx86(priv->mon, &dataEnabled, &dataDisable= d); + if (generic) { + rc =3D qemuMonitorGetGuestCPU(priv->mon, + vm->def->os.arch, + qemuProcessTranslateCPUFeatures, priv-= >qemuCaps, + &dataEnabled, &dataDisabled); + } else { + rc =3D qemuMonitorGetGuestCPUx86(priv->mon, &dataEnabled, &dataDis= abled); + } =20 if (qemuDomainObjExitMonitor(driver, vm) < 0) goto error; --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list