From nobody Sun Feb 8 21:29:14 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=1614183606; cv=none; d=zohomail.com; s=zohoarc; b=dlNlI3X49LPg2uYZ40MkpLS2ZA2DH5XoPmJqBwvRYbGSlZE0BEh4rhHnR8bzdUh65xOD7gMBnNz4hU6UIjHV4OL4dZhKNfo0NMVJpci/Jhvr0OnIpJZAOOCG7tFhHAcpRf2HavqGP9ghQ3dxYzygtbSZ7OmiBtGV1AE4/lJEKzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614183606; 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=s1MIIuuK7N2RPWXki7IiXu9xi+7E7IeiS/xZZykzbUM=; b=hQMrYDxd0pVx0mK+1eEJVdRhfvXOXv9Q6TQlvD4UL1ItB/m1Wpp3mr2uduLakr2oye7+oj2HD9YIicTCNmBAKBT6jEDXbPB2P9FZDyscyWFgxQTLInGlRTh/vyqjWsF1E7VhiJ7eosqBMyKOK/UDDhOZb91ByPymkTv8cTjc2ls= 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) header.from= 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 1614183606968834.4711091616042; Wed, 24 Feb 2021 08:20:06 -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-277-wuENajZOM0-38FWgwnVbtA-1; Wed, 24 Feb 2021 11:18:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 377AC100CCC4; Wed, 24 Feb 2021 16:18: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 0F5BA10023AB; Wed, 24 Feb 2021 16:18: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 C6FC818089C9; Wed, 24 Feb 2021 16:18:07 +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 11OGHxhG015901 for ; Wed, 24 Feb 2021 11:17:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 55A6760862; Wed, 24 Feb 2021 16:17:59 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB4546E505 for ; Wed, 24 Feb 2021 16:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614183606; 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=s1MIIuuK7N2RPWXki7IiXu9xi+7E7IeiS/xZZykzbUM=; b=Lj0TxpHWXk+EcG62mVVpaiKjrQeNuqPO19UtadYuOP5UxkLToUkWITNP28tv8CTkn1cK87 zQRFX/lWdIaVer5cyE3fETNCKRlp9bwWcz0Qk7RrIxrsPFO41+4pdsY3SBEto+7cTocaIX 5safpQIWWnKecaWyCWylwEmviuzwim4= X-MC-Unique: wuENajZOM0-38FWgwnVbtA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 28/33] libxl: abort() on failure of libxl_cpu_bitmap_alloc() Date: Wed, 24 Feb 2021 17:17:03 +0100 Message-Id: <9309e3d2bd248ff13a37188c8fb8e498debff93b.1614182583.git.pkrempa@redhat.com> 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.84 on 10.5.11.22 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" Attempting to report error in case when we ran out of memory is pointless. Signed-off-by: Peter Krempa --- src/libxl/libxl_conf.c | 6 ++---- src/libxl/libxl_driver.c | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index f8db118996..f2bcd77a29 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -854,10 +854,8 @@ libxlMakeVnumaList(virDomainDefPtr def, goto cleanup; libxl_bitmap_init(&vcpu_bitmap); - if (libxl_cpu_bitmap_alloc(ctx, &vcpu_bitmap, b_info->max_vcpus)) { - virReportOOMError(); - goto cleanup; - } + if (libxl_cpu_bitmap_alloc(ctx, &vcpu_bitmap, b_info->max_vcpus)) + abort(); do { libxl_bitmap_set(&vcpu_bitmap, cpu); diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 75a8d46af0..434959d694 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -4931,10 +4931,9 @@ libxlDomainGetNumaParameters(virDomainPtr dom, if (numnodes <=3D 0) goto cleanup; - if (libxl_node_bitmap_alloc(cfg->ctx, &nodemap, 0)) { - virReportOOMError(); - goto cleanup; - } + if (libxl_node_bitmap_alloc(cfg->ctx, &nodemap, 0)) + abort(); + nodes =3D virBitmapNew(numnodes); rc =3D libxl_domain_get_nodeaffinity(cfg->ctx, --=20 2.29.2