提交 ab8c5fe6 编写于 作者: P Peter Krempa

qemu: qapi: Fix naming of moved functions

Change the prefix of the functions to 'virQEMUQapi' and rename the two
public APIs so that the verb is put last.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 367697c5
无相关合并请求
......@@ -1833,7 +1833,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = {
{ "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB },
};
/* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */
/* see documentation for virQEMUQAPISchemaPathGet for the query format */
static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
{ "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
{ "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
......@@ -4579,7 +4579,7 @@ virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCapsPtr qemuCaps,
for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsQMPSchemaQueries); i++) {
entry = virQEMUCapsQMPSchemaQueries + i;
if (virQEMUCapsQMPSchemaQueryPath(entry->value, schema))
if (virQEMUQAPISchemaPathExists(entry->value, schema))
virQEMUCapsSet(qemuCaps, entry->flag);
}
......
......@@ -31,7 +31,7 @@ VIR_LOG_INIT("qemu.qemu_qapi");
/**
* virQEMUCapsQMPSchemaObjectGetType:
* virQEMUQAPISchemaObjectGetType:
* @field: name of the object containing the requested type
* @name: name of the requested type
* @namefield: name of the object property holding @name
......@@ -40,10 +40,10 @@ VIR_LOG_INIT("qemu.qemu_qapi");
* member. Returns the type string on success or NULL on error.
*/
static const char *
virQEMUCapsQMPSchemaObjectGetType(const char *field,
const char *name,
const char *namefield,
virJSONValuePtr elem)
virQEMUQAPISchemaObjectGetType(const char *field,
const char *name,
const char *namefield,
virJSONValuePtr elem)
{
virJSONValuePtr arr;
virJSONValuePtr cur;
......@@ -69,9 +69,9 @@ virQEMUCapsQMPSchemaObjectGetType(const char *field,
static virJSONValuePtr
virQEMUCapsQMPSchemaTraverse(const char *baseName,
char **query,
virHashTablePtr schema)
virQEMUQAPISchemaTraverse(const char *baseName,
char **query,
virHashTablePtr schema)
{
virJSONValuePtr base;
const char *metatype;
......@@ -94,13 +94,13 @@ virQEMUCapsQMPSchemaTraverse(const char *baseName,
continue;
} else if (STREQ(metatype, "object")) {
if (**query == '+')
baseName = virQEMUCapsQMPSchemaObjectGetType("variants",
*query + 1,
"case", base);
baseName = virQEMUQAPISchemaObjectGetType("variants",
*query + 1,
"case", base);
else
baseName = virQEMUCapsQMPSchemaObjectGetType("members",
*query,
"name", base);
baseName = virQEMUQAPISchemaObjectGetType("members",
*query,
"name", base);
if (!baseName)
return NULL;
......@@ -121,7 +121,7 @@ virQEMUCapsQMPSchemaTraverse(const char *baseName,
/**
* virQEMUCapsQMPSchemaGetByPath:
* virQEMUQAPISchemaPathGet:
* @query: string specifying the required data type (see below)
* @schema: hash table containing the schema data
* @entry: filled with the located schema object requested by @query
......@@ -150,9 +150,9 @@ virQEMUCapsQMPSchemaTraverse(const char *baseName,
* error message.
*/
int
virQEMUCapsQMPSchemaGetByPath(const char *query,
virHashTablePtr schema,
virJSONValuePtr *entry)
virQEMUQAPISchemaPathGet(const char *query,
virHashTablePtr schema,
virJSONValuePtr *entry)
{
char **elems = NULL;
......@@ -167,7 +167,7 @@ virQEMUCapsQMPSchemaGetByPath(const char *query,
return -1;
}
*entry = virQEMUCapsQMPSchemaTraverse(*elems, elems + 1, schema);
*entry = virQEMUQAPISchemaTraverse(*elems, elems + 1, schema);
virStringListFree(elems);
return 0;
......@@ -175,12 +175,12 @@ virQEMUCapsQMPSchemaGetByPath(const char *query,
bool
virQEMUCapsQMPSchemaQueryPath(const char *query,
virHashTablePtr schema)
virQEMUQAPISchemaPathExists(const char *query,
virHashTablePtr schema)
{
virJSONValuePtr entry;
if (virQEMUCapsQMPSchemaGetByPath(query, schema, &entry))
if (virQEMUQAPISchemaPathGet(query, schema, &entry))
return false;
return !!entry;
......
......@@ -25,12 +25,12 @@
# include "virjson.h"
int
virQEMUCapsQMPSchemaGetByPath(const char *query,
virHashTablePtr schema,
virJSONValuePtr *entry);
virQEMUQAPISchemaPathGet(const char *query,
virHashTablePtr schema,
virJSONValuePtr *entry);
bool
virQEMUCapsQMPSchemaQueryPath(const char *query,
virHashTablePtr schema);
virQEMUQAPISchemaPathExists(const char *query,
virHashTablePtr schema);
#endif /* __QEMU_QAPI_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部