qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qapi: Reintroduce CommandDisabled error class


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] qapi: Reintroduce CommandDisabled error class
Date: Thu, 29 Aug 2019 08:12:44 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 8/29/19 8:04 AM, Michal Privoznik wrote:

>>> A bit of background: up until very recently libvirt used qemu-ga
>>> in all or nothing way. It didn't care why a qemu-ga command
>>> failed. But very recently a new API was introduced which
>>> implements 'best effort' approach (in some cases) and thus
>>> libvirt must differentiate between: {CommandNotFound,
>>> CommandDisabled} and some generic error. While the former classes
>>> mean the API can issue some other commands the latter raises a
>>> red flag causing the API to fail.
>>
>> Why do you need to distinguish CommandNotFound from CommandDisabled?
> 
> I don't. That's why I've put them both in curly braces. Perhaps this 
> says its better:
> 
> switch (klass) {
>   case CommandNotFound:
>   case CommandDisabled:
>         /* okay */
>         break;
> 

So the obvious counter-question - why not use class CommandNotFound for
a command that was disabled, rather than readding another class that has
no distinctive purpose?


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]