From nobody Thu Apr 18 14:45:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 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=1596023030; cv=none; d=zohomail.com; s=zohoarc; b=EAa5FRMj1FlvCRBSGtGka41VonUWMnAf26a00dHzkOVZUzavIMASGdufFgEjfvTz3u+HJQTkaCBKKJg83oNdY8Dk6RZo0j5ACOSYLB52tWiV6gCUUF/FwuAQTDiM1v9Gxzk6/4VPAjjUFZsUkslz9s15OaJz2hSro3u4XVoz4ew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596023030; 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=gmrYUoXGbJLWuW8yxLJxsZuUFfA+4jDjEdkxe+W72zY=; b=KUS6Re1/4NO445sBm1HURFLJMm9435+kDG7+AeeHwhJwGevAXkBAJP/33Ip2kbIXX/doxtHDUy3lpb3UURAnqQUGFuVP7BJTL0DQo+I8Qe+Ip4fXQsAQqw8dAUVIcWA42YlssqYzl03llQcqqaD3MVPjZSJXlA4eL6KsXOhXCnQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 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-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 15960230302866.5932320581680415; Wed, 29 Jul 2020 04:43:50 -0700 (PDT) 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-449-C548SQ0hP5yvLGPrJHhEwQ-1; Wed, 29 Jul 2020 07:43:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DE2980BCA2; Wed, 29 Jul 2020 11:43:41 +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 7B37F70110; Wed, 29 Jul 2020 11:43:41 +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 4B1A81809563; Wed, 29 Jul 2020 11:43:41 +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 06TBhTKh002547 for ; Wed, 29 Jul 2020 07:43:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3D3E19741; Wed, 29 Jul 2020 11:43:29 +0000 (UTC) Received: from carol.localdomain (unknown [10.40.195.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3E5919C71; Wed, 29 Jul 2020 11:43:26 +0000 (UTC) Received: from carol.redhat.com (carol.k8r.cz [127.0.0.1]) by carol.localdomain (Postfix) with ESMTP id 5312BC20023; Wed, 29 Jul 2020 13:43:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596023029; 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=gmrYUoXGbJLWuW8yxLJxsZuUFfA+4jDjEdkxe+W72zY=; b=Dw+yeofcFmVJaaebapHQU0tG1mEy6XYyExkd7cofgvI4CSL1mVHjernG8vO3AqOPE/s6W2 DVHN/0tvtDfUlOuEP662QAIXaZqemKlzUsWi8PkzlyMd2srgRVhKmAmJhxlx4+lvlb7xp+ rr3uWL0IM5sV4Oqlw4SdWyD+j1ypkTI= X-MC-Unique: C548SQ0hP5yvLGPrJHhEwQ-1 From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH v3 1/3 (for 6.6.0)] resctrl: Use exclusive lock for /sys/fs/resctrl Date: Wed, 29 Jul 2020 13:43:12 +0200 Message-Id: <41a2fa9bcc8babf19a663dcdde2ad040063f7972.1596021883.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani 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.12 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" That's the way it should've been all the time. It was originally the case,= but then the rework to virFileFlock() made the function ambiguous when it was created in commit 5a0a5f7fb5f5, and due to that it was misused in commit 657ddeff2313 and since then the lock being taken was shared rather than exclusive. Signed-off-by: Martin Kletzander --- src/util/virresctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 3563fc560db5..9b78a6cb159b 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -463,7 +463,7 @@ virResctrlLockWrite(void) return -1; } =20 - if (virFileFlock(fd, true, true) < 0) { + if (virFileFlock(fd, true, false) < 0) { virReportSystemError(errno, "%s", _("Cannot lock resctrl")); VIR_FORCE_CLOSE(fd); return -1; --=20 2.28.0 From nobody Thu Apr 18 14:45:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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=1596023025; cv=none; d=zohomail.com; s=zohoarc; b=boY0kD3RQHQIGl62nfGzz4LzAmsTkHZJrLfXyrI9WW1z8Sva2cO7KLF3O3TWcbMRg2PVkh0R9nS/e8OKwqru2CpHMm71N6orl+EXnUjz/0EpztNo1tMDf1F/QaaeSFwLsH/1NYkVSd+2G0asgo3dTACCevWZtx0F1OQsiYNdOIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596023025; 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=Lq8EHz7l+/e/R9ZzMgebRHehFiBBA/O2TS1eYfQTEKo=; b=bH3Vn8iZwtwqArWt/YNscIO+nXGtvU9hmNEziJK0K5gMuWhEFk8sZyal7Er0diioxofSGxxj22nwqRbjAHIi/E5zDCLX9nno7hIOhKuWYF6Jlan9MVZQEyOZYCFARFJYWwJSqIY7I/Mvr+kAKD6w21H0EB0PGKwbanCEls/nHHY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1596023025269976.1171903386952; Wed, 29 Jul 2020 04:43:45 -0700 (PDT) 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-40-GwmdoKYBN4KxttEDMLeROw-1; Wed, 29 Jul 2020 07:43:41 -0400 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 09A5F1800D4A; Wed, 29 Jul 2020 11:43:34 +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 B2CD319C71; Wed, 29 Jul 2020 11:43:33 +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 BA96E1809547; Wed, 29 Jul 2020 11:43:30 +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 06TBhTUW002538 for ; Wed, 29 Jul 2020 07:43:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id C2A1771906; Wed, 29 Jul 2020 11:43:29 +0000 (UTC) Received: from carol.localdomain (unknown [10.40.195.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3CA771910; Wed, 29 Jul 2020 11:43:26 +0000 (UTC) Received: from carol.redhat.com (carol.k8r.cz [127.0.0.1]) by carol.localdomain (Postfix) with ESMTP id 53952C20024; Wed, 29 Jul 2020 13:43:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596023023; 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=Lq8EHz7l+/e/R9ZzMgebRHehFiBBA/O2TS1eYfQTEKo=; b=b063BODvC1wZwFGr/lB7r+q2t+WQzgX/PG3NLWPUDIuyewVzHTt1c7miMPVn05cSNRaAX4 MyONRDmMYJUFzNJbk5f6afllO4ZgHzar8TbWaxUtkcRlDGUcRH6OSzEJMKO0ODE0KYj6Ed +Fz7DEJcjeIINgdnkebSa9vofBEh6cs= X-MC-Unique: GwmdoKYBN4KxttEDMLeROw-1 From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH v3 2/3] util: Get rid of virFileFlock() Date: Wed, 29 Jul 2020 13:43:13 +0200 Message-Id: <9be9c7590cf02f176ea8623bd2fddb3cf7b183a2.1596021883.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani 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" It was created to get rid of conditional compilation in the resctrl code and make it usable anywhere else. However this is not something that is going = to be used in other places because it is not portable and resctrl is just very specific in this regard. And there is no reason why there could not be a preprocessor conditional in the resctrl code. Also the interface of virFileFlock() was very ambiguous which lead to some issues. Signed-off-by: Martin Kletzander Reviewed-by: J=C3=A1n Tomko --- src/libvirt_private.syms | 1 - src/util/virfile.c | 31 +------------------------------ src/util/virfile.h | 2 -- src/util/virresctrl.c | 17 +++++++++++++++-- 4 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index eea31a736def..fbbe07becbcf 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2074,7 +2074,6 @@ virFileFindHugeTLBFS; virFileFindMountPoint; virFileFindResource; virFileFindResourceFull; -virFileFlock; virFileFreeACLs; virFileGetACLs; virFileGetDefaultHugepage; diff --git a/src/util/virfile.c b/src/util/virfile.c index af150421e726..b1ca3adcff04 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -463,30 +463,9 @@ int virFileUnlock(int fd, off_t start, off_t len) } =20 =20 -/** - * virFileFlock: - * @fd: file descriptor to call flock on - * @lock: true for lock, false for unlock - * @shared: true if shared, false for exclusive, ignored if `@lock =3D=3D = false` - * - * This is just a simple wrapper around flock(2) that errors out on unsupp= orted - * platforms. - * - * The lock will be released when @fd is closed or this function is called= with - * `@lock =3D=3D false`. - * - * Returns 0 on success, -1 otherwise (with errno set) - */ -int virFileFlock(int fd, bool lock, bool shared) -{ - if (lock) - return flock(fd, shared ? LOCK_SH : LOCK_EX); - - return flock(fd, LOCK_UN); -} - #else /* WIN32 */ =20 + int virFileLock(int fd G_GNUC_UNUSED, bool shared G_GNUC_UNUSED, off_t start G_GNUC_UNUSED, @@ -505,14 +484,6 @@ int virFileUnlock(int fd G_GNUC_UNUSED, } =20 =20 -int virFileFlock(int fd G_GNUC_UNUSED, - bool lock G_GNUC_UNUSED, - bool shared G_GNUC_UNUSED) -{ - errno =3D ENOSYS; - return -1; -} - #endif /* WIN32 */ =20 =20 diff --git a/src/util/virfile.h b/src/util/virfile.h index cb0e586a7d11..2eec89598f6b 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -118,8 +118,6 @@ int virFileLock(int fd, bool shared, off_t start, off_t= len, bool waitForLock) int virFileUnlock(int fd, off_t start, off_t len) G_GNUC_NO_INLINE; =20 -int virFileFlock(int fd, bool lock, bool shared); - typedef int (*virFileRewriteFunc)(int fd, const void *opaque); int virFileRewrite(const char *path, mode_t mode, diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 9b78a6cb159b..2129630a190f 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -456,6 +456,8 @@ VIR_ONCE_GLOBAL_INIT(virResctrl); static int virResctrlLockWrite(void) { +#ifndef WIN32 + int fd =3D open(SYSFS_RESCTRL_PATH, O_RDONLY | O_CLOEXEC); =20 if (fd < 0) { @@ -463,13 +465,20 @@ virResctrlLockWrite(void) return -1; } =20 - if (virFileFlock(fd, true, false) < 0) { + if (flock(fd, LOCK_EX) < 0) { virReportSystemError(errno, "%s", _("Cannot lock resctrl")); VIR_FORCE_CLOSE(fd); return -1; } =20 return fd; + +#else /* WIN32 */ + + virReportSystemError(ENOSYS, "%s", _("Cannot lock resctrl")); + return -1; + +#endif } =20 =20 @@ -484,10 +493,14 @@ virResctrlUnlock(int fd) if (VIR_CLOSE(fd) < 0) { virReportSystemError(errno, "%s", _("Cannot close resctrl")); =20 +#ifndef WIN32 + /* Trying to save the already broken */ - if (virFileFlock(fd, false, false) < 0) + if (flock(fd, LOCK_UN) < 0) virReportSystemError(errno, "%s", _("Cannot unlock resctrl")); =20 +#endif + return -1; } =20 --=20 2.28.0 From nobody Thu Apr 18 14:45:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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=1596023030; cv=none; d=zohomail.com; s=zohoarc; b=Mov2woIEqU71YUSV1369McthQdZYzHaCObWe5NLzRUKmC4HbBDHNqQ18LQ5hIKY6aIdQGV+s5L9M0f5XFzR/g6+DSAm0eCJAq2IzzeM2ZSCigSAnNiEmZDQq2lVevw0upJrdxEQJ/5TRlbnI7lbpGaRqGqG9LFOMnFt9r/Nu6KY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596023030; 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=ELwroFyEDzRjDvXmVk882XVk13rStWoQz+byPl/A494=; b=Tz/wiH8tDIjH1NxaTMPH9gboySRZKoFnU4eIQ/7nQrctOyT3d5pE58efdA8wC6jT7uG/hD18GHwumTpjSkdlYwFDfzjaWFFNSCWGGdtlgHbrgAN6RiCe52JadbM/Ovj3/LiF+m2iicu1AohOzOKmhaIbE/xOhi4ugcy8Tw3h4RU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1596023030590304.55537323420367; Wed, 29 Jul 2020 04:43:50 -0700 (PDT) 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-136-b0rz4CbrOce30NcgqIioWg-1; Wed, 29 Jul 2020 07:43:46 -0400 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 9F85B1DE9; Wed, 29 Jul 2020 11:43:41 +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 7CC1310098AE; Wed, 29 Jul 2020 11:43:41 +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 4E87395A6D; Wed, 29 Jul 2020 11:43:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06TBhUA5002552 for ; Wed, 29 Jul 2020 07:43:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 57D695DA6B; Wed, 29 Jul 2020 11:43:30 +0000 (UTC) Received: from carol.localdomain (unknown [10.40.195.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C39EC5D9E8; Wed, 29 Jul 2020 11:43:26 +0000 (UTC) Received: from carol.redhat.com (carol.k8r.cz [127.0.0.1]) by carol.localdomain (Postfix) with ESMTP id 546E0C20025; Wed, 29 Jul 2020 13:43:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596023029; 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=ELwroFyEDzRjDvXmVk882XVk13rStWoQz+byPl/A494=; b=aPKfs+tEcM0cHruRmXe5j1BnbgZaM1z0jV0FwhLhQq3YUR+J+zqFfA8EhvT/1zK/6bsvgw j3i3+qT7P4OJjjpbpLI0D8WPpXbCmD3ZqTn5W8FeHOKIwPL0ZKCp9CW/UCH3J6GdoZhhcd VAZwkiFRSMTqXNR7RPtgFWPVbaWP5eM= X-MC-Unique: b0rz4CbrOce30NcgqIioWg-1 From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH v3 3/3] resctrl: Rename virResctrlLockWrite -> virResctrlLock Date: Wed, 29 Jul 2020 13:43:14 +0200 Message-Id: <71f9f72cec6b6e6f151ae60d6f6ef79a44099c5c.1596021883.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani 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 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" There is no distinction between Read/Write locks for resctrl from libvirt's point of view any more. Signed-off-by: Martin Kletzander Reviewed-by: Andrea Bolognani --- src/util/virresctrl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 2129630a190f..954e4fd506f7 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -454,7 +454,7 @@ VIR_ONCE_GLOBAL_INIT(virResctrl); =20 /* Common functions */ static int -virResctrlLockWrite(void) +virResctrlLock(void) { #ifndef WIN32 =20 @@ -2404,7 +2404,7 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl, if (STREQ(alloc->path, SYSFS_RESCTRL_PATH)) return 0; =20 - lockfd =3D virResctrlLockWrite(); + lockfd =3D virResctrlLock(); if (lockfd < 0) goto cleanup; =20 @@ -2597,7 +2597,7 @@ virResctrlMonitorCreate(virResctrlMonitorPtr monitor, if (virResctrlMonitorDeterminePath(monitor, machinename) < 0) return -1; =20 - lockfd =3D virResctrlLockWrite(); + lockfd =3D virResctrlLock(); if (lockfd < 0) return -1; =20 --=20 2.28.0