From nobody Thu Apr 25 05:10:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1641542136; cv=none; d=zohomail.com; s=zohoarc; b=De3EPHR2I3rP8wEGcuAYAzU6bg+RHNAcd7rRZWQBmtQHHYVjBfxVRpGsDZqKnBZHcAnrv+1Vr8VBl7CASZs98Ndvtb1P97QEtJgB8mGkLC01WrBtVd/cbIe/KXaT79dfJ5aHwGBHhfUK1sVDmCYO6lnrHYdP5rhDIkyp5nJT8ZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641542136; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=CmtGKbGBZTCXTXrbshB7834VzADleEo3yRs0LL22y8k=; b=U0BmF9A1Nja6kWqR11EI698EVoD+4mLKy4+Nz9Or1XuQxhbzxI49pgmbqn6A6NoD7JkgeeD7RD9ZveOtQK6BLnqNrCQP664cRToP8PswmHH/xIuiEprQfbXN+WLG/xOi9M7UGc9UJHg/9QzkmmES9gr/ICEGUzdh1FfUM/nTFLw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1641542136688720.8419488124345; Thu, 6 Jan 2022 23:55:36 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-372-5ryMg-eEMQOFwuNs3BaQng-1; Fri, 07 Jan 2022 02:55:32 -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 09BB8100CFB6; Fri, 7 Jan 2022 07:55:27 +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 54C8210589CD; Fri, 7 Jan 2022 07:55:26 +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 CBF0F1802FE8; Fri, 7 Jan 2022 07:55:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 2077tNKw031772 for ; Fri, 7 Jan 2022 02:55:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id B87FF16A48; Fri, 7 Jan 2022 07:55:23 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BB871F2E5 for ; Fri, 7 Jan 2022 07:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641542135; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CmtGKbGBZTCXTXrbshB7834VzADleEo3yRs0LL22y8k=; b=F16oZ38gSYLPm02ygPZP7rbAJ9NAUkYWrEDPMERJp/jJ0Iqz2GA0GNH15g+Gq1SBVfalgY h2DEJjs2Yi2xi9K1wUYnLuUJwG6FN7GZVDIcvpQNCBnCxzSHkyI7nw2yLM24JylBvNSzwG 1xCeDzeEfVmh1acO1Kk5bx3gGCeIyVo= X-MC-Unique: 5ryMg-eEMQOFwuNs3BaQng-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virprocess: Provide non-Linux stubs for virProcessGet{Stat, Sched}Info Date: Fri, 7 Jan 2022 08:55:16 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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) X-ZM-MESSAGEID: 1641542138588100001 Content-Type: text/plain; charset="utf-8" Both virProcessGetStatInfo() and virProcessGetSchedInfo() are Linux centric. Provide stubs for non-Linux platforms. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- src/util/virprocess.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index c74bd16fe6..5788faea9c 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -1766,6 +1766,7 @@ virProcessGetStat(pid_t pid, } =20 =20 +#ifdef __linux__ int virProcessGetStatInfo(unsigned long long *cpuTime, int *lastCpu, @@ -1873,3 +1874,26 @@ virProcessGetSchedInfo(unsigned long long *cpuWait, =20 return 0; } + +#else +int +virProcessGetStatInfo(unsigned long long *cpuTime G_GNUC_UNUSED, + int *lastCpu G_GNUC_UNUSED, + long *vm_rss G_GNUC_UNUSED, + pid_t pid G_GNUC_UNUSED, + pid_t tid G_GNUC_UNUSED) +{ + errno =3D ENOSYS; + return -1; +} + +int +virProcessGetSchedInfo(unsigned long long *cpuWait G_GNUC_UNUSED, + pid_t pid G_GNUC_UNUSED, + pid_t tid G_GNUC_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("scheduler information is not supported on this= platform")); + return -1; +} +#endif /* __linux__ */ --=20 2.34.1