From df9361859dd507a3d0f4c182ec7773acf6650c13 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 24 Mar 2015 16:13:41 +0100 Subject: [PATCH] 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. --- src/qemu/qemu_command.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.39.5