[libvirt] [PATCH] Avoid virGetVersion failure on specific driver support configurations

Matthias Bolte matthias.bolte at googlemail.com
Tue Jun 7 07:46:41 UTC 2011


2011/6/6 Eric Blake <eblake at redhat.com>:
> On 06/06/2011 05:59 AM, Matthias Bolte wrote:
>> When virConnectGetType is called on a remote connection then the remote
>> driver returns the type of the underlying driver on the server side, for
>> example QEMU. Then virGetVersion compares hvType to a set of strings that
>> depend on configure options and returns LIBVIR_VERSION_NUMBER in most
>> cases. Now this fails in case libvirt on the client side is just compiled
>> with the remote driver enabled only and the server side has the actual
>> driver such as the QEMU driver.
>
> Conditional ACK, with docs fixed:
>
>>   * Provides information on up to two versions: @libVer is the version of the
>
> We now provide only one version.
>
>>   * library and will always be set unless an error occurs, in which case an
>> - * error code will be returned. If @typeVer is not NULL it will be set to the
>> - * version of the hypervisor @type against which the library was compiled.
>> - * If @type is NULL, "Xen" is assumed, if @type is unknown or not
>> - * available, an error code will be returned and @typeVer will be 0.
>> + * error code will be returned. If @typeVer is not NULL it should have been be
>
> "been be"
>
>> + * set to the version of the hypervisor @type against which the library was
>> + * compiled. Due to a design problem this doesn't work as intented. Therefore,
>
> intended
>
>> + * this function is only usefull to obtain the local library version number via
>
> useful
>
>> + * @libVer. To get the version of the running hypervisor use the
>> + * virConnectGetVersion function instead. To get the libvirt library version
>> + * used by a connection use the virConnectGetLibVersion instead.
>
> I'm thinking this looks better:
>
>  * virGetVersion:
>  * @libVer: return value for the library version (OUT)
>  * @type: ignored; pass NULL
>  * @typeVer: pass NULL; for historical purposes duplicates @libVer if
>  * non-NULL
>  *
>  * Provides version information. @libVer is the version of the
>  * library and will always be set unless an error occurs, in which case
>  * an error code will be returned. @typeVer exists for historical
>  * compatibility; if it is not NULL it will duplicate @libVer (it was
>  * originally intended to return hypervisor information based on @type,
>  * but due to the design of remote clients this is not reliable). To
>  * get the version of the running hypervisor use the
>  * virConnectGetVersion function instead. To get the libvirt library
>  * version used by a connection use the virConnectGetLibVersion instead.
>

Yes, much better, thanks :)

Pushed with improved documentation.

Matthias




More information about the libvir-list mailing list