From nobody Mon Feb 9 19:53:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1576845844; cv=none; d=zohomail.com; s=zohoarc; b=FVKuXWbt98YIw6f1pJ+MXSta64QXRsYeWZLubaGd6rNDns7c2LmGXT+MqlzhzqfZ/PBi1ZfoMKc6Qig0afMm9gIFHdT5vVrFhUguDYrFwdUlxbcP/9jKRZrervT9CrVhlguum8N+ksUIdpLHEUci6oRU92qzte+JPnZ6QLMNp5Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576845844; h=Content-Type:Content-Transfer-Encoding:Cc: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=T4rShAxGt++VTwySWAXJwYQrnDWrRaB03ckdCr7WNzY=; b=UPVOazP7SmVSQId+zpbngwK7JAP/ss1vqkJoTc1o90LUFWlvOr/P+l0KW09fzPh11cK5TPPGkZ0bD+WD/zm101ge59gq0p0q2djHtJhHI7Ot/x8cfx5xYVgGh7xB91Jyz6uT3TL3k1PGFj1E28ItGYsv69YAkKN6hACnCrtvRLk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1576845844951155.4147228080742; Fri, 20 Dec 2019 04:44:04 -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-52-cs2pMEIUMhG8pKZg43bztw-1; Fri, 20 Dec 2019 07:43:33 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A692B800D48; Fri, 20 Dec 2019 12:43:28 +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 3A3FD63B99; Fri, 20 Dec 2019 12:43:28 +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 0B78118089CE; Fri, 20 Dec 2019 12:43:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBKChNjo026568 for ; Fri, 20 Dec 2019 07:43:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 969E61001B07; Fri, 20 Dec 2019 12:43:23 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9EC81001B00; Fri, 20 Dec 2019 12:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576845842; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=T4rShAxGt++VTwySWAXJwYQrnDWrRaB03ckdCr7WNzY=; b=K5Qv3naklNoewxC+E/UUmI0z0j5bZDRqN+jTFoJ97lEZmLilVcjX9hGyRrNH2ch8whlQOB MAPAGzx0jKBrXwB0t01wvg9W/b58mNWDaCk5w/gKClQRCwj1ZHjg2OHMF8Z022O3+mwxJ3 /Jff//B/AYgoPGlZECSpVdDjdaKy9kM= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 13:43:12 +0100 Message-Id: <20191220124315.1558772-3-fidencio@redhat.com> In-Reply-To: <20191220124315.1558772-1-fidencio@redhat.com> References: <20191220124315.1558772-1-fidencio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Subject: [libvirt] [PATCH 2/5] openvz: Get rid of "no_memory" labels 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.11 X-MC-Unique: cs2pMEIUMhG8pKZg43bztw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) As pointed out by J=C3=A1n Tomko, "no_memory seems suspicious in the times = of abort()". As libvirt decided to take the path to not report OOM and simply abort when it happens, let's get rid of the no_memory labels and simplify the code around them. Signed-off-by: Fabiano Fid=C3=AAncio --- src/openvz/openvz_conf.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 971adaf71c..c4c6dec2f7 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -148,18 +148,18 @@ openvzParseBarrierLimit(const char* value, =20 virCapsPtr openvzCapsInit(void) { - virCapsPtr caps; + g_autoptr(virCaps) caps =3D NULL; virCapsGuestPtr guest; =20 if ((caps =3D virCapabilitiesNew(virArchFromHost(), false, false)) =3D=3D NULL) - goto no_memory; + return NULL; =20 if (!(caps->host.numa =3D virCapabilitiesHostNUMANewHost())) - goto no_memory; + return NULL; =20 if (virCapabilitiesInitCaches(caps) < 0) - goto no_memory; + return NULL; =20 if ((guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE, @@ -168,7 +168,7 @@ virCapsPtr openvzCapsInit(void) NULL, 0, NULL)) =3D=3D NULL) - goto no_memory; + return NULL; =20 if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_OPENVZ, @@ -176,13 +176,9 @@ virCapsPtr openvzCapsInit(void) NULL, 0, NULL) =3D=3D NULL) - goto no_memory; + return NULL; =20 - return caps; - - no_memory: - virObjectUnref(caps); - return NULL; + return g_steal_pointer(&caps); } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list