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

Matthias Bolte matthias.bolte at googlemail.com
Thu Sep 29 08:29:01 UTC 2011


2011/9/27 Eric Blake <eblake at redhat.com>:
> 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.

That's a good idea, it makes the error message more explicit. I folded
that in and pushed it.

-- 
Matthias Bolte
http://photron.blogspot.com




More information about the libvir-list mailing list