qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 08/22] qga: conditionalize schema for commands unsupported


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 08/22] qga: conditionalize schema for commands unsupported on Windows
Date: Wed, 3 Jul 2024 10:30:08 +0200
User-agent: Mozilla Thunderbird

On 13/6/24 17:43, Daniel P. Berrangé wrote:
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.
This changes the error message for affected commands from

     {"class": "CommandNotFound", "desc": "Command FOO has been disabled"}

to

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

This also fixes an accidental inconsistency where some commands
(guest-get-diskstats & guest-get-cpustats) are implemented as
stubs, yet not added to the blockedrpc list. Those change their
error message from

     {"class": "GenericError, "desc": "this feature or command is not currently 
supported"}

to

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

The final additional benefit is that the QGA protocol reference
now documents what conditions enable use of the command.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
  qga/commands-posix.c |  2 +-
  qga/commands-win32.c | 56 +-------------------------------------------
  qga/qapi-schema.json | 45 +++++++++++++++++++++++------------
  3 files changed, 32 insertions(+), 71 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

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