]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Rename virPid{Abort, Wait} to virProcess{Abort, Wait}
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 12 Sep 2013 16:00:01 +0000 (17:00 +0100)
committerEric Blake <eblake@redhat.com>
Thu, 19 Sep 2013 03:10:20 +0000 (21:10 -0600)
Change "Pid" to "Process" to align with the virProcessKill
API naming prefix

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 0fb58ef5cd477cf9a0efdd966a22440ef087a2af)
Signed-off-by: Eric Blake <eblake@redhat.com>
Conflicts:
src/util/util.c
src/lxc/lxc_container.c
src/lxc/lxc_controller.c

daemon/libvirtd.c
src/libvirt_private.syms
src/lxc/lxc_container.c
src/lxc/lxc_controller.c
src/rpc/virnetsocket.c
src/util/command.c
src/util/command.h
src/util/util.c
tests/testutils.c

index 5d57b50d2ca874b737ac9abb5ed41d7a4e8d2ba5..e9db433e7f1113caf36fcf37205a32e60db19373 100644 (file)
@@ -192,7 +192,7 @@ static int daemonForkIntoBackground(const char *argv0)
             VIR_FORCE_CLOSE(statuspipe[1]);
 
             /* We wait to make sure the first child forked successfully */
-            if (virPidWait(pid, NULL) < 0)
+            if (virProcessWait(pid, NULL) < 0)
                 goto error;
 
             /* If we get here, then the grandchild was spawned, so we
index 8328fcffbe2d25b9e82828ee2600b898d94f13e1..5d8ff7b1eebbfcc8a7ff3425e43a48eb74cd9e52 100644 (file)
@@ -144,8 +144,8 @@ virCommandTranslateStatus;
 virCommandWait;
 virCommandWriteArgLog;
 virFork;
-virPidAbort;
-virPidWait;
+virProcessAbort;
+virProcessWait;
 virRun;
 
 
index 0636eabce41c2fe128912b6240d9c3df65ec94ed..442aa24a10d978526229661bab5260491debb3e9 100644 (file)
@@ -1519,7 +1519,7 @@ int lxcContainerAvailable(int features)
         VIR_DEBUG("clone call returned %s, container support is not enabled",
                   virStrerror(errno, ebuf, sizeof(ebuf)));
         return -1;
-    } else if (virPidWait(cpid, NULL) < 0) {
+    } else if (virProcessWait(cpid, NULL) < 0) {
         return -1;
     }
 
index 26b3115b9d7effc3570efb0b94cc8be33eb32b3c..b5cec3dfb7ed17a9380397372e7594301c6e5352 100644 (file)
@@ -1626,7 +1626,7 @@ cleanup:
         VIR_FORCE_CLOSE(loopDevs[i]);
     VIR_FREE(loopDevs);
 
-    virPidAbort(container);
+    virProcessAbort(container);
 
     return rc;
 }
index fa16d31f204905bc87e4ce9330631e7b6461f7d0..040090ec00cb8a4b32980d522521a1dbf92e8d4c 100644 (file)
@@ -752,7 +752,7 @@ void virNetSocketFree(virNetSocketPtr sock)
     VIR_FORCE_CLOSE(sock->fd);
     VIR_FORCE_CLOSE(sock->errfd);
 
-    virPidAbort(sock->pid);
+    virProcessAbort(sock->pid);
 
     VIR_FREE(sock->localAddrStr);
     VIR_FREE(sock->remoteAddrStr);
index eaa9f167533b30871be20f7a6a5569d73ebf40d9..434065959ce0bcbd426a689df6f0624f54fb780c 100644 (file)
@@ -1652,7 +1652,7 @@ virCommandToString(virCommandPtr cmd)
  * @status: child exit status to translate
  *
  * Translate an exit status into a malloc'd string.  Generic helper
- * for virCommandRun(), virCommandWait(), virRun(), and virPidWait()
+ * for virCommandRun(), virCommandWait(), virRun(), and virProcessWait()
  * status argument, as well as raw waitpid().
  */
 char *
@@ -2114,7 +2114,7 @@ virCommandHook(void *data)
  * for pid.  While cmd is still in scope, you may reap the child via
  * virCommandWait or virCommandAbort.  But after virCommandFree, if
  * you have not yet reaped the child, then it continues to run until
- * you call virPidWait or virPidAbort.
+ * you call virProcessWait or virProcessAbort.
  */
 int
 virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
@@ -2207,7 +2207,7 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
 
 
 /**
- * virPidWait:
+ * virProcessWait:
  * @pid: child to wait on
  * @exitstatus: optional status collection
  *
@@ -2218,7 +2218,7 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
  * child must exit with status 0 for this to succeed.
  */
 int
-virPidWait(pid_t pid, int *exitstatus)
+virProcessWait(pid_t pid, int *exitstatus)
 {
     int ret;
     int status;
@@ -2288,13 +2288,13 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
         return -1;
     }
 
-    /* If virPidWait reaps pid but then returns failure because
+    /* If virProcessWait reaps pid but then returns failure because
      * exitstatus was NULL, then a second virCommandWait would risk
      * calling waitpid on an unrelated process.  Besides, that error
      * message is not as detailed as what we can provide.  So, we
-     * guarantee that virPidWait only fails due to failure to wait,
+     * guarantee that virProcessWait only fails due to failure to wait,
      * and repeat the exitstatus check code ourselves.  */
-    ret = virPidWait(cmd->pid, exitstatus ? exitstatus : &status);
+    ret = virProcessWait(cmd->pid, exitstatus ? exitstatus : &status);
     if (ret == 0) {
         cmd->pid = -1;
         cmd->reap = false;
@@ -2316,7 +2316,7 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
 
 #ifndef WIN32
 /**
- * virPidAbort:
+ * virProcessAbort:
  * @pid: child process to kill
  *
  * Abort a child process if PID is positive and that child is still
@@ -2326,7 +2326,7 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
  * this does nothing.
  */
 void
-virPidAbort(pid_t pid)
+virProcessAbort(pid_t pid)
 {
     int saved_errno;
     int ret;
@@ -2390,13 +2390,13 @@ virCommandAbort(virCommandPtr cmd)
 {
     if (!cmd || cmd->pid == -1)
         return;
-    virPidAbort(cmd->pid);
+    virProcessAbort(cmd->pid);
     cmd->pid = -1;
     cmd->reap = false;
 }
 #else /* WIN32 */
 void
-virPidAbort(pid_t pid)
+virProcessAbort(pid_t pid)
 {
     /* Not yet ported to mingw.  Any volunteers?  */
     VIR_DEBUG("failed to reap child %lld, abandoning it", (long long)pid);
@@ -2553,7 +2553,7 @@ int virCommandHandshakeNotify(virCommandPtr cmd)
  *
  * Release all resources.  The only exception is that if you called
  * virCommandRunAsync with a non-null pid, then the asynchronous child
- * is not reaped, and you must call virPidWait() or virPidAbort() yourself.
+ * is not reaped, and you must call virProcessWait() or virProcessAbort() yourself.
  */
 void
 virCommandFree(virCommandPtr cmd)
index 07aa0b32e94bc6574cd546d2006fe098fdb31de2..d8a8c83c8a849354ca58940d9cb57ad16834b327 100644 (file)
@@ -148,8 +148,8 @@ int virCommandRun(virCommandPtr cmd,
 int virCommandRunAsync(virCommandPtr cmd,
                        pid_t *pid) ATTRIBUTE_RETURN_CHECK;
 
-int virPidWait(pid_t pid,
-               int *exitstatus) ATTRIBUTE_RETURN_CHECK;
+int virProcessWait(pid_t pid,
+                   int *exitstatus) ATTRIBUTE_RETURN_CHECK;
 
 int virCommandWait(virCommandPtr cmd,
                    int *exitstatus) ATTRIBUTE_RETURN_CHECK;
@@ -162,7 +162,7 @@ int virCommandHandshakeWait(virCommandPtr cmd)
 int virCommandHandshakeNotify(virCommandPtr cmd)
     ATTRIBUTE_RETURN_CHECK;
 
-void virPidAbort(pid_t pid);
+void virProcessAbort(pid_t pid);
 
 void virCommandAbort(virCommandPtr cmd);
 
index bb155184bff180c8776047f2de93371d7e69d558..e1f8d1e36fc4cee529b1ff095595992710219a6d 100644 (file)
@@ -718,10 +718,10 @@ virFileAccessibleAs(const char *path, int mode,
     }
 
     if (pid) { /* parent */
-        if (virPidWait(pid, &status) < 0) {
-            /* virPidWait() already
+        if (virProcessWait(pid, &status) < 0) {
+            /* virProcessWait() already
              * reported error */
-                return -1;
+            return -1;
         }
 
         if (!WIFEXITED(status)) {
index 6eb40ed6e2f318f8e459ca83046119b28a11adda..63bec5206f332bb4120486249c6cff64160abef0 100644 (file)
@@ -314,7 +314,7 @@ virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen)
         VIR_FORCE_CLOSE(pipefd[1]);
         len = virFileReadLimFD(pipefd[0], maxlen, buf);
         VIR_FORCE_CLOSE(pipefd[0]);
-        if (virPidWait(pid, NULL) < 0)
+        if (virProcessWait(pid, NULL) < 0)
             return -1;
 
         return len;
@@ -684,7 +684,7 @@ int virtTestMain(int argc,
             } else {
                 int i, status;
                 for (i = 0 ; i < mp ; i++) {
-                    if (virPidWait(workers[i], NULL) < 0)
+                    if (virProcessWait(workers[i], NULL) < 0)
                         ret = EXIT_FAILURE;
                 }
                 VIR_FREE(workers);