From nobody Sat Apr 27 21:11:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516902445870635.9080541321777; Thu, 25 Jan 2018 09:47:25 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0F7DBBB1; Thu, 25 Jan 2018 17:47:23 +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 1AB5E5D728; Thu, 25 Jan 2018 17:47:23 +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 EBA4B3FC73; Thu, 25 Jan 2018 17:47:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0PHiBi5003809 for ; Thu, 25 Jan 2018 12:44:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8750C60C4D; Thu, 25 Jan 2018 17:44:11 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id D672C60E39; Thu, 25 Jan 2018 17:44:07 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 25 Jan 2018 17:44:04 +0000 Message-Id: <20180125174404.32511-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Martin Kletzander Subject: [libvirt] [PATCH] resctl: stub out functions with Linux-only APIs used 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 25 Jan 2018 17:47:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 The flock() function and d_type field in struct dirent are not portable to the mingw platform. Signed-off-by: Daniel P. Berrang=C3=A9 --- * Pushed as CI build fix src/util/virresctrl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index e252aefe31..754820ee46 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -295,6 +295,7 @@ virResctrlAllocNew(void) =20 =20 /* Common functions */ +#ifdef __linux__ static int virResctrlLockInternal(int op) { @@ -321,6 +322,20 @@ virResctrlLockWrite(void) return virResctrlLockInternal(LOCK_EX); } =20 +#else + +static inline int +virResctrlLockWrite(void) +{ + virReportSystemError(ENOSYS, "%s", + _("resctrlfs not supported on this platform")); + return -1; +} + +#endif + + + =20 static int virResctrlUnlock(int fd) @@ -328,6 +343,7 @@ virResctrlUnlock(int fd) if (fd =3D=3D -1) return 0; =20 +#ifdef __linux__ /* The lock gets unlocked by closing the fd, which we need to do anywa= y in * order to clean up properly */ if (VIR_CLOSE(fd) < 0) { @@ -338,6 +354,7 @@ virResctrlUnlock(int fd) virReportSystemError(errno, "%s", _("Cannot unlock resctrlfs")= ); return -1; } +#endif /* ! __linux__ */ =20 return 0; } @@ -369,6 +386,8 @@ virResctrlInfoIsEmpty(virResctrlInfoPtr resctrl) } =20 =20 +#ifdef __linux__ + int virResctrlGetInfo(virResctrlInfoPtr resctrl) { @@ -495,6 +514,18 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl) return ret; } =20 +#else /* ! __linux__ */ + +int +virResctrlGetInfo(virResctrlInfoPtr resctrl ATTRIBUTE_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("Cache tune not supported on this platform")); + return -1; +} + +#endif /* ! __linux__ */ + =20 int virResctrlInfoGetCache(virResctrlInfoPtr resctrl, @@ -632,6 +663,8 @@ virResctrlAllocGetType(virResctrlAllocPtr resctrl, } =20 =20 +#ifdef __linux__ + static int virResctrlAllocUpdateMask(virResctrlAllocPtr resctrl, unsigned int level, @@ -659,6 +692,8 @@ virResctrlAllocUpdateMask(virResctrlAllocPtr resctrl, return virBitmapCopy(a_type->masks[cache], mask); } =20 +#endif + =20 static int virResctrlAllocUpdateSize(virResctrlAllocPtr resctrl, @@ -878,6 +913,8 @@ virResctrlAllocFormat(virResctrlAllocPtr resctrl) } =20 =20 +#ifdef __linux__ + static int virResctrlAllocParseProcessCache(virResctrlInfoPtr resctrl, virResctrlAllocPtr alloc, @@ -1180,7 +1217,17 @@ virResctrlAllocGetUnused(virResctrlInfoPtr resctrl) goto cleanup; } =20 +#else /* ! __linux__ */ + +virResctrlAllocPtr +virResctrlAllocGetUnused(virResctrlInfoPtr resctrl ATTRIBUTE_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("Cache tune not supported on this platform")); + return NULL; +} =20 +#endif /* ! __linux__ */ =20 static int virResctrlAllocSetMask(virResctrlAllocPerTypePtr a_type, --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list