[libvirt] [PATCH 1/2] qemu: command: Report error when formatting network source with protocol _NONE

Eric Blake eblake at redhat.com
Wed Mar 25 16:38:29 UTC 2015


On 03/24/2015 09:24 AM, Peter Krempa wrote:
> 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(+)

ACK

> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 7e6b95c..8dd7a76 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3263,6 +3263,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;
>      }
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150325/306726b9/attachment-0001.sig>


More information about the libvir-list mailing list