[PATCH 01/10] qemu: command: Set port number only for TCP transport

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

 



Setting port number for protocols using UNIX transport does not make
sense. Move the setter code to the appropriate block.
---
 src/qemu/qemu_command.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3fe291863..f77ae91c3 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -949,6 +949,10 @@ qemuBuildNetworkDriveURI(virStorageSourcePtr src,
         goto cleanup;

     if (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP) {
+        if ((uri->port = qemuNetworkDriveGetPort(src->protocol,
+                                                 src->hosts->port)) < 0)
+            goto cleanup;
+
         if (VIR_STRDUP(uri->scheme,
                        virStorageNetProtocolTypeToString(src->protocol)) < 0)
             goto cleanup;
@@ -959,10 +963,6 @@ qemuBuildNetworkDriveURI(virStorageSourcePtr src,
             goto cleanup;
     }

-    if ((uri->port = qemuNetworkDriveGetPort(src->protocol,
-                                             src->hosts->port)) < 0)
-        goto cleanup;
-
     if (src->path) {
         if (src->volume) {
             if (virAsprintf(&uri->path, "/%s%s",
-- 
2.12.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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