[Libguestfs] [PATCH libnbd] api: Rename nbd_kill_command -> nbd_kill_subprocess.

Richard W.M. Jones rjones at redhat.com
Thu Aug 15 12:50:39 UTC 2019


This is a simple renaming to avoid confusion over "command" when used
to mean an asynchronous request to the server and "command" meaning
the subprocess forked previously by libnbd.
---
 generator/generator       | 4 ++--
 lib/handle.c              | 2 +-
 tests/closure-lifetimes.c | 4 ++--
 tests/server-death.c      | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/generator/generator b/generator/generator
index 13cb0b9..6cc06cc 100755
--- a/generator/generator
+++ b/generator/generator
@@ -1315,7 +1315,7 @@ Run the command as a subprocess and connect to it over
 stdin/stdout.  This is for use with NBD servers which can
 behave like inetd clients, such as C<nbdkit --single>.
 
-See also L<nbd_kill_command(3)>.";
+See also L<nbd_kill_subprocess(3)>.";
   };
 
   "is_read_only", {
@@ -2249,7 +2249,7 @@ The release number is incremented for each release along a particular
 branch.";
   };
 
-  "kill_command", {
+  "kill_subprocess", {
     default_call with
     args = [ Int "signum" ]; ret = RErr;
     shortdesc = "kill server running as a subprocess";
diff --git a/lib/handle.c b/lib/handle.c
index d599eef..b508744 100644
--- a/lib/handle.c
+++ b/lib/handle.c
@@ -254,7 +254,7 @@ nbd_unlocked_get_version (struct nbd_handle *h)
 }
 
 int
-nbd_unlocked_kill_command (struct nbd_handle *h, int signum)
+nbd_unlocked_kill_subprocess (struct nbd_handle *h, int signum)
 {
   if (h->pid == -1) {
     set_error (ESRCH, "no subprocess exists");
diff --git a/tests/closure-lifetimes.c b/tests/closure-lifetimes.c
index 5a7cd9c..70788b6 100644
--- a/tests/closure-lifetimes.c
+++ b/tests/closure-lifetimes.c
@@ -143,7 +143,7 @@ main (int argc, char *argv[])
   assert (read_cb_freed == 1);
   assert (completion_cb_freed == 1);
 
-  nbd_kill_command (nbd, 0);
+  nbd_kill_subprocess (nbd, 0);
   nbd_close (nbd);
 
   /* Test command callbacks are freed if the handle is closed without
@@ -162,7 +162,7 @@ main (int argc, char *argv[])
                                                                  .free = completion_cb_free },
                                      0);
   if (cookie == -1) NBD_ERROR;
-  nbd_kill_command (nbd, 0);
+  nbd_kill_subprocess (nbd, 0);
   nbd_close (nbd);
 
   assert (read_cb_freed == 1);
diff --git a/tests/server-death.c b/tests/server-death.c
index f572eab..0e9add0 100644
--- a/tests/server-death.c
+++ b/tests/server-death.c
@@ -102,8 +102,8 @@ main (int argc, char *argv[])
    * actually exiting), although it's a race whether our signal
    * arrives while nbdkit has a pending transaction.
    */
-  if (nbd_kill_command (nbd, SIGKILL) == -1) {
-    fprintf (stderr, "%s: test failed: nbd_kill_command: %s\n", argv[0],
+  if (nbd_kill_subprocess (nbd, SIGKILL) == -1) {
+    fprintf (stderr, "%s: test failed: nbd_kill_subprocess: %s\n", argv[0],
              nbd_get_error ());
     exit (EXIT_FAILURE);
   }
-- 
2.22.0




More information about the Libguestfs mailing list