On Tue, Jun 11, 2024 at 11:13:00AM +0200, Markus Armbruster wrote:
> Daniel P. Berrangé <berra...@redhat.com> writes:
> 
> > Rather than creating stubs for every command that just return
> > QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to
> > fully exclude generation of the commands on Windows.
> >
> > The command will be rejected at QMP dispatch time instead,
> > avoiding reimplementing rejection by blocking the stub commands.
> 
> The commit message should mention that the value of "error" in the error
> response changes from
> 
>     {"class": "GenericError, "desc": "this feature or command is not 
> currently supported"}
> 
> to
> 
>     {"class": "CommandNotFound", "desc": "The command FOO has not been found"}

Actually it doesn't change like this, because the runtime disablement
means the stub never runs. So the actual differenceis this:

    {"class": "CommandNotFound", "desc": "Command FOO has been disabled"}
    
to
    
    {"class": "CommandNotFound", "desc": "The command FOO has not been found"}

still better, because it more accurately describes the sitution
where a command is not implemented on a platform configuration.

I'll add this to the commit msg.

> 
> > This fixes inconsistency where some commands are implemented
> > as stubs, yet not added to the blockedrpc list.
> 
> Example?

guest-get-cpustats & guest-get-diskstats. These two do actally
have their error message change in the way you describe. I'll
document this too.

> 
> > This has the additional benefit that the QGA protocol reference
> > now documents what conditions enable use of the command.
> 
> Yes!
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to