[libvirt] [PATCH] virterror: Add error message for unsupported operations.

Eric Blake eblake at redhat.com
Fri Aug 10 15:28:21 UTC 2012


On 08/09/2012 11:34 PM, Laine Stump wrote:
> On 08/09/2012 09:44 AM, Peter Krempa wrote:
>> On 08/09/12 15:38, Eric Blake wrote:
>>> On 08/09/2012 07:31 AM, Peter Krempa wrote:
>>>> This patch introduces a new error code VIR_ERR_OPERATION_UNSUPPORTED to
>>>> mark error messages regarding operations that failed due to lack of
>>>> support on the hypervisor or other than libvirt issues.
>>>>

>>> In the past, we have used VIR_ERR_CONFIG_UNSUPPORTED for messages about
>>> a qemu binary that doesn't support something; would that be any better
>>> than inventing a new error here?  Or are all of those errors worth
>>> switching over to this new code?
>>
>> Using VIR_ERR_CONFIG_UNSUPPORTED seems reasonable to me in cases where
>> the unsupported feature is requested by the user. Eg. when setting
>> something or requesting some weird configuration or even if the
>> hypervisor doesn't support it.
>>
>> On the other hand It doesn't make sense to me to use it on getter-type
>> APIs where the user isn't setting anything just wants some information
>> back. In this case I'd rather like to see a new message, as stating
>> that config isn't supported is a little bit strange.

Makes sense to me - the user is not trying to change config, but is
merely being informed that the information they requested is not available.

>>
>>>
>>> As written, your patch seems fine, but only if we agree that a new error
>>> is the way to go.
> 
> There was already a short discussion about this related to another patch:
> 
> https://www.redhat.com/archives/libvir-list/2012-August/msg00589.html
> 
> Peter wrote this patch in response to that discussion.
> 
> My vote is in favor of the new code.

Sounds like we've got enough arguments in favor of the new code; go
ahead and push the new error type.

-- 
Eric Blake   eblake at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120810/0fc0c61a/attachment-0001.sig>


More information about the libvir-list mailing list