From: Peter Krempa Date: Tue, 24 Mar 2015 15:13:41 +0000 (+0100) Subject: qemu: command: Report error when formatting network source with protocol _NONE X-Git-Tag: v1.2.14-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df9361859dd507a3d0f4c182ec7773acf6650c13;p=thirdparty%2Flibvirt.git qemu: command: Report error when formatting network source with protocol _NONE 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. --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 04c8df7232..c467092bcc 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -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; }