[libvirt] [PATCH] esx: Report an error for acceptable URI schemes with a transport

Eric Blake eblake at redhat.com
Tue Sep 27 15:15:22 UTC 2011


On 09/27/2011 05:12 AM, Matthias Bolte wrote:
> Before, URIs such as esx+ssh:// have been declined by the ESX driver
> resulting in the remote driver trying to connect to an non-existing
> libvirtd.
>
> Now such URIs trigger and error in the ESX driver suggesting to try
> again without the transport part in the scheme.
> ---
>   src/esx/esx_driver.c |   31 ++++++++++++++++++++++++++-----
>   1 files changed, 26 insertions(+), 5 deletions(-)

Makes sense.

> +    } else {
> +        if (plus - conn->uri->scheme != 3 ||
> +            (STRCASENEQLEN(conn->uri->scheme, "vpx", 3)&&
> +             STRCASENEQLEN(conn->uri->scheme, "esx", 3)&&
> +             STRCASENEQLEN(conn->uri->scheme, "gsx", 3))) {
> +            return VIR_DRV_OPEN_DECLINED;
> +        }
> +
> +        ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
> +                  _("Transport in URI scheme is not supported, try again "
> +                    "without the transport part"));

Maybe show the rejected transport in the error message:

ESX_ERROR(VIR_ERR_INVALID_ARG,
           _("Transport '%s' in URI scheme is not supported, try again "
             "without the transport part"), plus + 1);

ACK, whether or not you make a change along those lines.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list