From nobody Mon Feb 9 16:16:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1615297651; cv=none; d=zohomail.com; s=zohoarc; b=Dc6XjbVIVF0mmaSmiM0q8375Hlz1CuWB/H4UZJvMBLezKBFsIyyrIKsVAZAkeylHaiclQDF393OPVmFZKgByYO2USQ388m1CqPaxcJn0HVtfXglwOtOxzevFAN7gRF3cGhCRAdK7TLMNe4WkfAo1dBEzFP79HV7oeKhdU9L8Fq0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615297651; 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=vqhdFQMPC6TjVFFKNdePzdeI/jJDByHkf3uSF8Ym2Wc=; b=cFUPJFlyRteAO00C48SZtJ2Ea812m56JEFIJNVegas3zeBZ8cur5he5yQqDCGyau+jBdwdk46pSXwiTNDUSU0Y6kAOuJ7ULPQyYiRWwANW8jPn42ex2BT4l9OfwY1gKBGjdLto8oJ97zJjaPDl+gwoOF346XmbGC2UJlBSOmpUA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1615297651515192.40581607153592; Tue, 9 Mar 2021 05:47:31 -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-472-KQBSblzANdyEETIFZCcUJg-1; Tue, 09 Mar 2021 08:47:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE202801817; Tue, 9 Mar 2021 13:47:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 935CF60854; Tue, 9 Mar 2021 13:47:22 +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 0DAB157DC4; Tue, 9 Mar 2021 13:47:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 129DlKqY013238 for ; Tue, 9 Mar 2021 08:47:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6E1AE5C261; Tue, 9 Mar 2021 13:47:20 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.196.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B0C85C233 for ; Tue, 9 Mar 2021 13:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615297650; 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=vqhdFQMPC6TjVFFKNdePzdeI/jJDByHkf3uSF8Ym2Wc=; b=EJxebucgyZ64TPloMdS/vEseMGBueZ1rqDY2OeLQzcBrV8OL4yJlXmeK21pu0oA7WN/W6J EqvGRVW20NNfktUT+4s7wF1sXajZ8zJQypu7xthXCoRYnU0IFdpVJ8dAoK0YO20a1lNiyP P/ustHMwtv3Krz/EDrWiTzPqCj06qHc= X-MC-Unique: KQBSblzANdyEETIFZCcUJg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/4] qemu: Don't ignore virProcessGetMaxMemLock() errors Date: Tue, 9 Mar 2021 14:47:07 +0100 Message-Id: <20210309134709.44613-3-abologna@redhat.com> In-Reply-To: <20210309134709.44613-1-abologna@redhat.com> References: <20210309134709.44613-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.13 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" Now that we've implemented a fallback for the function that obtains the information from /proc, there is no reason we would get a failure unless there's something seriously wrong with the environment we're running in, in which case we're better off reporting the issue to the user rather than pretending everything is fine. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/qemu/qemu_domain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 73e2473dce..1e9178764b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9246,11 +9246,10 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm, if (bytes) { /* If this is the first time adjusting the limit, save the current * value so that we can restore it once memory locking is no longer - * required. Failing to obtain the current limit is not a critical - * failure, it just means we'll be unable to lower it later */ + * required */ if (!vm->originalMemlock) { if (virProcessGetMaxMemLock(vm->pid, &(vm->originalMemlock)) <= 0) - vm->originalMemlock =3D 0; + return -1; } } else { /* Once memory locking is no longer required, we can restore the --=20 2.26.2