From: Peter Krempa Date: Fri, 7 Jul 2017 13:29:07 +0000 (+0200) Subject: qemu: command: Set port number only for TCP transport X-Git-Tag: v3.6.0-rc1~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbf06d907eac27e266cc9c2437a05fa7dc0ac696;p=thirdparty%2Flibvirt.git qemu: command: Set port number only for TCP transport Setting port number for protocols using UNIX transport does not make sense. Move the setter code to the appropriate block. --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e290abff63..3f4108a548 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",