]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Remove virCommandPassFDIndex()
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 13 May 2022 19:14:32 +0000 (14:14 -0500)
committerJonathon Jongsma <jjongsma@redhat.com>
Mon, 16 May 2022 14:29:47 +0000 (09:29 -0500)
The last use of this function was removed in commit 6d161bcc, so the
function is no longer used except as an internal implementation for
virCommandPassFD().

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/libvirt_private.syms
src/util/vircommand.c
src/util/vircommand.h

index 66f73e84aa68142076a0b4a1cfdc68d909567b97..d95c1817930cdf7dcb47f06344bc2199614eaa09 100644 (file)
@@ -2057,7 +2057,6 @@ virCommandNewArgs;
 virCommandNewVAList;
 virCommandNonblockingFDs;
 virCommandPassFD;
-virCommandPassFDIndex;
 virCommandRawStatus;
 virCommandRequireHandshake;
 virCommandRun;
index f3c26a2673c4d4c3210f893d56813d9ff04a360f..d78c666f2894d98d46b239fb50ebf88aff9f0de4 100644 (file)
@@ -1021,11 +1021,10 @@ virCommandNewVAList(const char *binary, va_list list)
         VIR_FORCE_CLOSE(fd)
 
 /**
- * virCommandPassFDIndex:
+ * virCommandPassFD:
  * @cmd: the command to modify
  * @fd: fd to reassign to the child
  * @flags: extra flags; binary-OR of virCommandPassFDFlags
- * @idx: pointer to fill with the index of the FD in the transfer set
  *
  * Transfer the specified file descriptor to the child, instead
  * of closing it on exec. @fd must not be one of the three
@@ -1036,7 +1035,7 @@ virCommandNewVAList(const char *binary, va_list list)
  * should cease using the @fd when this call completes
  */
 void
-virCommandPassFDIndex(virCommand *cmd, int fd, unsigned int flags, size_t *idx)
+virCommandPassFD(virCommand *cmd, int fd, unsigned int flags)
 {
     if (!cmd) {
         VIR_COMMAND_MAYBE_CLOSE_FD(fd, flags);
@@ -1052,29 +1051,6 @@ virCommandPassFDIndex(virCommand *cmd, int fd, unsigned int flags, size_t *idx)
     }
 
     virCommandFDSet(cmd, fd, flags);
-
-    if (idx)
-        *idx = cmd->npassfd - 1;
-}
-
-/**
- * virCommandPassFD:
- * @cmd: the command to modify
- * @fd: fd to reassign to the child
- * @flags: extra flags; binary-OR of virCommandPassFDFlags
- *
- * Transfer the specified file descriptor to the child, instead
- * of closing it on exec. @fd must not be one of the three
- * standard streams.
- *
- * If the flag VIR_COMMAND_PASS_FD_CLOSE_PARENT is set then fd will
- * be closed in the parent no later than Run/RunAsync/Free. The parent
- * should cease using the @fd when this call completes
- */
-void
-virCommandPassFD(virCommand *cmd, int fd, unsigned int flags)
-{
-    virCommandPassFDIndex(cmd, fd, flags, NULL);
 }
 
 /**
index c534a9bb1646df70f26bb97919d8b35a53c41f03..21ef8ff6638acc6dcf0fdb2975cf851ad8e85ee3 100644 (file)
@@ -56,11 +56,6 @@ void virCommandPassFD(virCommand *cmd,
                       int fd,
                       unsigned int flags) G_GNUC_NO_INLINE;
 
-void virCommandPassFDIndex(virCommand *cmd,
-                           int fd,
-                           unsigned int flags,
-                           size_t *idx) G_GNUC_NO_INLINE;
-
 void virCommandSetPidFile(virCommand *cmd,
                           const char *pidfile) ATTRIBUTE_NONNULL(2);