qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] QMP stubs: how to return "not implemented" errors?


From: Eduardo Habkost
Subject: [Qemu-devel] QMP stubs: how to return "not implemented" errors?
Date: Mon, 3 Oct 2016 16:04:42 -0300
User-agent: Mutt/1.7.0 (2016-08-17)

Hi,

When adding new QMP commands that are implemented by
arch-specific code, we have been adding stubs that report
QERR_UNSUPPORTED (see stubs/arch-query-cpu-model-expansion.c for
an example).

But we are using GenericError for that, and this prevents clients
from reliably checking if the command is really implemented by
the QEMU binary.

What should be the right solution for this? Some of the options I
have considered are:

1) Using CommandNotFound as the error class in the stubs. This
   sounds wrong because the command exists (it is present in
   query-commands and in the QAPI schema).
2) Creating a CommandNotImplemented error class. Simple to do,
   but it would require clients to make two separate checks,
   before concluding that the command is available (checking
   query-commands or query-qmp-schema, and then checking for
   CommandNotImplemented errors).
3.1) Removing the command from query-commands and from the QAPI
   schema on binaries that don't implement the command.
   Needlessly complex?
3.2) Removing the unimplemented command from query-commands only
   (by calling qmp_disable_command()), but keeping it on the QAPI
   schema. I am not sure it's OK to do that. If it is, this
   sounds like the simplest solution.

Any ideas?

-- 
Eduardo



reply via email to

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