]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: command: Report error when formatting network source with protocol _NONE
authorPeter Krempa <pkrempa@redhat.com>
Tue, 24 Mar 2015 15:13:41 +0000 (16:13 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 26 Mar 2015 07:24:46 +0000 (08:24 +0100)
The function that formats the string for network drives would return
error code but did not set the error message when called on storage
source with VIR_STORAGE_NET_PROTOCOL_LAST or _NONE.

Report an error in this case if it would ever be called in that way.

src/qemu/qemu_command.c

index 04c8df7232492e6b80d14a3e172e4f061b8c7988..c467092bcc4fb4a57a0d5c29f3d5804fbb9ba8ec 100644 (file)
@@ -3264,6 +3264,9 @@ qemuBuildNetworkDriveURI(virStorageSourcePtr src,
 
         case VIR_STORAGE_NET_PROTOCOL_LAST:
         case VIR_STORAGE_NET_PROTOCOL_NONE:
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("Unexpected network protocol '%s'"),
+                           virStorageNetProtocolTypeToString(src->protocol));
             goto cleanup;
     }