@@ -51,6 +51,7 @@ void qmp_disable_command(QmpCommandList *cmds, const char *name,
void qmp_enable_command(QmpCommandList *cmds, const char *name);
bool qmp_command_is_enabled(const QmpCommand *cmd);
+bool qmp_command_has_feature(const QmpCommand *cmd, unsigned feature);
bool qmp_command_available(const QmpCommand *cmd, Error **errp);
const char *qmp_command_name(const QmpCommand *cmd);
bool qmp_has_success_response(const QmpCommand *cmd);
@@ -74,6 +74,11 @@ bool qmp_command_is_enabled(const QmpCommand *cmd)
return cmd->enabled;
}
+bool qmp_command_has_feature(const QmpCommand *cmd, unsigned feature)
+{
+ return cmd->special_features & feature;
+}
+
const char *qmp_command_name(const QmpCommand *cmd)
{
return cmd->name;
The 'qmp_command_has_feature' method returns true if the requested feature has been set. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- include/qapi/qmp/dispatch.h | 1 + qapi/qmp-registry.c | 5 +++++ 2 files changed, 6 insertions(+)