]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Fix naming in util/virnodesuspend
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 7 Mar 2017 09:44:06 +0000 (10:44 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 27 Mar 2017 11:13:29 +0000 (13:13 +0200)
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 <mkletzan@redhat.com>
src/libvirt_private.syms
src/lxc/lxc_driver.c
src/qemu/qemu_driver.c
src/uml/uml_driver.c
src/util/virnodesuspend.c
src/util/virnodesuspend.h
src/xen/xen_driver.c

index 0365b6251976559dfd68a962c033743c6b9ba7f7..75c4777539b83077b0cc967decdb4bad9dd07eb6 100644 (file)
@@ -2174,7 +2174,7 @@ virNetlinkStartup;
 
 
 # util/virnodesuspend.h
-nodeSuspendForDuration;
+virNodeSuspend;
 virNodeSuspendGetTargetMask;
 
 
index ecd5fbdd4de16f6ce27d5720400349b436e9f4c9..27b4b75d8b0fb82749eaa6d427973546c601fa8d 100644 (file)
@@ -5342,7 +5342,7 @@ lxcNodeSuspendForDuration(virConnectPtr conn,
     if (virNodeSuspendForDurationEnsureACL(conn) < 0)
         return -1;
 
-    return nodeSuspendForDuration(target, duration, flags);
+    return virNodeSuspend(target, duration, flags);
 }
 
 
index 824b9a569e600d8ba7461cb32a6726f0ab826de1..6d95abea2cdf219fd9b0f0d71a2aeb85300c3c41 100644 (file)
@@ -18400,7 +18400,7 @@ qemuNodeSuspendForDuration(virConnectPtr conn,
     if (virNodeSuspendForDurationEnsureACL(conn) < 0)
         return -1;
 
-    return nodeSuspendForDuration(target, duration, flags);
+    return virNodeSuspend(target, duration, flags);
 }
 
 static int
index f03fdbf68fd62049fbc8f6e504ecdf78a67ab1e2..532ce3b1f3479fe269ae00c5514c4c6c0de4486d 100644 (file)
@@ -2877,7 +2877,7 @@ umlNodeSuspendForDuration(virConnectPtr conn,
     if (virNodeSuspendForDurationEnsureACL(conn) < 0)
         return -1;
 
-    return nodeSuspendForDuration(target, duration, flags);
+    return virNodeSuspend(target, duration, flags);
 }
 
 
index 71b2d4cb7d2b989a4696b9d3bbe775e5e57cf1dc..0af0908e4ae118565ecbb4387ca52f98679d8b6d 100644 (file)
@@ -96,23 +96,23 @@ static int virNodeSuspendSetNodeWakeup(unsigned long long 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 = 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 = 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;
index b5f67dde0c31f2176b7aee35bf611271e3e08424..85941bf1ab1ee01850c1c2c27f482bf851852418 100644 (file)
@@ -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);
 
index 5a94ad79e64c94ca40abef686f6bd85b7ea411c7..7a2f4a1a60f044c75947e6c54861c8dabeba145b 100644 (file)
@@ -2596,7 +2596,7 @@ xenUnifiedNodeSuspendForDuration(virConnectPtr conn,
     if (virNodeSuspendForDurationEnsureACL(conn) < 0)
         return -1;
 
-    return nodeSuspendForDuration(target, duration, flags);
+    return virNodeSuspend(target, duration, flags);
 }