From nobody Mon Feb 9 19:52:57 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=1614971736; cv=none; d=zohomail.com; s=zohoarc; b=W6TQZt0WmCP4fCnN6x9QizR1BSXcHImUZY08AlVpo52neJ58O3Vh6p7gnFIkYo8UmalYidp6gJsB40wkzrGKLYBR0D33bIlWJG54A57PvgwkiZvNcf5rHk0+ZSswspvF2tkbhngMcPl/2qyW++/FU4YYo+5EFbEosdXX6bUOv4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614971736; 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=K//sK1/BSJZqF9mVfRAF2Vibk/nNZDEdy3mfAGYGETw=; b=fA4ypLn4bsujy5f0lvmJaLNDt0pn0KMukNs6RhZnOutuN5riP9P5v4yhSP/Vv4zgMArL/E/v+jqtgg06ZPJ2u74hw0hbfMfDk2pX1zs9qx/ei5aPRqcld3JoKecFSF7EMck3Zu9IfvX6hRyvLskiYGBZlSc9N11X1UOdDYMZnoc= 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 1614971736165127.70520921631146; Fri, 5 Mar 2021 11:15:36 -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-324-gIhcO824NmCJ0FiUqPawew-1; Fri, 05 Mar 2021 14:15:31 -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 13BAB8143F1; Fri, 5 Mar 2021 19:15:21 +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 D30FB1971A; Fri, 5 Mar 2021 19:15:20 +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 8AEFB180100F; Fri, 5 Mar 2021 19:15:20 +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 125JENHw001840 for ; Fri, 5 Mar 2021 14:14:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id B219D5D6DC; Fri, 5 Mar 2021 19:14:23 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.194.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1894B5D6B1 for ; Fri, 5 Mar 2021 19:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614971735; 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=K//sK1/BSJZqF9mVfRAF2Vibk/nNZDEdy3mfAGYGETw=; b=dImTqUQjq59RkbBbL2Z3a8OBkcUJ5BO2wbn4EDZXkoD00AiaeYqSn+kY2SpqKcroxZn6dW pJe5JSo+ZR2yEuSjHfBH2A70lm+r0PkQwFX/0mRIq+dHMKHf4n6cmGkoK9Fze4X21eoIIa eEHgHFjrxMGw6b/MA6quArTgIndUkMo= X-MC-Unique: gIhcO824NmCJ0FiUqPawew-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 11/17] tests: Mock virProcessGetMaxMemLock() Date: Fri, 5 Mar 2021 20:13:58 +0100 Message-Id: <20210305191404.529903-12-abologna@redhat.com> In-Reply-To: <20210305191404.529903-1-abologna@redhat.com> References: <20210305191404.529903-1-abologna@redhat.com> 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) Content-Type: text/plain; charset="utf-8" Up until now we've implicitly relied on the fact that failures reported from this function were simply ignored, but that's about to change and so we need a proper mock. Signed-off-by: Andrea Bolognani --- src/util/virprocess.h | 2 +- tests/virprocessmock.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util/virprocess.h b/src/util/virprocess.h index 34210d6c9d..dbf4148e90 100644 --- a/src/util/virprocess.h +++ b/src/util/virprocess.h @@ -79,7 +79,7 @@ int virProcessSetMaxProcesses(pid_t pid, unsigned int pro= cs); int virProcessSetMaxFiles(pid_t pid, unsigned int files); int virProcessSetMaxCoreSize(pid_t pid, unsigned long long bytes); =20 -int virProcessGetMaxMemLock(pid_t pid, unsigned long long *bytes); +int virProcessGetMaxMemLock(pid_t pid, unsigned long long *bytes) G_GNUC_N= O_INLINE; =20 /* Callback to run code within the mount namespace tied to the given * pid. This function must use only async-signal-safe functions, as diff --git a/tests/virprocessmock.c b/tests/virprocessmock.c index c9386d757a..0356ff2f70 100644 --- a/tests/virprocessmock.c +++ b/tests/virprocessmock.c @@ -21,6 +21,13 @@ #include #include "virprocess.h" =20 +int +virProcessGetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long *bytes= G_GNUC_UNUSED) +{ + *bytes =3D 0; + return 0; +} + int virProcessSetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long bytes = G_GNUC_UNUSED) { --=20 2.26.2