mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
367697c54c
commit
ab8c5fe63f
@ -1833,7 +1833,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = {
|
|||||||
{ "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB },
|
{ "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[] = {
|
static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
|
||||||
{ "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
|
{ "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
|
||||||
{ "blockdev-add/arg-type/+gluster/debug", 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++) {
|
for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsQMPSchemaQueries); i++) {
|
||||||
entry = virQEMUCapsQMPSchemaQueries + i;
|
entry = virQEMUCapsQMPSchemaQueries + i;
|
||||||
|
|
||||||
if (virQEMUCapsQMPSchemaQueryPath(entry->value, schema))
|
if (virQEMUQAPISchemaPathExists(entry->value, schema))
|
||||||
virQEMUCapsSet(qemuCaps, entry->flag);
|
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
|
* @field: name of the object containing the requested type
|
||||||
* @name: name of the requested type
|
* @name: name of the requested type
|
||||||
* @namefield: name of the object property holding @name
|
* @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.
|
* member. Returns the type string on success or NULL on error.
|
||||||
*/
|
*/
|
||||||
static const char *
|
static const char *
|
||||||
virQEMUCapsQMPSchemaObjectGetType(const char *field,
|
virQEMUQAPISchemaObjectGetType(const char *field,
|
||||||
const char *name,
|
const char *name,
|
||||||
const char *namefield,
|
const char *namefield,
|
||||||
virJSONValuePtr elem)
|
virJSONValuePtr elem)
|
||||||
{
|
{
|
||||||
virJSONValuePtr arr;
|
virJSONValuePtr arr;
|
||||||
virJSONValuePtr cur;
|
virJSONValuePtr cur;
|
||||||
@ -69,9 +69,9 @@ virQEMUCapsQMPSchemaObjectGetType(const char *field,
|
|||||||
|
|
||||||
|
|
||||||
static virJSONValuePtr
|
static virJSONValuePtr
|
||||||
virQEMUCapsQMPSchemaTraverse(const char *baseName,
|
virQEMUQAPISchemaTraverse(const char *baseName,
|
||||||
char **query,
|
char **query,
|
||||||
virHashTablePtr schema)
|
virHashTablePtr schema)
|
||||||
{
|
{
|
||||||
virJSONValuePtr base;
|
virJSONValuePtr base;
|
||||||
const char *metatype;
|
const char *metatype;
|
||||||
@ -94,13 +94,13 @@ virQEMUCapsQMPSchemaTraverse(const char *baseName,
|
|||||||
continue;
|
continue;
|
||||||
} else if (STREQ(metatype, "object")) {
|
} else if (STREQ(metatype, "object")) {
|
||||||
if (**query == '+')
|
if (**query == '+')
|
||||||
baseName = virQEMUCapsQMPSchemaObjectGetType("variants",
|
baseName = virQEMUQAPISchemaObjectGetType("variants",
|
||||||
*query + 1,
|
*query + 1,
|
||||||
"case", base);
|
"case", base);
|
||||||
else
|
else
|
||||||
baseName = virQEMUCapsQMPSchemaObjectGetType("members",
|
baseName = virQEMUQAPISchemaObjectGetType("members",
|
||||||
*query,
|
*query,
|
||||||
"name", base);
|
"name", base);
|
||||||
|
|
||||||
if (!baseName)
|
if (!baseName)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -121,7 +121,7 @@ virQEMUCapsQMPSchemaTraverse(const char *baseName,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virQEMUCapsQMPSchemaGetByPath:
|
* virQEMUQAPISchemaPathGet:
|
||||||
* @query: string specifying the required data type (see below)
|
* @query: string specifying the required data type (see below)
|
||||||
* @schema: hash table containing the schema data
|
* @schema: hash table containing the schema data
|
||||||
* @entry: filled with the located schema object requested by @query
|
* @entry: filled with the located schema object requested by @query
|
||||||
@ -150,9 +150,9 @@ virQEMUCapsQMPSchemaTraverse(const char *baseName,
|
|||||||
* error message.
|
* error message.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virQEMUCapsQMPSchemaGetByPath(const char *query,
|
virQEMUQAPISchemaPathGet(const char *query,
|
||||||
virHashTablePtr schema,
|
virHashTablePtr schema,
|
||||||
virJSONValuePtr *entry)
|
virJSONValuePtr *entry)
|
||||||
{
|
{
|
||||||
char **elems = NULL;
|
char **elems = NULL;
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ virQEMUCapsQMPSchemaGetByPath(const char *query,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
*entry = virQEMUCapsQMPSchemaTraverse(*elems, elems + 1, schema);
|
*entry = virQEMUQAPISchemaTraverse(*elems, elems + 1, schema);
|
||||||
|
|
||||||
virStringListFree(elems);
|
virStringListFree(elems);
|
||||||
return 0;
|
return 0;
|
||||||
@ -175,12 +175,12 @@ virQEMUCapsQMPSchemaGetByPath(const char *query,
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
virQEMUCapsQMPSchemaQueryPath(const char *query,
|
virQEMUQAPISchemaPathExists(const char *query,
|
||||||
virHashTablePtr schema)
|
virHashTablePtr schema)
|
||||||
{
|
{
|
||||||
virJSONValuePtr entry;
|
virJSONValuePtr entry;
|
||||||
|
|
||||||
if (virQEMUCapsQMPSchemaGetByPath(query, schema, &entry))
|
if (virQEMUQAPISchemaPathGet(query, schema, &entry))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return !!entry;
|
return !!entry;
|
||||||
|
@ -25,12 +25,12 @@
|
|||||||
# include "virjson.h"
|
# include "virjson.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
virQEMUCapsQMPSchemaGetByPath(const char *query,
|
virQEMUQAPISchemaPathGet(const char *query,
|
||||||
virHashTablePtr schema,
|
virHashTablePtr schema,
|
||||||
virJSONValuePtr *entry);
|
virJSONValuePtr *entry);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
virQEMUCapsQMPSchemaQueryPath(const char *query,
|
virQEMUQAPISchemaPathExists(const char *query,
|
||||||
virHashTablePtr schema);
|
virHashTablePtr schema);
|
||||||
|
|
||||||
#endif /* __QEMU_QAPI_H__ */
|
#endif /* __QEMU_QAPI_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user