2 * Copyright (c) 2022 Oracle and/or its affiliates.
4 * This work is licensed under the terms of the GNU GPL, version 2.
5 * See the COPYING file in the top-level directory.
11 #include "qapi/qapi-types-stats.h"
13 typedef void StatRetrieveFunc(StatsResultList
**result
, StatsTarget target
,
14 strList
*names
, strList
*targets
, Error
**errp
);
15 typedef void SchemaRetrieveFunc(StatsSchemaList
**result
, Error
**errp
);
18 * Register callbacks for the QMP query-stats command.
20 * @provider: stats provider checked against QMP command arguments
21 * @stats_fn: routine to query stats:
22 * @schema_fn: routine to query stat schemas:
24 void add_stats_callbacks(StatsProvider provider
,
25 StatRetrieveFunc
*stats_fn
,
26 SchemaRetrieveFunc
*schemas_fn
);
29 * Helper routines for adding stats entries to the results lists.
31 void add_stats_entry(StatsResultList
**, StatsProvider
, const char *id
,
32 StatsList
*stats_list
);
33 void add_stats_schema(StatsSchemaList
**, StatsProvider
, StatsTarget
,
34 StatsSchemaValueList
*);
37 * True if a string matches the filter passed to the stats_fn callabck,
40 * Note that an empty list means no filtering, i.e. all strings will
43 bool apply_str_list_filter(const char *string
, strList
*list
);