From nobody Wed Feb 11 10:04:38 2026 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.zoho.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 1490382330256381.22555445078956; Fri, 24 Mar 2017 12:05:30 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id CA77A6AAE9; Fri, 24 Mar 2017 19:05:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9BBA260BEF; Fri, 24 Mar 2017 19:05:29 +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 45B4C5EC6C; Fri, 24 Mar 2017 19:05:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2OJ0gMT019233 for ; Fri, 24 Mar 2017 15:00:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0EC927D569; Fri, 24 Mar 2017 19:00:42 +0000 (UTC) Received: from caroline.brq.redhat.com (dhcp129-198.brq.redhat.com [10.34.129.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 898EA19630 for ; Fri, 24 Mar 2017 19:00:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CA77A6AAE9 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CA77A6AAE9 From: Martin Kletzander To: libvir-list@redhat.com Date: Fri, 24 Mar 2017 20:00:06 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 18/23] util: Fix naming in util/virnodesuspend 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: , MIME-Version: 1.0 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 24 Mar 2017 19:05:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" That file has only two exported files and each one of them has different naming. virNode is what all the other files use, so let's use it. It wasn't used before because the clash with public API naming, so let's fix that by shortening the name (there is no other private variant of it anyway). Signed-off-by: Martin Kletzander --- src/libvirt_private.syms | 2 +- src/lxc/lxc_driver.c | 2 +- src/qemu/qemu_driver.c | 2 +- src/uml/uml_driver.c | 2 +- src/util/virnodesuspend.c | 20 +++++++++++--------- src/util/virnodesuspend.h | 6 +++--- src/xen/xen_driver.c | 2 +- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 06de179554ab..0d3a68a92b87 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2170,7 +2170,7 @@ virNetlinkStartup; # util/virnodesuspend.h -nodeSuspendForDuration; +virNodeSuspend; virNodeSuspendGetTargetMask; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index ecd5fbdd4de1..27b4b75d8b0f 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -5342,7 +5342,7 @@ lxcNodeSuspendForDuration(virConnectPtr conn, if (virNodeSuspendForDurationEnsureACL(conn) < 0) return -1; - return nodeSuspendForDuration(target, duration, flags); + return virNodeSuspend(target, duration, flags); } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 98f0586ce26b..2adbd167b45f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18402,7 +18402,7 @@ qemuNodeSuspendForDuration(virConnectPtr conn, if (virNodeSuspendForDurationEnsureACL(conn) < 0) return -1; - return nodeSuspendForDuration(target, duration, flags); + return virNodeSuspend(target, duration, flags); } static int diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index f03fdbf68fd6..532ce3b1f347 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -2877,7 +2877,7 @@ umlNodeSuspendForDuration(virConnectPtr conn, if (virNodeSuspendForDurationEnsureACL(conn) < 0) return -1; - return nodeSuspendForDuration(target, duration, flags); + return virNodeSuspend(target, duration, flags); } diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 71b2d4cb7d2b..0af0908e4ae1 100644 --- a/src/util/virnodesuspend.c +++ b/src/util/virnodesuspend.c @@ -96,23 +96,23 @@ static int virNodeSuspendSetNodeWakeup(unsigned long lo= ng alarmTime) } /** - * virNodeSuspend: + * virNodeSuspendHelper: * @cmdString: pointer to the command string this thread has to execute. * * Actually perform the suspend operation by invoking the command. * Give a short delay before executing the command so as to give a chance - * to virNodeSuspendForDuration() to return the status to the caller. + * to virNodeSuspend() to return the status to the caller. * If we don't give this delay, that function will not be able to return * the status, since the suspend operation would have begun and hence no * data can be sent through the connection to the caller. However, with * this delay added, the status return is best-effort only. */ -static void virNodeSuspend(void *cmdString) +static void virNodeSuspendHelper(void *cmdString) { virCommandPtr suspendCmd =3D virCommandNew((const char *)cmdString); /* - * Delay for sometime so that the function nodeSuspendForDuration() + * Delay for sometime so that the function virNodeSuspend() * can return the status to the caller. */ sleep(SUSPEND_DELAY); @@ -131,7 +131,7 @@ static void virNodeSuspend(void *cmdString) } /** - * nodeSuspendForDuration: + * virNodeSuspend: * @conn: pointer to the hypervisor connection * @target: the state to which the host must be suspended to - * VIR_NODE_SUSPEND_TARGET_MEM (Suspend-to-RAM), @@ -157,9 +157,9 @@ static void virNodeSuspend(void *cmdString) * -1 if suspending the node is not supported, or if a previous suspend * operation is still in progress. */ -int nodeSuspendForDuration(unsigned int target, - unsigned long long duration, - unsigned int flags) +int virNodeSuspend(unsigned int target, + unsigned long long duration, + unsigned int flags) { static virThread thread; const char *cmdString =3D NULL; @@ -219,7 +219,9 @@ int nodeSuspendForDuration(unsigned int target, if (virNodeSuspendSetNodeWakeup(duration) < 0) goto cleanup; - if (virThreadCreate(&thread, false, virNodeSuspend, (void *)cmdString)= < 0) { + if (virThreadCreate(&thread, false, + virNodeSuspendHelper, + (void *)cmdString) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Failed to create thread to suspend the host")); goto cleanup; diff --git a/src/util/virnodesuspend.h b/src/util/virnodesuspend.h index b5f67dde0c31..85941bf1ab1e 100644 --- a/src/util/virnodesuspend.h +++ b/src/util/virnodesuspend.h @@ -25,9 +25,9 @@ # include "internal.h" -int nodeSuspendForDuration(unsigned int target, - unsigned long long duration, - unsigned int flags); +int virNodeSuspend(unsigned int target, + unsigned long long duration, + unsigned int flags); int virNodeSuspendGetTargetMask(unsigned int *bitmask); diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 5a94ad79e64c..7a2f4a1a60f0 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -2596,7 +2596,7 @@ xenUnifiedNodeSuspendForDuration(virConnectPtr conn, if (virNodeSuspendForDurationEnsureACL(conn) < 0) return -1; - return nodeSuspendForDuration(target, duration, flags); + return virNodeSuspend(target, duration, flags); } --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list