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.
This commit is contained in:
Peter Krempa 2015-03-24 16:13:41 +01:00
parent 237ffd1b1d
commit df9361859d

View 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;
}