From nobody Mon Feb 9 02:14:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1630940350; cv=none; d=zohomail.com; s=zohoarc; b=NhPu7jxUaDIQ69McbAsVHX/edOAPCUk5YXT8rd80MONCANEQq2Bw23sEPY0TZlAd3D3YNzS+n32CGY9jdX3qWarbeLUUuTshJVcjz4lKvjpwv3I6FfPpkG8jUsC/Fp5odrh/WCCM/vpCQs9K4IAtQ8BvAJHFPa54wCByarivpuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630940350; 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=kPvBe8Xo3J6db1fx3g3zPRVonQTAlKedB67W/Kvhmlo=; b=QhxJH4chEnxyOlEEO2lEp35FiT4yvWYn5usH//hY8IO4Qn/2IBpPqIO5WQI+GALj+AeTjHpjtqlvC8NQomEkPxxV3TJjbfqqeOjA/JZ3M+I+Jm1jg2QljhHhy0flFm/zuhUiZc3TWvt16KQ70LaLIhiozhirweRnUG8Zrp2SCZ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1630940350517965.808248909112; Mon, 6 Sep 2021 07:59:10 -0700 (PDT) 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-413-TrUsW5MzPtCVdwpngNVeuw-1; Mon, 06 Sep 2021 10:59:08 -0400 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 31C6A100E3FF; Mon, 6 Sep 2021 14:59:02 +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 1455360CA1; Mon, 6 Sep 2021 14:59:02 +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 DC6F51800FE4; Mon, 6 Sep 2021 14:59:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 186EwtBf004461 for ; Mon, 6 Sep 2021 10:58:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD15877716; Mon, 6 Sep 2021 14:58:55 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47A536608B for ; Mon, 6 Sep 2021 14:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630940349; 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=kPvBe8Xo3J6db1fx3g3zPRVonQTAlKedB67W/Kvhmlo=; b=A+2jnPJV53xQpeLDrv403iHbFidw24oig9nS1bg5ZQl7+z9gsp2+csoKNzDbE3+La+D5WH kHQUUii9OGnXvPHnvNswEtpZbb14Mpxu0PZdlCmuee9q/hFdUhxGkIdqMtigOvxEXkqWnY F3UG4h2ugadou4mLL8GtsNJVJ8cFSjk= X-MC-Unique: TrUsW5MzPtCVdwpngNVeuw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/6] libxl: capsInitCPU: fail if we can't initialize host features Date: Mon, 6 Sep 2021 16:58:46 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630940350844100003 Introduced by: commit 17322e551861a5bc4dd464a7c5399204dc8c7caa libxl: describe host cpu features based on hwcaps with the justification that libxl_hwcaps does not have a stable format across all version. Even though the code would return '0' in the case of such failure, it frees the 'cpu' pointer, while keeping it in caps->host. Based on that, assume it does not happen in current usage. Signed-off-by: J=C3=A1n Tomko --- src/libxl/libxl_capabilities.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index d98109ea86..9d0ed921bd 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -166,16 +166,17 @@ libxlCapsInitCPU(virCaps *caps, libxl_physinfo *phy_i= nfo) cpu->threads =3D phy_info->threads_per_core; cpu->dies =3D 1; cpu->sockets =3D phy_info->nr_cpus / (cpu->cores * cpu->threads); - caps->host.cpu =3D cpu; - - ret =3D 0; =20 if (!(data =3D libxlCapsNodeData(cpu, phy_info->hw_cap)) || cpuDecode(cpu, data, NULL) < 0) { - VIR_WARN("Failed to initialize host cpu features"); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Failed to initialize host cpu features")); goto error; } =20 + caps->host.cpu =3D cpu; + ret =3D 0; + cleanup: virCPUDataFree(data); =20 --=20 2.31.1