From nobody Sun Feb 8 21:11:41 2026 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=1644346399; cv=none; d=zohomail.com; s=zohoarc; b=i3STZ5gwIoJV51GI3lQcmYLn7ZVUvummUwbNfi1+hhcM8eH8KB1WyrY5lapztnnyonz5755tQwEIuKv4N+aZixa1+ZpoOtXkcHspkG92xqoyShqSLXiaKuTjxO34kQi4uCxGZie3puN454meJ0Pf4zJ/PqVAWJqPT0oFHQ1Q1EM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644346399; 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=MgYvC0WpzYR4J4u6IVZGpai6zM/5BMsMQb7FbyfAFcs=; b=mi2qYLIibhqRQZVWpezjewVbS3e38ihVwux5Q9728h7ilnh5m3V9VFWP3K17IlTLSesAbU0dgQ0Xi/XZ9/bsJOjKl+p4p6qJAbXohH1yzf8Iyzcoh37QJCUNQclTIOX7A8epeNPjZ7fNKB2RFiUOFZ5qv6Jn8k+4VPGYcT8fe2Y= 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) 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 1644346399173417.7929899957587; Tue, 8 Feb 2022 10:53:19 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-410-oL_f4k59M8uOz0eFN3r_ZA-1; Tue, 08 Feb 2022 13:53:14 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 248F58519F7; Tue, 8 Feb 2022 18:53:08 +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 02C7E34D42; Tue, 8 Feb 2022 18:53:08 +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 C94B718218BE; Tue, 8 Feb 2022 18:53:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 217Bsknt032509 for ; Mon, 7 Feb 2022 06:54:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 88F2D6F950; Mon, 7 Feb 2022 11:54:46 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id D23C36F948 for ; Mon, 7 Feb 2022 11:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644346398; 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=MgYvC0WpzYR4J4u6IVZGpai6zM/5BMsMQb7FbyfAFcs=; b=ELEmchWDAEyfK6b9FHLRDp4EcXVpK6dFYg3NuhqEEZ1EeoMpdWh44umwjroXII4HuGP0D8 7n0wx77xpSl4gF0G5+hG1oRhYP9x9oXVbypQORvjommLaV54ufm1xe9YJpYc877Yn5uEEc lS2YKZpuW3NoBVPrlJbX94LdsjXqgac= X-MC-Unique: oL_f4k59M8uOz0eFN3r_ZA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/7] qemu: process: Don't use hardcoded QOM path for cpu for probing flags Date: Mon, 7 Feb 2022 12:53:59 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.84 on 10.5.11.23 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) X-ZM-MESSAGEID: 1644346400956100003 Content-Type: text/plain; charset="utf-8" Modify 'qemuProcessGetVCPUQOMPath' to take the detected QOM path of the first vCPU which is always present as the QOM path used our code probing CPU flags via 'qom-get'. This is needed as upcoming qemu will change it. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/272 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2051451 Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bd9c6ed747..eeda2a92ef 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4226,8 +4226,16 @@ qemuProcessTranslateCPUFeatures(const char *name, /* returns the QOM path to the first vcpu */ static const char * -qemuProcessGetVCPUQOMPath(void) +qemuProcessGetVCPUQOMPath(virDomainObj *vm) { + virDomainVcpuDef *vcpu =3D virDomainDefGetVcpu(vm->def, 0); + qemuDomainVcpuPrivate *vcpupriv; + + if (vcpu && + (vcpupriv =3D QEMU_DOMAIN_VCPU_PRIVATE(vcpu)) && + vcpupriv->qomPath) + return vcpupriv->qomPath; + return "/machine/unattached/device[0]"; } @@ -4242,7 +4250,7 @@ qemuProcessFetchGuestCPU(virQEMUDriver *driver, qemuDomainObjPrivate *priv =3D vm->privateData; g_autoptr(virCPUData) dataEnabled =3D NULL; g_autoptr(virCPUData) dataDisabled =3D NULL; - const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(); + const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(vm); bool generic; int rc; @@ -8465,7 +8473,7 @@ qemuProcessRefreshCPUMigratability(virQEMUDriver *dri= ver, { qemuDomainObjPrivate *priv =3D vm->privateData; virDomainDef *def =3D vm->def; - const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(); + const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(vm); bool migratable; int rc; --=20 2.34.1