[PATCH 8/9] qemuFDPassTransferCommand: Remove return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that the 'direct' mode was separated and thus we don't have any
possible error case we can stop returning any values and simplify
callers.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 18 +++++-------------
 src/qemu/qemu_fd.c      |  6 ++----
 src/qemu/qemu_fd.h      |  2 +-
 3 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 828c7c38f5..114c737b3d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1513,9 +1513,7 @@ qemuBuildChardevCommand(virCommand *cmd,
         break;

     case VIR_DOMAIN_CHR_TYPE_FILE:
-        if (qemuFDPassTransferCommand(chrSourcePriv->sourcefd, cmd) < 0)
-            return -1;
-
+        qemuFDPassTransferCommand(chrSourcePriv->sourcefd, cmd);
         break;

     case VIR_DOMAIN_CHR_TYPE_UNIX:
@@ -1543,8 +1541,7 @@ qemuBuildChardevCommand(virCommand *cmd,
         return -1;
     }

-    if (qemuFDPassTransferCommand(chrSourcePriv->logfd, cmd) < 0)
-        return -1;
+    qemuFDPassTransferCommand(chrSourcePriv->logfd, cmd);

     if (!(charstr = qemuBuildChardevStr(dev, charAlias)))
         return -1;
@@ -8918,9 +8915,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver,
         qemuFDPassDirectTransferCommand(n->data, cmd);

     qemuFDPassDirectTransferCommand(netpriv->slirpfd, cmd);
-
-    if (qemuFDPassTransferCommand(netpriv->vdpafd, cmd) < 0)
-        return -1;
+    qemuFDPassTransferCommand(netpriv->vdpafd, cmd);

     if (!(hostnetprops = qemuBuildHostNetProps(net)))
         goto cleanup;
@@ -9810,11 +9805,8 @@ qemuBuildTPMCommandLine(virCommand *cmd,
         return -1;
     }

-    if (qemuFDPassTransferCommand(passtpm, cmd) < 0)
-        return -1;
-
-    if (qemuFDPassTransferCommand(passcancel, cmd) < 0)
-        return -1;
+    qemuFDPassTransferCommand(passtpm, cmd);
+    qemuFDPassTransferCommand(passcancel, cmd);

     if (!(tpmdevstr = qemuBuildTPMBackendStr(tpm, passtpm, passcancel)))
         return -1;
diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c
index cff2428727..b7dd66bdc7 100644
--- a/src/qemu/qemu_fd.c
+++ b/src/qemu/qemu_fd.c
@@ -133,14 +133,14 @@ qemuFDPassAddFD(qemuFDPass *fdpass,
  * Pass the fds in @fdpass to a commandline object @cmd. @fdpass may be NULL
  * in which case this is a no-op.
  */
-int
+void
 qemuFDPassTransferCommand(qemuFDPass *fdpass,
                           virCommand *cmd)
 {
     size_t i;

     if (!fdpass)
-        return 0;
+        return;

     for (i = 0; i < fdpass->nfds; i++) {
         g_autofree char *arg = g_strdup_printf("set=%u,fd=%d,opaque=%s",
@@ -152,8 +152,6 @@ qemuFDPassTransferCommand(qemuFDPass *fdpass,
         fdpass->fds[i].fd = -1;
         virCommandAddArgList(cmd, "-add-fd", arg, NULL);
     }
-
-    return 0;
 }


diff --git a/src/qemu/qemu_fd.h b/src/qemu/qemu_fd.h
index dbb4ab0aa5..6f165b6be9 100644
--- a/src/qemu/qemu_fd.h
+++ b/src/qemu/qemu_fd.h
@@ -39,7 +39,7 @@ qemuFDPassAddFD(qemuFDPass *fdpass,
                 int *fd,
                 const char *suffix);

-int
+void
 qemuFDPassTransferCommand(qemuFDPass *fdpass,
                           virCommand *cmd);

-- 
2.35.3




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux