util: hash: Retire 'virHashTable' in favor of 'GHashTable'

Don't hide our use of GHashTable behind our typedef. This will also
promote the use of glibs hash function directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Matt Coleman <matt@datto.com>
This commit is contained in:
Peter Krempa 2020-10-22 19:04:18 +02:00
parent de41e74bbc
commit 62a01d84a3
81 changed files with 390 additions and 395 deletions

View File

@ -519,7 +519,7 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def,
virDomainDefPtr dom, virDomainDefPtr dom,
const char *suffix) const char *suffix)
{ {
g_autoptr(virHashTable) disks = virHashNew(NULL); g_autoptr(GHashTable) disks = virHashNew(NULL);
size_t i; size_t i;
int ndisks; int ndisks;
bool backup_all = false; bool backup_all = false;

View File

@ -196,7 +196,7 @@ void virDomainPCIAddressSetAllMulti(virDomainDefPtr def)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
struct _virDomainCCWAddressSet { struct _virDomainCCWAddressSet {
virHashTablePtr defined; GHashTable *defined;
virDomainDeviceCCWAddress next; virDomainDeviceCCWAddress next;
}; };
typedef struct _virDomainCCWAddressSet virDomainCCWAddressSet; typedef struct _virDomainCCWAddressSet virDomainCCWAddressSet;

View File

@ -5784,7 +5784,7 @@ virDomainDefCollectBootOrder(virDomainDefPtr def G_GNUC_UNUSED,
virDomainDeviceInfoPtr info, virDomainDeviceInfoPtr info,
void *data) void *data)
{ {
virHashTablePtr bootHash = data; GHashTable *bootHash = data;
g_autofree char *order = NULL; g_autofree char *order = NULL;
if (info->bootIndex == 0) if (info->bootIndex == 0)
@ -5817,7 +5817,7 @@ virDomainDefCollectBootOrder(virDomainDefPtr def G_GNUC_UNUSED,
static int static int
virDomainDefBootOrderPostParse(virDomainDefPtr def) virDomainDefBootOrderPostParse(virDomainDefPtr def)
{ {
virHashTablePtr bootHash = NULL; GHashTable *bootHash = NULL;
int ret = -1; int ret = -1;
if (!(bootHash = virHashNew(NULL))) if (!(bootHash = virHashNew(NULL)))
@ -6861,7 +6861,7 @@ virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev,
struct virDomainDefValidateAliasesData { struct virDomainDefValidateAliasesData {
virHashTablePtr aliases; GHashTable *aliases;
}; };
@ -6920,7 +6920,7 @@ virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def,
*/ */
static int static int
virDomainDefValidateAliases(const virDomainDef *def, virDomainDefValidateAliases(const virDomainDef *def,
virHashTablePtr *aliases) GHashTable **aliases)
{ {
struct virDomainDefValidateAliasesData data; struct virDomainDefValidateAliasesData data;
int ret = -1; int ret = -1;
@ -6949,7 +6949,7 @@ static int
virDomainDeviceValidateAliasImpl(const virDomainDef *def, virDomainDeviceValidateAliasImpl(const virDomainDef *def,
virDomainDeviceDefPtr dev) virDomainDeviceDefPtr dev)
{ {
virHashTablePtr aliases = NULL; GHashTable *aliases = NULL;
virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev); virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev);
int ret = -1; int ret = -1;
@ -11982,7 +11982,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
virDomainHostdevDefPtr hostdev; virDomainHostdevDefPtr hostdev;
xmlNodePtr cur; xmlNodePtr cur;
xmlNodePtr tmpNode; xmlNodePtr tmpNode;
virHashTablePtr filterparams = NULL; GHashTable *filterparams = NULL;
virDomainActualNetDefPtr actual = NULL; virDomainActualNetDefPtr actual = NULL;
VIR_XPATH_NODE_AUTORESTORE(ctxt) VIR_XPATH_NODE_AUTORESTORE(ctxt)
virDomainChrSourceReconnectDef reconnect = {0}; virDomainChrSourceReconnectDef reconnect = {0};

View File

@ -1093,7 +1093,7 @@ struct _virDomainNetDef {
virNetDevIPInfo guestIP; virNetDevIPInfo guestIP;
virDomainDeviceInfo info; virDomainDeviceInfo info;
char *filter; char *filter;
virHashTablePtr filterparams; GHashTable *filterparams;
virNetDevBandwidthPtr bandwidth; virNetDevBandwidthPtr bandwidth;
virNetDevVlan vlan; virNetDevVlan vlan;
int trustGuestRxFilters; /* enum virTristateBool */ int trustGuestRxFilters; /* enum virTristateBool */

View File

@ -500,7 +500,7 @@ typedef struct _virNWFilterIncludeDef virNWFilterIncludeDef;
typedef virNWFilterIncludeDef *virNWFilterIncludeDefPtr; typedef virNWFilterIncludeDef *virNWFilterIncludeDefPtr;
struct _virNWFilterIncludeDef { struct _virNWFilterIncludeDef {
char *filterref; char *filterref;
virHashTablePtr params; GHashTable *params;
}; };

View File

@ -33,7 +33,7 @@
#define VIR_FROM_THIS VIR_FROM_NWFILTER #define VIR_FROM_THIS VIR_FROM_NWFILTER
static virMutex ipAddressMapLock = VIR_MUTEX_INITIALIZER; static virMutex ipAddressMapLock = VIR_MUTEX_INITIALIZER;
static virHashTablePtr ipAddressMap; static GHashTable *ipAddressMap;
/* Add an IP address to the list of IP addresses an interface is /* Add an IP address to the list of IP addresses an interface is

View File

@ -330,7 +330,7 @@ virNWFilterVarCombIterEntryInit(virNWFilterVarCombIterEntryPtr cie,
static int static int
virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntryPtr cie, virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntryPtr cie,
virHashTablePtr hash, GHashTable *hash,
const virNWFilterVarAccess *varAccess) const virNWFilterVarAccess *varAccess)
{ {
virNWFilterVarValuePtr varValue; virNWFilterVarValuePtr varValue;
@ -397,7 +397,7 @@ virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntryPtr cie,
*/ */
static bool static bool
virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie, virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie,
virHashTablePtr hash) GHashTable *hash)
{ {
size_t i, j; size_t i, j;
virNWFilterVarValuePtr varValue, tmp; virNWFilterVarValuePtr varValue, tmp;
@ -455,7 +455,7 @@ virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie,
* be created. * be created.
*/ */
virNWFilterVarCombIterPtr virNWFilterVarCombIterPtr
virNWFilterVarCombIterCreate(virHashTablePtr hash, virNWFilterVarCombIterCreate(GHashTable *hash,
virNWFilterVarAccessPtr *varAccess, virNWFilterVarAccessPtr *varAccess,
size_t nVarAccess) size_t nVarAccess)
{ {
@ -614,7 +614,7 @@ virNWFilterVarValueHashFree(void *payload)
struct addToTableStruct { struct addToTableStruct {
virHashTablePtr target; GHashTable *target;
int errOccurred; int errOccurred;
}; };
@ -644,8 +644,8 @@ addToTable(void *payload, const char *name, void *data)
int int
virNWFilterHashTablePutAll(virHashTablePtr src, virNWFilterHashTablePutAll(GHashTable *src,
virHashTablePtr dest) GHashTable *dest)
{ {
struct addToTableStruct atts = { struct addToTableStruct atts = {
.target = dest, .target = dest,
@ -671,8 +671,8 @@ virNWFilterVarValueCompare(const void *a, const void *b)
} }
bool bool
virNWFilterHashTableEqual(virHashTablePtr a, virNWFilterHashTableEqual(GHashTable *a,
virHashTablePtr b) GHashTable *b)
{ {
return virHashEqual(a, b, virNWFilterVarValueCompare); return virHashEqual(a, b, virNWFilterVarValueCompare);
} }
@ -696,13 +696,13 @@ virNWFilterParseVarValue(const char *val)
return virNWFilterVarValueCreateSimpleCopyValue(val); return virNWFilterVarValueCreateSimpleCopyValue(val);
} }
virHashTablePtr GHashTable *
virNWFilterParseParamAttributes(xmlNodePtr cur) virNWFilterParseParamAttributes(xmlNodePtr cur)
{ {
char *nam, *val; char *nam, *val;
virNWFilterVarValuePtr value; virNWFilterVarValuePtr value;
virHashTablePtr table = virHashNew(virNWFilterVarValueHashFree); GHashTable *table = virHashNew(virNWFilterVarValueHashFree);
if (!table) if (!table)
return NULL; return NULL;
@ -757,7 +757,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
int int
virNWFilterFormatParamAttributes(virBufferPtr buf, virNWFilterFormatParamAttributes(virBufferPtr buf,
virHashTablePtr table, GHashTable *table,
const char *filterref) const char *filterref)
{ {
virHashKeyValuePairPtr items; virHashKeyValuePairPtr items;
@ -983,7 +983,7 @@ virNWFilterVarAccessGetIntIterId(const virNWFilterVarAccess *vap)
bool bool
virNWFilterVarAccessIsAvailable(const virNWFilterVarAccess *varAccess, virNWFilterVarAccessIsAvailable(const virNWFilterVarAccess *varAccess,
virHashTablePtr hash) GHashTable *hash)
{ {
const char *varName = virNWFilterVarAccessGetVarName(varAccess); const char *varName = virNWFilterVarAccessGetVarName(varAccess);
const char *res; const char *res;

View File

@ -63,15 +63,15 @@ int virNWFilterVarValueAddValue(virNWFilterVarValuePtr val, char *value);
int virNWFilterVarValueAddValueCopy(virNWFilterVarValuePtr val, const char *value); int virNWFilterVarValueAddValueCopy(virNWFilterVarValuePtr val, const char *value);
int virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value); int virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value);
virHashTablePtr virNWFilterParseParamAttributes(xmlNodePtr cur); GHashTable *virNWFilterParseParamAttributes(xmlNodePtr cur);
int virNWFilterFormatParamAttributes(virBufferPtr buf, int virNWFilterFormatParamAttributes(virBufferPtr buf,
virHashTablePtr table, GHashTable *table,
const char *filterref); const char *filterref);
int virNWFilterHashTablePutAll(virHashTablePtr src, int virNWFilterHashTablePutAll(GHashTable *src,
virHashTablePtr dest); GHashTable *dest);
bool virNWFilterHashTableEqual(virHashTablePtr a, bool virNWFilterHashTableEqual(GHashTable *a,
virHashTablePtr b); GHashTable *b);
#define VALID_VARNAME \ #define VALID_VARNAME \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
@ -119,7 +119,7 @@ virNWFilterVarAccessType virNWFilterVarAccessGetType(
unsigned int virNWFilterVarAccessGetIterId(const virNWFilterVarAccess *vap); unsigned int virNWFilterVarAccessGetIterId(const virNWFilterVarAccess *vap);
unsigned int virNWFilterVarAccessGetIndex(const virNWFilterVarAccess *vap); unsigned int virNWFilterVarAccessGetIndex(const virNWFilterVarAccess *vap);
bool virNWFilterVarAccessIsAvailable(const virNWFilterVarAccess *vap, bool virNWFilterVarAccessIsAvailable(const virNWFilterVarAccess *vap,
virHashTablePtr hash); GHashTable *hash);
typedef struct _virNWFilterVarCombIterEntry virNWFilterVarCombIterEntry; typedef struct _virNWFilterVarCombIterEntry virNWFilterVarCombIterEntry;
typedef virNWFilterVarCombIterEntry *virNWFilterVarCombIterEntryPtr; typedef virNWFilterVarCombIterEntry *virNWFilterVarCombIterEntryPtr;
@ -135,12 +135,12 @@ struct _virNWFilterVarCombIterEntry {
typedef struct _virNWFilterVarCombIter virNWFilterVarCombIter; typedef struct _virNWFilterVarCombIter virNWFilterVarCombIter;
typedef virNWFilterVarCombIter *virNWFilterVarCombIterPtr; typedef virNWFilterVarCombIter *virNWFilterVarCombIterPtr;
struct _virNWFilterVarCombIter { struct _virNWFilterVarCombIter {
virHashTablePtr hashTable; GHashTable *hashTable;
size_t nIter; size_t nIter;
virNWFilterVarCombIterEntry iter[0]; virNWFilterVarCombIterEntry iter[0];
}; };
virNWFilterVarCombIterPtr virNWFilterVarCombIterCreate( virNWFilterVarCombIterPtr virNWFilterVarCombIterCreate(
virHashTablePtr hash, GHashTable *hash,
virNWFilterVarAccessPtr *vars, virNWFilterVarAccessPtr *vars,
size_t nVars); size_t nVars);

View File

@ -640,7 +640,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapdef,
bool require_match) bool require_match)
{ {
virDomainDefPtr domdef = snapdef->parent.dom; virDomainDefPtr domdef = snapdef->parent.dom;
g_autoptr(virHashTable) map = virHashNew(NULL); g_autoptr(GHashTable) map = virHashNew(NULL);
g_autofree virDomainSnapshotDiskDefPtr olddisks = NULL; g_autofree virDomainSnapshotDiskDefPtr olddisks = NULL;
size_t i; size_t i;

View File

@ -45,7 +45,7 @@ VIR_LOG_INIT("conf.chrdev");
* open in a given domain */ * open in a given domain */
struct _virChrdevs { struct _virChrdevs {
virMutex lock; virMutex lock;
virHashTablePtr hash; GHashTable *hash;
}; };
typedef struct _virChrdevStreamInfo virChrdevStreamInfo; typedef struct _virChrdevStreamInfo virChrdevStreamInfo;

View File

@ -42,7 +42,7 @@ VIR_LOG_INIT("conf.virdomainmomentobjlist");
struct _virDomainMomentObjList { struct _virDomainMomentObjList {
/* name string -> virDomainMomentObj mapping /* name string -> virDomainMomentObj mapping
* for O(1), lockless lookup-by-name */ * for O(1), lockless lookup-by-name */
virHashTable *objs; GHashTable *objs;
virDomainMomentObj metaroot; /* Special parent of all root moments */ virDomainMomentObj metaroot; /* Special parent of all root moments */
virDomainMomentObjPtr current; /* The current moment, if any */ virDomainMomentObjPtr current; /* The current moment, if any */

View File

@ -47,11 +47,11 @@ struct _virDomainObjList {
/* uuid string -> virDomainObj mapping /* uuid string -> virDomainObj mapping
* for O(1), lockless lookup-by-uuid */ * for O(1), lockless lookup-by-uuid */
virHashTable *objs; GHashTable *objs;
/* name -> virDomainObj mapping for O(1), /* name -> virDomainObj mapping for O(1),
* lockless lookup-by-name */ * lockless lookup-by-name */
virHashTable *objsName; GHashTable *objsName;
}; };

View File

@ -45,7 +45,7 @@ struct _virInterfaceObjList {
/* name string -> virInterfaceObj mapping /* name string -> virInterfaceObj mapping
* for O(1), lockless lookup-by-name */ * for O(1), lockless lookup-by-name */
virHashTable *objsName; GHashTable *objsName;
}; };
/* virInterfaceObj manipulation */ /* virInterfaceObj manipulation */

View File

@ -59,13 +59,13 @@ struct _virNetworkObj {
/* Immutable pointer, self locking APIs */ /* Immutable pointer, self locking APIs */
virMacMapPtr macmap; virMacMapPtr macmap;
virHashTablePtr ports; /* uuid -> virNetworkPortDefPtr */ GHashTable *ports; /* uuid -> virNetworkPortDefPtr */
}; };
struct _virNetworkObjList { struct _virNetworkObjList {
virObjectRWLockable parent; virObjectRWLockable parent;
virHashTablePtr objs; GHashTable *objs;
}; };
static virClassPtr virNetworkObjClass; static virClassPtr virNetworkObjClass;

View File

@ -46,7 +46,7 @@ struct _virNodeDeviceObjList {
/* name string -> virNodeDeviceObj mapping /* name string -> virNodeDeviceObj mapping
* for O(1), lockless lookup-by-name */ * for O(1), lockless lookup-by-name */
virHashTable *objs; GHashTable *objs;
}; };

View File

@ -37,7 +37,7 @@ struct _virNWFilterBindingDef {
char *linkdevname; char *linkdevname;
virMacAddr mac; virMacAddr mac;
char *filter; char *filter;
virHashTablePtr filterparams; GHashTable *filterparams;
}; };

View File

@ -40,7 +40,7 @@ struct _virNWFilterBindingObjList {
/* port dev name -> virNWFilterBindingObj mapping /* port dev name -> virNWFilterBindingObj mapping
* for O(1), lockless lookup-by-port dev */ * for O(1), lockless lookup-by-port dev */
virHashTable *objs; GHashTable *objs;
}; };

View File

@ -55,7 +55,7 @@ struct _virSecretObjList {
/* uuid string -> virSecretObj mapping /* uuid string -> virSecretObj mapping
* for O(1), lockless lookup-by-uuid */ * for O(1), lockless lookup-by-uuid */
virHashTable *objs; GHashTable *objs;
}; };
struct virSecretSearchData { struct virSecretSearchData {

View File

@ -69,15 +69,15 @@ struct _virStorageVolObjList {
/* key string -> virStorageVolObj mapping /* key string -> virStorageVolObj mapping
* for (1), lockless lookup-by-key */ * for (1), lockless lookup-by-key */
virHashTable *objsKey; GHashTable *objsKey;
/* name string -> virStorageVolObj mapping /* name string -> virStorageVolObj mapping
* for (1), lockless lookup-by-name */ * for (1), lockless lookup-by-name */
virHashTable *objsName; GHashTable *objsName;
/* path string -> virStorageVolObj mapping /* path string -> virStorageVolObj mapping
* for (1), lockless lookup-by-path */ * for (1), lockless lookup-by-path */
virHashTable *objsPath; GHashTable *objsPath;
}; };
struct _virStoragePoolObj { struct _virStoragePoolObj {
@ -101,11 +101,11 @@ struct _virStoragePoolObjList {
/* uuid string -> virStoragePoolObj mapping /* uuid string -> virStoragePoolObj mapping
* for (1), lockless lookup-by-uuid */ * for (1), lockless lookup-by-uuid */
virHashTable *objs; GHashTable *objs;
/* name string -> virStoragePoolObj mapping /* name string -> virStoragePoolObj mapping
* for (1), lockless lookup-by-name */ * for (1), lockless lookup-by-name */
virHashTable *objsName; GHashTable *objsName;
}; };

View File

@ -1300,7 +1300,7 @@ hypervDomainSetAutostart(virDomainPtr domain, int autostart)
Msvm_VirtualSystemSettingData *vssd = NULL; Msvm_VirtualSystemSettingData *vssd = NULL;
g_autoptr(hypervInvokeParamsList) params = NULL; g_autoptr(hypervInvokeParamsList) params = NULL;
g_auto(virBuffer) eprQuery = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) eprQuery = VIR_BUFFER_INITIALIZER;
g_autoptr(virHashTable) autostartParam = NULL; g_autoptr(GHashTable) autostartParam = NULL;
const char *methodName = NULL; const char *methodName = NULL;
hypervWmiClassInfoListPtr embeddedParamClass = NULL; hypervWmiClassInfoListPtr embeddedParamClass = NULL;
const char *enabledValue = NULL, *disabledValue = NULL; const char *enabledValue = NULL, *disabledValue = NULL;
@ -1806,7 +1806,7 @@ hypervDomainSetMemoryFlags(virDomainPtr domain, unsigned long memory,
Msvm_VirtualSystemSettingData *vssd = NULL; Msvm_VirtualSystemSettingData *vssd = NULL;
Msvm_MemorySettingData *memsd = NULL; Msvm_MemorySettingData *memsd = NULL;
g_auto(virBuffer) eprQuery = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) eprQuery = VIR_BUFFER_INITIALIZER;
g_autoptr(virHashTable) memResource = NULL; g_autoptr(GHashTable) memResource = NULL;
virCheckFlags(0, -1); virCheckFlags(0, -1);

View File

@ -312,18 +312,18 @@ hypervAddEprParam(hypervInvokeParamsListPtr params, const char *name,
* @priv: hypervPrivate object associated with the connection * @priv: hypervPrivate object associated with the connection
* @info: WmiInfo of the object type to serialize * @info: WmiInfo of the object type to serialize
* *
* Instantiates a virHashTable pre-filled with all the properties pre-added * Instantiates a GHashTable pre-filled with all the properties pre-added
* a key/value pairs set to NULL. The user then sets only those properties that * a key/value pairs set to NULL. The user then sets only those properties that
* they wish to serialize, and passes the table via hypervAddEmbeddedParam. * they wish to serialize, and passes the table via hypervAddEmbeddedParam.
* *
* Returns a pointer to the virHashTable on success, otherwise NULL. * Returns a pointer to the GHashTable on success, otherwise NULL.
*/ */
virHashTablePtr GHashTable *
hypervCreateEmbeddedParam(hypervPrivate *priv, hypervWmiClassInfoListPtr info) hypervCreateEmbeddedParam(hypervPrivate *priv, hypervWmiClassInfoListPtr info)
{ {
size_t i; size_t i;
size_t count; size_t count;
g_autoptr(virHashTable) table = NULL; g_autoptr(GHashTable) table = NULL;
XmlSerializerInfo *typeinfo = NULL; XmlSerializerInfo *typeinfo = NULL;
hypervWmiClassInfoPtr classInfo = NULL; hypervWmiClassInfoPtr classInfo = NULL;
@ -366,7 +366,7 @@ hypervCreateEmbeddedParam(hypervPrivate *priv, hypervWmiClassInfoListPtr info)
* -1 otherwise. * -1 otherwise.
*/ */
int int
hypervSetEmbeddedProperty(virHashTablePtr table, hypervSetEmbeddedProperty(GHashTable *table,
const char *name, const char *name,
const char *value) const char *value)
{ {
@ -382,7 +382,7 @@ hypervSetEmbeddedProperty(virHashTablePtr table,
* @table: pointer to table of properties to add * @table: pointer to table of properties to add
* @info: WmiInfo of the object to serialize * @info: WmiInfo of the object to serialize
* *
* Add a virHashTable containing object properties as an embedded param to * Add a GHashTable containing object properties as an embedded param to
* an invocation list. * an invocation list.
* *
* Upon successfull return the @table is consumed and the pointer is cleared out. * Upon successfull return the @table is consumed and the pointer is cleared out.
@ -393,7 +393,7 @@ int
hypervAddEmbeddedParam(hypervInvokeParamsListPtr params, hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
hypervPrivate *priv, hypervPrivate *priv,
const char *name, const char *name,
virHashTablePtr *table, GHashTable **table,
hypervWmiClassInfoListPtr info) hypervWmiClassInfoListPtr info)
{ {
hypervParamPtr p = NULL; hypervParamPtr p = NULL;
@ -424,7 +424,7 @@ hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
* Free the embedded param hash table. * Free the embedded param hash table.
*/ */
void void
hypervFreeEmbeddedParam(virHashTablePtr p) hypervFreeEmbeddedParam(GHashTable *p)
{ {
virHashFree(p); virHashFree(p);
} }

View File

@ -102,7 +102,7 @@ typedef struct _hypervEprParam hypervEprParam;
struct _hypervEmbeddedParam { struct _hypervEmbeddedParam {
const char *name; const char *name;
virHashTablePtr table; GHashTable *table;
hypervWmiClassInfoPtr info; /* info of the object this param represents */ hypervWmiClassInfoPtr info; /* info of the object this param represents */
}; };
typedef struct _hypervEmbeddedParam hypervEmbeddedParam; typedef struct _hypervEmbeddedParam hypervEmbeddedParam;
@ -146,20 +146,20 @@ int hypervAddEprParam(hypervInvokeParamsListPtr params, const char *name,
hypervPrivate *priv, virBufferPtr query, hypervPrivate *priv, virBufferPtr query,
hypervWmiClassInfoListPtr eprInfo); hypervWmiClassInfoListPtr eprInfo);
virHashTablePtr hypervCreateEmbeddedParam(hypervPrivate *priv, GHashTable *hypervCreateEmbeddedParam(hypervPrivate *priv,
hypervWmiClassInfoListPtr info); hypervWmiClassInfoListPtr info);
int hypervSetEmbeddedProperty(virHashTablePtr table, int hypervSetEmbeddedProperty(GHashTable *table,
const char *name, const char *name,
const char *value); const char *value);
int hypervAddEmbeddedParam(hypervInvokeParamsListPtr params, int hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
hypervPrivate *priv, hypervPrivate *priv,
const char *name, const char *name,
virHashTablePtr *table, GHashTable **table,
hypervWmiClassInfoListPtr info); hypervWmiClassInfoListPtr info);
void hypervFreeEmbeddedParam(virHashTablePtr p); void hypervFreeEmbeddedParam(GHashTable *p);
int hypervInvokeMethod(hypervPrivate *priv, int hypervInvokeMethod(hypervPrivate *priv,
hypervInvokeParamsListPtr *paramsPtr, hypervInvokeParamsListPtr *paramsPtr,

View File

@ -40,7 +40,7 @@ struct _virCloseCallbacks {
virObjectLockable parent; virObjectLockable parent;
/* UUID string to qemuDriverCloseDef mapping */ /* UUID string to qemuDriverCloseDef mapping */
virHashTablePtr list; GHashTable *list;
}; };

View File

@ -42,7 +42,7 @@ struct xentoollog_logger_libvirt {
const char *logDir; const char *logDir;
/* map storing the opened fds: "domid" -> FILE* */ /* map storing the opened fds: "domid" -> FILE* */
virHashTablePtr files; GHashTable *files;
FILE *defaultLogFile; FILE *defaultLogFile;
}; };

View File

@ -59,7 +59,7 @@ VIR_LOG_INIT("locking.lock_daemon");
struct _virLockDaemon { struct _virLockDaemon {
GMutex lock; GMutex lock;
virNetDaemonPtr dmn; virNetDaemonPtr dmn;
virHashTablePtr lockspaces; GHashTable *lockspaces;
virLockSpacePtr defaultLockspace; virLockSpacePtr defaultLockspace;
}; };

View File

@ -78,10 +78,10 @@ struct virNWFilterSnoopState {
int wLeases; /* number of written leases */ int wLeases; /* number of written leases */
int nThreads; /* number of running threads */ int nThreads; /* number of running threads */
/* thread management */ /* thread management */
virHashTablePtr snoopReqs; GHashTable * snoopReqs;
virHashTablePtr ifnameToKey; GHashTable * ifnameToKey;
virMutex snoopLock; /* protects SnoopReqs and IfNameToKey */ virMutex snoopLock; /* protects SnoopReqs and IfNameToKey */
virHashTablePtr active; GHashTable * active;
virMutex activeLock; /* protects Active */ virMutex activeLock; /* protects Active */
}; };

View File

@ -3285,7 +3285,7 @@ ebtablesSubChainInstSort(const void *a, const void *b)
static int static int
ebtablesGetSubChainInsts(virHashTablePtr chains, ebtablesGetSubChainInsts(GHashTable *chains,
bool incoming, bool incoming,
ebtablesSubChainInstPtr **insts, ebtablesSubChainInstPtr **insts,
size_t *ninsts) size_t *ninsts)
@ -3328,8 +3328,8 @@ ebiptablesApplyNewRules(const char *ifname,
{ {
size_t i, j; size_t i, j;
g_autoptr(virFirewall) fw = virFirewallNew(); g_autoptr(virFirewall) fw = virFirewallNew();
g_autoptr(virHashTable) chains_in_set = virHashNew(NULL); g_autoptr(GHashTable) chains_in_set = virHashNew(NULL);
g_autoptr(virHashTable) chains_out_set = virHashNew(NULL); g_autoptr(GHashTable) chains_out_set = virHashNew(NULL);
bool haveEbtables = false; bool haveEbtables = false;
bool haveIptables = false; bool haveIptables = false;
bool haveIp6tables = false; bool haveIp6tables = false;

View File

@ -127,7 +127,7 @@ virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
/** /**
* Convert a virHashTable into a string of comma-separated * Convert a GHashTable into a string of comma-separated
* variable names. * variable names.
*/ */
struct printString struct printString
@ -166,7 +166,7 @@ printString(void *payload G_GNUC_UNUSED, const char *name, void *data)
* Returns a string of comma separated variable names * Returns a string of comma separated variable names
*/ */
static char * static char *
virNWFilterPrintVars(virHashTablePtr vars, virNWFilterPrintVars(GHashTable *vars,
const char *separator, const char *separator,
bool reportMAC, bool reportMAC,
bool reportIP) bool reportIP)
@ -195,11 +195,11 @@ virNWFilterPrintVars(virHashTablePtr vars,
* Creates a new hash table with contents of var1 and var2 added where * Creates a new hash table with contents of var1 and var2 added where
* contents of var2 will overwrite those of var1. * contents of var2 will overwrite those of var1.
*/ */
static virHashTablePtr static GHashTable *
virNWFilterCreateVarsFrom(virHashTablePtr vars1, virNWFilterCreateVarsFrom(GHashTable *vars1,
virHashTablePtr vars2) GHashTable *vars2)
{ {
virHashTablePtr res = virHashNew(virNWFilterVarValueHashFree); GHashTable *res = virHashNew(virNWFilterVarValueHashFree);
if (!res) if (!res)
return NULL; return NULL;
@ -248,7 +248,7 @@ virNWFilterInstReset(virNWFilterInstPtr inst)
static int static int
virNWFilterDefToInst(virNWFilterDriverStatePtr driver, virNWFilterDefToInst(virNWFilterDriverStatePtr driver,
virNWFilterDefPtr def, virNWFilterDefPtr def,
virHashTablePtr vars, GHashTable *vars,
enum instCase useNewFilter, enum instCase useNewFilter,
bool *foundNewFilter, bool *foundNewFilter,
virNWFilterInstPtr inst); virNWFilterInstPtr inst);
@ -256,7 +256,7 @@ virNWFilterDefToInst(virNWFilterDriverStatePtr driver,
static int static int
virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def, virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def,
virNWFilterRuleDefPtr rule, virNWFilterRuleDefPtr rule,
virHashTablePtr vars, GHashTable *vars,
virNWFilterInstPtr inst) virNWFilterInstPtr inst)
{ {
virNWFilterRuleInstPtr ruleinst; virNWFilterRuleInstPtr ruleinst;
@ -288,13 +288,13 @@ virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def,
static int static int
virNWFilterIncludeDefToRuleInst(virNWFilterDriverStatePtr driver, virNWFilterIncludeDefToRuleInst(virNWFilterDriverStatePtr driver,
virNWFilterIncludeDefPtr inc, virNWFilterIncludeDefPtr inc,
virHashTablePtr vars, GHashTable *vars,
enum instCase useNewFilter, enum instCase useNewFilter,
bool *foundNewFilter, bool *foundNewFilter,
virNWFilterInstPtr inst) virNWFilterInstPtr inst)
{ {
virNWFilterObjPtr obj; virNWFilterObjPtr obj;
virHashTablePtr tmpvars = NULL; GHashTable *tmpvars = NULL;
virNWFilterDefPtr childdef; virNWFilterDefPtr childdef;
virNWFilterDefPtr newChilddef; virNWFilterDefPtr newChilddef;
int ret = -1; int ret = -1;
@ -369,7 +369,7 @@ virNWFilterIncludeDefToRuleInst(virNWFilterDriverStatePtr driver,
static int static int
virNWFilterDefToInst(virNWFilterDriverStatePtr driver, virNWFilterDefToInst(virNWFilterDriverStatePtr driver,
virNWFilterDefPtr def, virNWFilterDefPtr def,
virHashTablePtr vars, GHashTable *vars,
enum instCase useNewFilter, enum instCase useNewFilter,
bool *foundNewFilter, bool *foundNewFilter,
virNWFilterInstPtr inst) virNWFilterInstPtr inst)
@ -404,8 +404,8 @@ virNWFilterDefToInst(virNWFilterDriverStatePtr driver,
static int static int
virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter, virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
virHashTablePtr vars, GHashTable *vars,
virHashTablePtr missing_vars, GHashTable *missing_vars,
int useNewFilter, int useNewFilter,
virNWFilterDriverStatePtr driver) virNWFilterDriverStatePtr driver)
{ {
@ -441,7 +441,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
} }
} }
} else if (inc) { } else if (inc) {
g_autoptr(virHashTable) tmpvars = NULL; g_autoptr(GHashTable) tmpvars = NULL;
VIR_DEBUG("Following filter %s", inc->filterref); VIR_DEBUG("Following filter %s", inc->filterref);
if (!(obj = virNWFilterObjListFindInstantiateFilter(driver->nwfilters, if (!(obj = virNWFilterObjListFindInstantiateFilter(driver->nwfilters,
@ -516,7 +516,7 @@ virNWFilterDoInstantiate(virNWFilterTechDriverPtr techdriver,
const char *learning; const char *learning;
bool reportIP = false; bool reportIP = false;
virHashTablePtr missing_vars = virHashNew(virNWFilterVarValueHashFree); GHashTable *missing_vars = virHashNew(virNWFilterVarValueHashFree);
memset(&inst, 0, sizeof(inst)); memset(&inst, 0, sizeof(inst));
@ -639,7 +639,7 @@ virNWFilterDoInstantiate(virNWFilterTechDriverPtr techdriver,
static int static int
virNWFilterVarHashmapAddStdValue(virHashTablePtr table, virNWFilterVarHashmapAddStdValue(GHashTable *table,
const char *var, const char *var,
const char *value) const char *value)
{ {
@ -940,7 +940,7 @@ enum {
static int static int
virNWFilterBuildOne(virNWFilterDriverStatePtr driver, virNWFilterBuildOne(virNWFilterDriverStatePtr driver,
virNWFilterBindingDefPtr binding, virNWFilterBindingDefPtr binding,
virHashTablePtr skipInterfaces, GHashTable *skipInterfaces,
int step) int step)
{ {
bool skipIface; bool skipIface;
@ -982,7 +982,7 @@ virNWFilterBuildOne(virNWFilterDriverStatePtr driver,
struct virNWFilterBuildData { struct virNWFilterBuildData {
virNWFilterDriverStatePtr driver; virNWFilterDriverStatePtr driver;
virHashTablePtr skipInterfaces; GHashTable *skipInterfaces;
int step; int step;
}; };

View File

@ -49,7 +49,7 @@ int virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
int virNWFilterTeardownFilter(virNWFilterBindingDefPtr binding); int virNWFilterTeardownFilter(virNWFilterBindingDefPtr binding);
virHashTablePtr virNWFilterCreateVarHashmap(const char *macaddr, GHashTable *virNWFilterCreateVarHashmap(const char *macaddr,
const virNWFilterVarValue *value); const virNWFilterVarValue *value);
int virNWFilterBuildAll(virNWFilterDriverStatePtr driver, int virNWFilterBuildAll(virNWFilterDriverStatePtr driver,

View File

@ -112,10 +112,10 @@ struct ether_vlan_header
static virMutex pendingLearnReqLock = VIR_MUTEX_INITIALIZER; static virMutex pendingLearnReqLock = VIR_MUTEX_INITIALIZER;
static virHashTablePtr pendingLearnReq; static GHashTable *pendingLearnReq;
static virMutex ifaceMapLock = VIR_MUTEX_INITIALIZER; static virMutex ifaceMapLock = VIR_MUTEX_INITIALIZER;
static virHashTablePtr ifaceLockMap; static GHashTable *ifaceLockMap;
typedef struct _virNWFilterIfaceLock virNWFilterIfaceLock; typedef struct _virNWFilterIfaceLock virNWFilterIfaceLock;
typedef virNWFilterIfaceLock *virNWFilterIfaceLockPtr; typedef virNWFilterIfaceLock *virNWFilterIfaceLockPtr;

View File

@ -36,7 +36,7 @@ struct _virNWFilterRuleInst {
virNWFilterChainPriority chainPriority; virNWFilterChainPriority chainPriority;
virNWFilterRuleDefPtr def; virNWFilterRuleDefPtr def;
virNWFilterRulePriority priority; virNWFilterRulePriority priority;
virHashTablePtr vars; GHashTable *vars;
}; };

View File

@ -2128,7 +2128,7 @@ qemuAgentGetInterfaceOneAddress(virDomainIPAddressPtr ip_addr,
static int static int
qemuAgentGetInterfaceAddresses(virDomainInterfacePtr **ifaces_ret, qemuAgentGetInterfaceAddresses(virDomainInterfacePtr **ifaces_ret,
size_t *ifaces_count, size_t *ifaces_count,
virHashTablePtr ifaces_store, GHashTable *ifaces_store,
virJSONValuePtr iface_obj) virJSONValuePtr iface_obj)
{ {
virJSONValuePtr ip_addr_arr = NULL; virJSONValuePtr ip_addr_arr = NULL;
@ -2205,7 +2205,7 @@ static int
qemuAgentGetAllInterfaceAddresses(virDomainInterfacePtr **ifaces_ret, qemuAgentGetAllInterfaceAddresses(virDomainInterfacePtr **ifaces_ret,
virJSONValuePtr ret_array) virJSONValuePtr ret_array)
{ {
g_autoptr(virHashTable) ifaces_store = NULL; g_autoptr(GHashTable) ifaces_store = NULL;
size_t ifaces_count = 0; size_t ifaces_count = 0;
size_t i; size_t i;

View File

@ -180,7 +180,7 @@ qemuBackupDiskPrepareOneBitmapsChain(virStorageSourcePtr backingChain,
const char *targetbitmap, const char *targetbitmap,
const char *incremental, const char *incremental,
virJSONValuePtr actions, virJSONValuePtr actions,
virHashTablePtr blockNamedNodeData) GHashTable *blockNamedNodeData)
{ {
g_autoptr(virJSONValue) tmpactions = NULL; g_autoptr(virJSONValue) tmpactions = NULL;
@ -201,7 +201,7 @@ qemuBackupDiskPrepareOneBitmapsChain(virStorageSourcePtr backingChain,
static int static int
qemuBackupDiskPrepareOneBitmaps(struct qemuBackupDiskData *dd, qemuBackupDiskPrepareOneBitmaps(struct qemuBackupDiskData *dd,
virJSONValuePtr actions, virJSONValuePtr actions,
virHashTablePtr blockNamedNodeData) GHashTable *blockNamedNodeData)
{ {
if (!qemuBlockBitmapChainIsValid(dd->domdisk->src, if (!qemuBlockBitmapChainIsValid(dd->domdisk->src,
dd->backupdisk->incremental, dd->backupdisk->incremental,
@ -238,7 +238,7 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
struct qemuBackupDiskData *dd, struct qemuBackupDiskData *dd,
virJSONValuePtr actions, virJSONValuePtr actions,
bool pull, bool pull,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
virQEMUDriverConfigPtr cfg) virQEMUDriverConfigPtr cfg)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
@ -344,7 +344,7 @@ qemuBackupDiskPrepareDataOnePull(virJSONValuePtr actions,
static ssize_t static ssize_t
qemuBackupDiskPrepareData(virDomainObjPtr vm, qemuBackupDiskPrepareData(virDomainObjPtr vm,
virDomainBackupDefPtr def, virDomainBackupDefPtr def,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
virJSONValuePtr actions, virJSONValuePtr actions,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
struct qemuBackupDiskData **rdd) struct qemuBackupDiskData **rdd)
@ -390,7 +390,7 @@ qemuBackupDiskPrepareData(virDomainObjPtr vm,
static int static int
qemuBackupDiskPrepareOneStorage(virDomainObjPtr vm, qemuBackupDiskPrepareOneStorage(virDomainObjPtr vm,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
struct qemuBackupDiskData *dd, struct qemuBackupDiskData *dd,
bool reuse_external) bool reuse_external)
{ {
@ -458,7 +458,7 @@ static int
qemuBackupDiskPrepareStorage(virDomainObjPtr vm, qemuBackupDiskPrepareStorage(virDomainObjPtr vm,
struct qemuBackupDiskData *disks, struct qemuBackupDiskData *disks,
size_t ndisks, size_t ndisks,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
bool reuse_external) bool reuse_external)
{ {
size_t i; size_t i;
@ -706,7 +706,7 @@ qemuBackupBegin(virDomainObjPtr vm,
g_autofree char *tlsSecretAlias = NULL; g_autofree char *tlsSecretAlias = NULL;
struct qemuBackupDiskData *dd = NULL; struct qemuBackupDiskData *dd = NULL;
ssize_t ndd = 0; ssize_t ndd = 0;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
bool job_started = false; bool job_started = false;
bool nbd_running = false; bool nbd_running = false;
bool reuse = (flags & VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL); bool reuse = (flags & VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL);

View File

@ -59,4 +59,4 @@ qemuBackupDiskPrepareOneBitmapsChain(virStorageSourcePtr backingChain,
const char *targetbitmap, const char *targetbitmap,
const char *incremental, const char *incremental,
virJSONValuePtr actions, virJSONValuePtr actions,
virHashTablePtr blockNamedNodeData); GHashTable *blockNamedNodeData);

View File

@ -56,7 +56,7 @@ qemuBlockNamedNodesArrayToHash(size_t pos G_GNUC_UNUSED,
virJSONValuePtr item, virJSONValuePtr item,
void *opaque) void *opaque)
{ {
virHashTablePtr table = opaque; GHashTable *table = opaque;
const char *name; const char *name;
if (!(name = virJSONValueObjectGetString(item, "node-name"))) if (!(name = virJSONValueObjectGetString(item, "node-name")))
@ -120,14 +120,14 @@ qemuBlockDriverMatch(const char *drvname,
struct qemuBlockNodeNameGetBackingChainData { struct qemuBlockNodeNameGetBackingChainData {
virHashTablePtr nodenamestable; GHashTable *nodenamestable;
virHashTablePtr disks; GHashTable *disks;
}; };
static int static int
qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr next, qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr next,
virHashTablePtr nodenamestable, GHashTable *nodenamestable,
qemuBlockNodeNameBackingChainDataPtr *nodenamedata) qemuBlockNodeNameBackingChainDataPtr *nodenamedata)
{ {
g_autoptr(qemuBlockNodeNameBackingChainData) data = NULL; g_autoptr(qemuBlockNodeNameBackingChainData) data = NULL;
@ -224,13 +224,13 @@ qemuBlockNodeNameGetBackingChainDisk(size_t pos G_GNUC_UNUSED,
* *
* Returns a hash table on success and NULL on failure. * Returns a hash table on success and NULL on failure.
*/ */
virHashTablePtr GHashTable *
qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodes, qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodes,
virJSONValuePtr blockstats) virJSONValuePtr blockstats)
{ {
struct qemuBlockNodeNameGetBackingChainData data; struct qemuBlockNodeNameGetBackingChainData data;
g_autoptr(virHashTable) namednodestable = NULL; g_autoptr(GHashTable) namednodestable = NULL;
g_autoptr(virHashTable) disks = NULL; g_autoptr(GHashTable) disks = NULL;
memset(&data, 0, sizeof(data)); memset(&data, 0, sizeof(data));
@ -273,7 +273,7 @@ qemuBlockDiskClearDetectedNodes(virDomainDiskDefPtr disk)
static int static int
qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk, qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk,
virHashTablePtr disktable) GHashTable *disktable)
{ {
qemuBlockNodeNameBackingChainDataPtr entry = NULL; qemuBlockNodeNameBackingChainDataPtr entry = NULL;
virStorageSourcePtr src = disk->src; virStorageSourcePtr src = disk->src;
@ -324,7 +324,7 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(virHashTable) disktable = NULL; g_autoptr(GHashTable) disktable = NULL;
g_autoptr(virJSONValue) data = NULL; g_autoptr(virJSONValue) data = NULL;
g_autoptr(virJSONValue) blockstats = NULL; g_autoptr(virJSONValue) blockstats = NULL;
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;
@ -363,12 +363,12 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver,
* Returns a hash table organized by the node name of the JSON value objects of * Returns a hash table organized by the node name of the JSON value objects of
* data for given qemu block nodes. * data for given qemu block nodes.
* *
* Returns a filled virHashTablePtr on success NULL on error. * Returns a filled GHashTable *on success NULL on error.
*/ */
virHashTablePtr GHashTable *
qemuBlockGetNodeData(virJSONValuePtr data) qemuBlockGetNodeData(virJSONValuePtr data)
{ {
g_autoptr(virHashTable) nodedata = NULL; g_autoptr(GHashTable) nodedata = NULL;
if (!(nodedata = virHashNew(virJSONValueHashFree))) if (!(nodedata = virHashNew(virJSONValueHashFree)))
return NULL; return NULL;
@ -2770,7 +2770,7 @@ qemuBlockStorageSourceCreate(virDomainObjPtr vm,
* to the detected sizes from @templ. * to the detected sizes from @templ.
*/ */
int int
qemuBlockStorageSourceCreateDetectSize(virHashTablePtr blockNamedNodeData, qemuBlockStorageSourceCreateDetectSize(GHashTable *blockNamedNodeData,
virStorageSourcePtr src, virStorageSourcePtr src,
virStorageSourcePtr templ) virStorageSourcePtr templ)
{ {
@ -2834,7 +2834,7 @@ qemuBlockRemoveImageMetadata(virQEMUDriverPtr driver,
* Looks up a bitmap named @bitmap of the @src image. * Looks up a bitmap named @bitmap of the @src image.
*/ */
qemuBlockNamedNodeDataBitmapPtr qemuBlockNamedNodeDataBitmapPtr
qemuBlockNamedNodeDataGetBitmapByName(virHashTablePtr blockNamedNodeData, qemuBlockNamedNodeDataGetBitmapByName(GHashTable *blockNamedNodeData,
virStorageSourcePtr src, virStorageSourcePtr src,
const char *bitmap) const char *bitmap)
{ {
@ -2857,13 +2857,13 @@ qemuBlockNamedNodeDataGetBitmapByName(virHashTablePtr blockNamedNodeData,
} }
virHashTablePtr GHashTable *
qemuBlockGetNamedNodeData(virDomainObjPtr vm, qemuBlockGetNamedNodeData(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virQEMUDriverPtr driver = priv->driver; virQEMUDriverPtr driver = priv->driver;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
bool supports_flat = virQEMUCapsGet(priv->qemuCaps, bool supports_flat = virQEMUCapsGet(priv->qemuCaps,
QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT); QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT);
@ -2892,7 +2892,7 @@ qemuBlockGetNamedNodeData(virDomainObjPtr vm,
static GSList * static GSList *
qemuBlockGetBitmapMergeActionsGetBitmaps(virStorageSourcePtr topsrc, qemuBlockGetBitmapMergeActionsGetBitmaps(virStorageSourcePtr topsrc,
const char *bitmapname, const char *bitmapname,
virHashTablePtr blockNamedNodeData) GHashTable *blockNamedNodeData)
{ {
g_autoptr(GSList) ret = NULL; g_autoptr(GSList) ret = NULL;
qemuBlockNamedNodeDataPtr entry; qemuBlockNamedNodeDataPtr entry;
@ -2972,7 +2972,7 @@ qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc,
const char *dstbitmapname, const char *dstbitmapname,
virStorageSourcePtr writebitmapsrc, virStorageSourcePtr writebitmapsrc,
virJSONValuePtr *actions, virJSONValuePtr *actions,
virHashTablePtr blockNamedNodeData) GHashTable *blockNamedNodeData)
{ {
g_autoptr(virJSONValue) act = virJSONValueNewArray(); g_autoptr(virJSONValue) act = virJSONValueNewArray();
virStorageSourcePtr n; virStorageSourcePtr n;
@ -3066,7 +3066,7 @@ qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc,
bool bool
qemuBlockBitmapChainIsValid(virStorageSourcePtr src, qemuBlockBitmapChainIsValid(virStorageSourcePtr src,
const char *bitmapname, const char *bitmapname,
virHashTablePtr blockNamedNodeData) GHashTable *blockNamedNodeData)
{ {
virStorageSourcePtr n; virStorageSourcePtr n;
bool found = false; bool found = false;
@ -3119,7 +3119,7 @@ qemuBlockBitmapChainIsValid(virStorageSourcePtr src,
int int
qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr src, qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr src,
virStorageSourcePtr mirror, virStorageSourcePtr mirror,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
bool shallow, bool shallow,
virJSONValuePtr *actions) virJSONValuePtr *actions)
{ {
@ -3153,7 +3153,7 @@ int
qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc, qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc,
virStorageSourcePtr basesrc, virStorageSourcePtr basesrc,
bool active, bool active,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
virJSONValuePtr *actions) virJSONValuePtr *actions)
{ {
virStorageSourcePtr writebitmapsrc = NULL; virStorageSourcePtr writebitmapsrc = NULL;

View File

@ -41,7 +41,7 @@ struct qemuBlockNodeNameBackingChainData {
char *drvstorage; char *drvstorage;
}; };
virHashTablePtr GHashTable *
qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodesdata, qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodesdata,
virJSONValuePtr blockstats); virJSONValuePtr blockstats);
@ -50,7 +50,7 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob); qemuDomainAsyncJob asyncJob);
virHashTablePtr GHashTable *
qemuBlockGetNodeData(virJSONValuePtr data); qemuBlockGetNodeData(virJSONValuePtr data);
bool bool
@ -209,7 +209,7 @@ qemuBlockStorageSourceCreate(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob); qemuDomainAsyncJob asyncJob);
int int
qemuBlockStorageSourceCreateDetectSize(virHashTablePtr blockNamedNodeData, qemuBlockStorageSourceCreateDetectSize(GHashTable *blockNamedNodeData,
virStorageSourcePtr src, virStorageSourcePtr src,
virStorageSourcePtr templ); virStorageSourcePtr templ);
@ -220,11 +220,11 @@ qemuBlockRemoveImageMetadata(virQEMUDriverPtr driver,
virStorageSourcePtr src); virStorageSourcePtr src);
qemuBlockNamedNodeDataBitmapPtr qemuBlockNamedNodeDataBitmapPtr
qemuBlockNamedNodeDataGetBitmapByName(virHashTablePtr blockNamedNodeData, qemuBlockNamedNodeDataGetBitmapByName(GHashTable *blockNamedNodeData,
virStorageSourcePtr src, virStorageSourcePtr src,
const char *bitmap); const char *bitmap);
virHashTablePtr GHashTable *
qemuBlockGetNamedNodeData(virDomainObjPtr vm, qemuBlockGetNamedNodeData(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob); qemuDomainAsyncJob asyncJob);
@ -236,17 +236,17 @@ qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc,
const char *dstbitmapname, const char *dstbitmapname,
virStorageSourcePtr writebitmapsrc, virStorageSourcePtr writebitmapsrc,
virJSONValuePtr *actions, virJSONValuePtr *actions,
virHashTablePtr blockNamedNodeData); GHashTable *blockNamedNodeData);
bool bool
qemuBlockBitmapChainIsValid(virStorageSourcePtr src, qemuBlockBitmapChainIsValid(virStorageSourcePtr src,
const char *bitmapname, const char *bitmapname,
virHashTablePtr blockNamedNodeData); GHashTable *blockNamedNodeData);
int int
qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr src, qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr src,
virStorageSourcePtr mirror, virStorageSourcePtr mirror,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
bool shallow, bool shallow,
virJSONValuePtr *actions); virJSONValuePtr *actions);
@ -254,7 +254,7 @@ int
qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc, qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc,
virStorageSourcePtr basesrc, virStorageSourcePtr basesrc,
bool active, bool active,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
virJSONValuePtr *actions); virJSONValuePtr *actions);
int int

View File

@ -942,7 +942,7 @@ qemuBlockJobProcessEventCompletedPullBitmaps(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
g_autoptr(virJSONValue) actions = NULL; g_autoptr(virJSONValue) actions = NULL;
if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, asyncJob))) if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, asyncJob)))
@ -1097,7 +1097,7 @@ qemuBlockJobProcessEventCompletedCommitBitmaps(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
g_autoptr(virJSONValue) actions = NULL; g_autoptr(virJSONValue) actions = NULL;
bool active = job->type == QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT; bool active = job->type == QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT;
@ -1326,7 +1326,7 @@ qemuBlockJobProcessEventCompletedCopyBitmaps(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
g_autoptr(virJSONValue) actions = NULL; g_autoptr(virJSONValue) actions = NULL;
bool shallow = job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW; bool shallow = job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW;

View File

@ -653,7 +653,7 @@ typedef virQEMUDomainCapsCache *virQEMUDomainCapsCachePtr;
struct _virQEMUDomainCapsCache { struct _virQEMUDomainCapsCache {
virObjectLockable parent; virObjectLockable parent;
virHashTablePtr cache; GHashTable *cache;
}; };
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUDomainCapsCache, virObjectUnref); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUDomainCapsCache, virObjectUnref);
@ -2687,7 +2687,7 @@ virQEMUCapsProbeQMPDeviceProperties(virQEMUCapsPtr qemuCaps,
for (i = 0; i < G_N_ELEMENTS(virQEMUCapsDeviceProps); i++) { for (i = 0; i < G_N_ELEMENTS(virQEMUCapsDeviceProps); i++) {
virQEMUCapsDeviceTypeProps *device = virQEMUCapsDeviceProps + i; virQEMUCapsDeviceTypeProps *device = virQEMUCapsDeviceProps + i;
g_autoptr(virHashTable) qemuprops = NULL; g_autoptr(GHashTable) qemuprops = NULL;
size_t j; size_t j;
if (device->capsCondition >= 0 && if (device->capsCondition >= 0 &&
@ -3066,7 +3066,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
const char *model = virtType == VIR_DOMAIN_VIRT_KVM ? "host" : "max"; const char *model = virtType == VIR_DOMAIN_VIRT_KVM ? "host" : "max";
qemuMonitorCPUModelInfoPtr modelInfo = NULL; qemuMonitorCPUModelInfoPtr modelInfo = NULL;
qemuMonitorCPUModelInfoPtr nonMigratable = NULL; qemuMonitorCPUModelInfoPtr nonMigratable = NULL;
virHashTablePtr hash = NULL; GHashTable *hash = NULL;
virCPUDefPtr cpu; virCPUDefPtr cpu;
qemuMonitorCPUModelExpansionType type; qemuMonitorCPUModelExpansionType type;
bool fail_no_props = true; bool fail_no_props = true;
@ -5260,7 +5260,7 @@ virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCapsPtr qemuCaps,
{ {
struct virQEMUCapsStringFlags *entry; struct virQEMUCapsStringFlags *entry;
virJSONValuePtr schemareply; virJSONValuePtr schemareply;
virHashTablePtr schema = NULL; GHashTable *schema = NULL;
size_t i; size_t i;
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_QMP_SCHEMA)) if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_QMP_SCHEMA))

View File

@ -107,7 +107,7 @@ qemuCheckpointWriteMetadata(virDomainObjPtr vm,
int int
qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src, qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
const char *delbitmap, const char *delbitmap,
virJSONValuePtr actions, virJSONValuePtr actions,
const char *diskdst, const char *diskdst,
@ -152,7 +152,7 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm,
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virQEMUDriverPtr driver = priv->driver; virQEMUDriverPtr driver = priv->driver;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
int rc = -1; int rc = -1;
g_autoptr(virJSONValue) actions = NULL; g_autoptr(virJSONValue) actions = NULL;
size_t i; size_t i;
@ -579,7 +579,7 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObjPtr vm,
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virQEMUDriverPtr driver = priv->driver; virQEMUDriverPtr driver = priv->driver;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
g_autofree struct qemuCheckpointDiskMap *diskmap = NULL; g_autofree struct qemuCheckpointDiskMap *diskmap = NULL;
g_autoptr(virJSONValue) recoveractions = NULL; g_autoptr(virJSONValue) recoveractions = NULL;
g_autoptr(virJSONValue) mergeactions = virJSONValueNewArray(); g_autoptr(virJSONValue) mergeactions = virJSONValueNewArray();

View File

@ -74,7 +74,7 @@ qemuCheckpointRollbackMetadata(virDomainObjPtr vm,
int int
qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src, qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
const char *delbitmap, const char *delbitmap,
virJSONValuePtr actions, virJSONValuePtr actions,
const char *diskdst, const char *diskdst,

View File

@ -1484,7 +1484,7 @@ qemuGetSharedDeviceKey(const char *device_path)
* being used and in the future the hostdev information. * being used and in the future the hostdev information.
*/ */
static int static int
qemuCheckUnprivSGIO(virHashTablePtr sharedDevices, qemuCheckUnprivSGIO(GHashTable *sharedDevices,
const char *device_path, const char *device_path,
int sgio) int sgio)
{ {
@ -1532,7 +1532,7 @@ qemuCheckUnprivSGIO(virHashTablePtr sharedDevices,
* Returns 0 if no conflicts, otherwise returns -1. * Returns 0 if no conflicts, otherwise returns -1.
*/ */
static int static int
qemuCheckSharedDisk(virHashTablePtr sharedDevices, qemuCheckSharedDisk(GHashTable *sharedDevices,
virDomainDiskDefPtr disk) virDomainDiskDefPtr disk)
{ {
int ret; int ret;

View File

@ -296,7 +296,7 @@ struct _virQEMUDriver {
virHostdevManagerPtr hostdevMgr; virHostdevManagerPtr hostdevMgr;
/* Immutable pointer. Unsafe APIs. XXX */ /* Immutable pointer. Unsafe APIs. XXX */
virHashTablePtr sharedDevices; GHashTable *sharedDevices;
/* Immutable pointer, immutable object */ /* Immutable pointer, immutable object */
virPortAllocatorRangePtr remotePorts; virPortAllocatorRangePtr remotePorts;

View File

@ -7830,7 +7830,7 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr driver,
int asyncJob) int asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virHashTablePtr meminfo = NULL; GHashTable *meminfo = NULL;
int rc; int rc;
size_t i; size_t i;

View File

@ -244,7 +244,7 @@ struct _qemuDomainObjPrivate {
bool memPrealloc; bool memPrealloc;
/* running block jobs */ /* running block jobs */
virHashTablePtr blockjobs; GHashTable *blockjobs;
bool disableSlirp; bool disableSlirp;

View File

@ -9937,7 +9937,7 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
virDomainDiskDefPtr disk = NULL; virDomainDiskDefPtr disk = NULL;
virHashTablePtr blockstats = NULL; GHashTable *blockstats = NULL;
qemuBlockStatsPtr stats; qemuBlockStatsPtr stats;
size_t i; size_t i;
int nstats; int nstats;
@ -14980,7 +14980,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
g_autoptr(qemuBlockStorageSourceChainData) crdata = NULL; g_autoptr(qemuBlockStorageSourceChainData) crdata = NULL;
virStorageSourcePtr n; virStorageSourcePtr n;
virStorageSourcePtr mirrorBacking = NULL; virStorageSourcePtr mirrorBacking = NULL;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
int rc = 0; int rc = 0;
/* Preliminaries: find the disk we are editing, sanity checks */ /* Preliminaries: find the disk we are editing, sanity checks */
@ -16543,7 +16543,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virHashTablePtr table = NULL; GHashTable *table = NULL;
bool blockdev = false; bool blockdev = false;
int ret = -1; int ret = -1;
size_t i; size_t i;
@ -18227,8 +18227,8 @@ qemuDomainGetStatsOneBlockFallback(virQEMUDriverPtr driver,
static void static void
qemuDomainGetStatsOneBlockRefreshNamed(virStorageSourcePtr src, qemuDomainGetStatsOneBlockRefreshNamed(virStorageSourcePtr src,
const char *alias, const char *alias,
virHashTablePtr stats, GHashTable *stats,
virHashTablePtr nodedata) GHashTable *nodedata)
{ {
qemuBlockStatsPtr entry; qemuBlockStatsPtr entry;
@ -18257,7 +18257,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
const char *entryname, const char *entryname,
virStorageSourcePtr src, virStorageSourcePtr src,
size_t block_idx, size_t block_idx,
virHashTablePtr stats) GHashTable *stats)
{ {
qemuBlockStats *entry; qemuBlockStats *entry;
@ -18301,7 +18301,7 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
static int static int
qemuDomainGetStatsBlockExportBackendStorage(const char *entryname, qemuDomainGetStatsBlockExportBackendStorage(const char *entryname,
virHashTablePtr stats, GHashTable *stats,
size_t recordnr, size_t recordnr,
virTypedParamListPtr params) virTypedParamListPtr params)
{ {
@ -18321,7 +18321,7 @@ qemuDomainGetStatsBlockExportBackendStorage(const char *entryname,
static int static int
qemuDomainGetStatsBlockExportFrontend(const char *frontendname, qemuDomainGetStatsBlockExportFrontend(const char *frontendname,
virHashTablePtr stats, GHashTable *stats,
size_t idx, size_t idx,
virTypedParamListPtr par) virTypedParamListPtr par)
{ {
@ -18370,8 +18370,8 @@ qemuDomainGetStatsBlockExportHeader(virDomainDiskDefPtr disk,
static int static int
qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk, qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk,
virHashTablePtr stats, GHashTable *stats,
virHashTablePtr nodestats, GHashTable *nodestats,
virTypedParamListPtr params, virTypedParamListPtr params,
size_t *recordnr, size_t *recordnr,
bool visitBacking, bool visitBacking,
@ -18461,8 +18461,8 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
size_t i; size_t i;
int ret = -1; int ret = -1;
int rc; int rc;
virHashTablePtr stats = NULL; GHashTable *stats = NULL;
virHashTablePtr nodestats = NULL; GHashTable *nodestats = NULL;
virJSONValuePtr nodedata = NULL; virJSONValuePtr nodedata = NULL;
qemuDomainObjPrivatePtr priv = dom->privateData; qemuDomainObjPrivatePtr priv = dom->privateData;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);

View File

@ -35,7 +35,7 @@
VIR_LOG_INIT("qemu.qemu_configs"); VIR_LOG_INIT("qemu.qemu_configs");
static int static int
qemuBuildFileList(virHashTablePtr files, const char *dir) qemuBuildFileList(GHashTable *files, const char *dir)
{ {
g_autoptr(DIR) dirp = NULL; g_autoptr(DIR) dirp = NULL;
struct dirent *ent = NULL; struct dirent *ent = NULL;
@ -87,7 +87,7 @@ qemuInteropFetchConfigs(const char *name,
char ***configs, char ***configs,
bool privileged) bool privileged)
{ {
g_autoptr(virHashTable) files = NULL; g_autoptr(GHashTable) files = NULL;
g_autofree char *homeConfig = NULL; g_autofree char *homeConfig = NULL;
g_autofree char *xdgConfig = NULL; g_autofree char *xdgConfig = NULL;
g_autofree char *sysLocation = virFileBuildPath(QEMU_SYSTEM_LOCATION, name, NULL); g_autofree char *sysLocation = virFileBuildPath(QEMU_SYSTEM_LOCATION, name, NULL);

View File

@ -5796,7 +5796,7 @@ qemuMigrationSrcFetchMirrorStats(virQEMUDriverPtr driver,
size_t i; size_t i;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
bool nbd = false; bool nbd = false;
virHashTablePtr blockinfo = NULL; GHashTable *blockinfo = NULL;
qemuDomainMirrorStatsPtr stats = &jobInfo->mirrorStats; qemuDomainMirrorStatsPtr stats = &jobInfo->mirrorStats;
for (i = 0; i < vm->def->ndisks; i++) { for (i = 0; i < vm->def->ndisks; i++) {

View File

@ -435,7 +435,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
virDomainObjPtr vm) virDomainObjPtr vm)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(virHashTable) stats = virHashNew(g_free); g_autoptr(GHashTable) stats = virHashNew(g_free);
bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
size_t i; size_t i;
int rc; int rc;

View File

@ -2098,11 +2098,11 @@ qemuDomainDiskInfoFree(void *value)
} }
virHashTablePtr GHashTable *
qemuMonitorGetBlockInfo(qemuMonitorPtr mon) qemuMonitorGetBlockInfo(qemuMonitorPtr mon)
{ {
int ret; int ret;
virHashTablePtr table; GHashTable *table;
QEMU_CHECK_MONITOR_NULL(mon); QEMU_CHECK_MONITOR_NULL(mon);
@ -2149,7 +2149,7 @@ qemuMonitorQueryBlockstats(qemuMonitorPtr mon)
*/ */
int int
qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon,
virHashTablePtr *ret_stats, GHashTable **ret_stats,
bool backingChain) bool backingChain)
{ {
int ret = -1; int ret = -1;
@ -2178,7 +2178,7 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon,
/* Updates "stats" to fill virtual and physical size of the image */ /* Updates "stats" to fill virtual and physical size of the image */
int int
qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon,
virHashTablePtr stats, GHashTable *stats,
bool backingChain) bool backingChain)
{ {
VIR_DEBUG("stats=%p, backing=%d", stats, backingChain); VIR_DEBUG("stats=%p, backing=%d", stats, backingChain);
@ -2191,7 +2191,7 @@ qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon,
int int
qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
virHashTablePtr stats) GHashTable *stats)
{ {
VIR_DEBUG("stats=%p", stats); VIR_DEBUG("stats=%p", stats);
@ -2210,7 +2210,7 @@ qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
* storage nodes and returns them in a hash table of qemuBlockNamedNodeDataPtrs * storage nodes and returns them in a hash table of qemuBlockNamedNodeDataPtrs
* filled with the data. The hash table keys are node names. * filled with the data. The hash table keys are node names.
*/ */
virHashTablePtr GHashTable *
qemuMonitorBlockGetNamedNodeData(qemuMonitorPtr mon, qemuMonitorBlockGetNamedNodeData(qemuMonitorPtr mon,
bool supports_flat) bool supports_flat)
{ {
@ -2889,10 +2889,10 @@ qemuMonitorChardevInfoFree(void *data)
int int
qemuMonitorGetChardevInfo(qemuMonitorPtr mon, qemuMonitorGetChardevInfo(qemuMonitorPtr mon,
virHashTablePtr *retinfo) GHashTable **retinfo)
{ {
int ret; int ret;
virHashTablePtr info = NULL; GHashTable *info = NULL;
VIR_DEBUG("retinfo=%p", retinfo); VIR_DEBUG("retinfo=%p", retinfo);
@ -3412,7 +3412,7 @@ qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon,
} }
virHashTablePtr GHashTable *
qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon, qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon,
bool rawjobname) bool rawjobname)
{ {
@ -3431,7 +3431,7 @@ qemuMonitorGetBlockJobInfo(qemuMonitorPtr mon,
const char *alias, const char *alias,
qemuMonitorBlockJobInfoPtr info) qemuMonitorBlockJobInfoPtr info)
{ {
virHashTablePtr all; GHashTable *all;
qemuMonitorBlockJobInfoPtr data; qemuMonitorBlockJobInfoPtr data;
int ret = 0; int ret = 0;
@ -3898,7 +3898,7 @@ qemuMonitorGetObjectTypes(qemuMonitorPtr mon,
} }
virHashTablePtr GHashTable *
qemuMonitorGetDeviceProps(qemuMonitorPtr mon, qemuMonitorGetDeviceProps(qemuMonitorPtr mon,
const char *device) const char *device)
{ {
@ -4299,7 +4299,7 @@ qemuMonitorSetIOThread(qemuMonitorPtr mon,
*/ */
int int
qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon, qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon,
virHashTablePtr *info) GHashTable **info)
{ {
int ret; int ret;
@ -4604,10 +4604,10 @@ qemuMonitorGetSEVMeasurement(qemuMonitorPtr mon)
int int
qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon, qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon,
virHashTablePtr *retinfo) GHashTable **retinfo)
{ {
int ret = -1; int ret = -1;
virHashTablePtr info = NULL; GHashTable *info = NULL;
*retinfo = NULL; *retinfo = NULL;

View File

@ -673,7 +673,7 @@ int qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon,
int period); int period);
int qemuMonitorBlockIOStatusToError(const char *status); int qemuMonitorBlockIOStatusToError(const char *status);
virHashTablePtr qemuMonitorGetBlockInfo(qemuMonitorPtr mon); GHashTable *qemuMonitorGetBlockInfo(qemuMonitorPtr mon);
virJSONValuePtr qemuMonitorQueryBlockstats(qemuMonitorPtr mon); virJSONValuePtr qemuMonitorQueryBlockstats(qemuMonitorPtr mon);
@ -701,17 +701,17 @@ struct _qemuBlockStats {
}; };
int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon,
virHashTablePtr *ret_stats, GHashTable **ret_stats,
bool backingChain) bool backingChain)
ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(2);
int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon,
virHashTablePtr stats, GHashTable *stats,
bool backingChain) bool backingChain)
ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(2);
int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
virHashTablePtr stats) GHashTable *stats)
ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(2);
typedef struct _qemuBlockNamedNodeDataBitmap qemuBlockNamedNodeDataBitmap; typedef struct _qemuBlockNamedNodeDataBitmap qemuBlockNamedNodeDataBitmap;
@ -740,7 +740,7 @@ struct _qemuBlockNamedNodeData {
unsigned long long clusterSize; unsigned long long clusterSize;
}; };
virHashTablePtr GHashTable *
qemuMonitorBlockGetNamedNodeData(qemuMonitorPtr mon, qemuMonitorBlockGetNamedNodeData(qemuMonitorPtr mon,
bool supports_flat); bool supports_flat);
@ -990,7 +990,7 @@ struct _qemuMonitorChardevInfo {
}; };
void qemuMonitorChardevInfoFree(void *data); void qemuMonitorChardevInfoFree(void *data);
int qemuMonitorGetChardevInfo(qemuMonitorPtr mon, int qemuMonitorGetChardevInfo(qemuMonitorPtr mon,
virHashTablePtr *retinfo); GHashTable **retinfo);
int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon, int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon,
const char *bus, const char *bus,
@ -1126,7 +1126,7 @@ struct _qemuMonitorBlockJobInfo {
int ready; /* -1 if unknown, 0 if not ready, 1 if ready */ int ready; /* -1 if unknown, 0 if not ready, 1 if ready */
}; };
virHashTablePtr qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon, GHashTable *qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon,
bool rawjobname); bool rawjobname);
int qemuMonitorGetBlockJobInfo(qemuMonitorPtr mon, int qemuMonitorGetBlockJobInfo(qemuMonitorPtr mon,
const char *device, const char *device,
@ -1295,7 +1295,7 @@ int qemuMonitorGetKVMState(qemuMonitorPtr mon,
int qemuMonitorGetObjectTypes(qemuMonitorPtr mon, int qemuMonitorGetObjectTypes(qemuMonitorPtr mon,
char ***types); char ***types);
virHashTablePtr qemuMonitorGetDeviceProps(qemuMonitorPtr mon, GHashTable *qemuMonitorGetDeviceProps(qemuMonitorPtr mon,
const char *device); const char *device);
int qemuMonitorGetObjectProps(qemuMonitorPtr mon, int qemuMonitorGetObjectProps(qemuMonitorPtr mon,
const char *object, const char *object,
@ -1389,7 +1389,7 @@ struct _qemuMonitorMemoryDeviceInfo {
}; };
int qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon, int qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon,
virHashTablePtr *info) GHashTable **info)
ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(2);
int qemuMonitorMigrateIncoming(qemuMonitorPtr mon, int qemuMonitorMigrateIncoming(qemuMonitorPtr mon,
@ -1451,7 +1451,7 @@ struct _qemuMonitorPRManagerInfo {
}; };
int qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon, int qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon,
virHashTablePtr *retinfo); GHashTable **retinfo);
typedef struct _qemuMonitorCurrentMachineInfo qemuMonitorCurrentMachineInfo; typedef struct _qemuMonitorCurrentMachineInfo qemuMonitorCurrentMachineInfo;
typedef qemuMonitorCurrentMachineInfo *qemuMonitorCurrentMachineInfoPtr; typedef qemuMonitorCurrentMachineInfo *qemuMonitorCurrentMachineInfoPtr;

View File

@ -2475,7 +2475,7 @@ qemuMonitorJSONGetBlockDevDevice(virJSONValuePtr dev)
static int static int
qemuMonitorJSONBlockInfoAdd(virHashTablePtr table, qemuMonitorJSONBlockInfoAdd(GHashTable *table,
struct qemuDomainDiskInfo *info, struct qemuDomainDiskInfo *info,
const char *entryname) const char *entryname)
{ {
@ -2505,7 +2505,7 @@ qemuMonitorJSONBlockInfoAdd(virHashTablePtr table,
int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
virHashTablePtr table) GHashTable *table)
{ {
int ret = -1; int ret = -1;
size_t i; size_t i;
@ -2633,7 +2633,7 @@ qemuMonitorJSONBlockStatsCollectData(virJSONValuePtr dev,
static int static int
qemuMonitorJSONAddOneBlockStatsInfo(qemuBlockStatsPtr bstats, qemuMonitorJSONAddOneBlockStatsInfo(qemuBlockStatsPtr bstats,
const char *name, const char *name,
virHashTablePtr stats) GHashTable *stats)
{ {
qemuBlockStatsPtr copy = NULL; qemuBlockStatsPtr copy = NULL;
@ -2655,7 +2655,7 @@ static int
qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr dev, qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr dev,
const char *dev_name, const char *dev_name,
int depth, int depth,
virHashTablePtr hash, GHashTable *hash,
bool backingChain) bool backingChain)
{ {
g_autofree qemuBlockStatsPtr bstats = NULL; g_autofree qemuBlockStatsPtr bstats = NULL;
@ -2730,7 +2730,7 @@ qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon)
int int
qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
virHashTablePtr hash, GHashTable *hash,
bool backingChain) bool backingChain)
{ {
int nstats = 0; int nstats = 0;
@ -2779,7 +2779,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
static int static int
qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValuePtr image, qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValuePtr image,
const char *name, const char *name,
virHashTablePtr stats, GHashTable *stats,
qemuBlockStatsPtr *entry) qemuBlockStatsPtr *entry)
{ {
qemuBlockStatsPtr bstats; qemuBlockStatsPtr bstats;
@ -2814,7 +2814,7 @@ static int
qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image, qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image,
const char *dev_name, const char *dev_name,
int depth, int depth,
virHashTablePtr stats, GHashTable *stats,
bool backingChain) bool backingChain)
{ {
int ret = -1; int ret = -1;
@ -2843,7 +2843,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image,
int int
qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon,
virHashTablePtr stats, GHashTable *stats,
bool backingChain) bool backingChain)
{ {
int ret = -1; int ret = -1;
@ -2889,7 +2889,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker(size_t pos G_GNUC_UNUSED,
virJSONValuePtr val, virJSONValuePtr val,
void *opaque) void *opaque)
{ {
virHashTablePtr stats = opaque; GHashTable *stats = opaque;
virJSONValuePtr image; virJSONValuePtr image;
const char *nodename; const char *nodename;
qemuBlockStatsPtr entry; qemuBlockStatsPtr entry;
@ -2914,7 +2914,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker(size_t pos G_GNUC_UNUSED,
int int
qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
virHashTablePtr stats) GHashTable *stats)
{ {
virJSONValuePtr nodes; virJSONValuePtr nodes;
int ret = -1; int ret = -1;
@ -3018,7 +3018,7 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED,
virJSONValuePtr val, virJSONValuePtr val,
void *opaque) void *opaque)
{ {
virHashTablePtr nodes = opaque; GHashTable *nodes = opaque;
virJSONValuePtr img; virJSONValuePtr img;
virJSONValuePtr bitmaps; virJSONValuePtr bitmaps;
const char *nodename; const char *nodename;
@ -3057,10 +3057,10 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED,
} }
virHashTablePtr GHashTable *
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes) qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes)
{ {
g_autoptr(virHashTable) ret = NULL; g_autoptr(GHashTable) ret = NULL;
ret = virHashNew((virHashDataFree) qemuMonitorJSONBlockNamedNodeDataFree); ret = virHashNew((virHashDataFree) qemuMonitorJSONBlockNamedNodeDataFree);
@ -3073,7 +3073,7 @@ qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes)
} }
virHashTablePtr GHashTable *
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon, qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon,
bool supports_flat) bool supports_flat)
{ {
@ -4462,7 +4462,7 @@ qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias,
*/ */
static int static int
qemuMonitorJSONExtractChardevInfo(virJSONValuePtr reply, qemuMonitorJSONExtractChardevInfo(virJSONValuePtr reply,
virHashTablePtr info) GHashTable *info)
{ {
virJSONValuePtr data; virJSONValuePtr data;
int ret = -1; int ret = -1;
@ -4530,7 +4530,7 @@ qemuMonitorJSONExtractChardevInfo(virJSONValuePtr reply,
int int
qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon, qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon,
virHashTablePtr info) GHashTable *info)
{ {
int ret = -1; int ret = -1;
@ -5082,7 +5082,7 @@ int qemuMonitorJSONScreendump(qemuMonitorPtr mon,
static int static int
qemuMonitorJSONParseBlockJobInfo(virHashTablePtr blockJobs, qemuMonitorJSONParseBlockJobInfo(GHashTable *blockJobs,
virJSONValuePtr entry, virJSONValuePtr entry,
bool rawjobname) bool rawjobname)
{ {
@ -5150,7 +5150,7 @@ qemuMonitorJSONParseBlockJobInfo(virHashTablePtr blockJobs,
return 0; return 0;
} }
virHashTablePtr GHashTable *
qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon, qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon,
bool rawjobname) bool rawjobname)
{ {
@ -5159,7 +5159,7 @@ qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon,
virJSONValuePtr data; virJSONValuePtr data;
size_t nr_results; size_t nr_results;
size_t i; size_t i;
virHashTablePtr blockJobs = NULL; GHashTable *blockJobs = NULL;
cmd = qemuMonitorJSONMakeCommand("query-block-jobs", NULL); cmd = qemuMonitorJSONMakeCommand("query-block-jobs", NULL);
if (!cmd) if (!cmd)
@ -6949,7 +6949,7 @@ qemuMonitorJSONGetDevicePropsWorker(size_t pos G_GNUC_UNUSED,
void *opaque) void *opaque)
{ {
const char *name = virJSONValueObjectGetString(item, "name"); const char *name = virJSONValueObjectGetString(item, "name");
virHashTablePtr devices = opaque; GHashTable *devices = opaque;
if (!name) { if (!name) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@ -6964,11 +6964,11 @@ qemuMonitorJSONGetDevicePropsWorker(size_t pos G_GNUC_UNUSED,
} }
virHashTablePtr GHashTable *
qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
const char *device) const char *device)
{ {
g_autoptr(virHashTable) props = virHashNew(virJSONValueHashFree); g_autoptr(GHashTable) props = virHashNew(virJSONValueHashFree);
g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL; g_autoptr(virJSONValue) reply = NULL;
@ -8379,7 +8379,7 @@ qemuMonitorJSONSetIOThread(qemuMonitorPtr mon,
int int
qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon, qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
virHashTablePtr info) GHashTable *info)
{ {
int ret = -1; int ret = -1;
virJSONValuePtr cmd; virJSONValuePtr cmd;
@ -9263,7 +9263,7 @@ qemuMonitorJSONGetSEVMeasurement(qemuMonitorPtr mon)
*/ */
static int static int
qemuMonitorJSONExtractPRManagerInfo(virJSONValuePtr reply, qemuMonitorJSONExtractPRManagerInfo(virJSONValuePtr reply,
virHashTablePtr info) GHashTable *info)
{ {
qemuMonitorPRManagerInfoPtr entry = NULL; qemuMonitorPRManagerInfoPtr entry = NULL;
virJSONValuePtr data; virJSONValuePtr data;
@ -9307,7 +9307,7 @@ qemuMonitorJSONExtractPRManagerInfo(virJSONValuePtr reply,
int int
qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon, qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon,
virHashTablePtr info) GHashTable *info)
{ {
int ret = -1; int ret = -1;
virJSONValuePtr cmd; virJSONValuePtr cmd;

View File

@ -75,22 +75,22 @@ int qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitorPtr mon,
char *balloonpath, char *balloonpath,
int period); int period);
int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
virHashTablePtr table); GHashTable *table);
virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon); virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon);
int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
virHashTablePtr hash, GHashTable *hash,
bool backingChain); bool backingChain);
int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon,
virHashTablePtr stats, GHashTable *stats,
bool backingChain); bool backingChain);
int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
virHashTablePtr stats); GHashTable *stats);
virHashTablePtr GHashTable *
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes); qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes);
virHashTablePtr GHashTable *
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon, qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon,
bool supports_flat); bool supports_flat);
@ -231,7 +231,7 @@ int qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias,
virNetDevRxFilterPtr *filter); virNetDevRxFilterPtr *filter);
int qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon, int qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon,
virHashTablePtr info); GHashTable *info);
int qemuMonitorJSONAttachPCIDiskController(qemuMonitorPtr mon, int qemuMonitorJSONAttachPCIDiskController(qemuMonitorPtr mon,
const char *bus, const char *bus,
@ -341,7 +341,7 @@ int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
unsigned long long speed) unsigned long long speed)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon, GHashTable *qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon,
bool rawjobname) bool rawjobname)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
@ -499,7 +499,7 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon,
qemuMonitorJSONObjectPropertyPtr prop) qemuMonitorJSONObjectPropertyPtr prop)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
virHashTablePtr qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, GHashTable *qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon,
const char *device) const char *device)
ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(2);
int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon,
@ -564,7 +564,7 @@ int qemuMonitorJSONSetIOThread(qemuMonitorPtr mon,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon, int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
virHashTablePtr info) GHashTable *info)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon, int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
@ -645,7 +645,7 @@ int qemuMonitorJSONBlockdevMediumInsert(qemuMonitorPtr mon,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon, int qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon,
virHashTablePtr info) GHashTable *info)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int int

View File

@ -2170,7 +2170,7 @@ qemuProcessMonitorReportLogError(qemuMonitorPtr mon G_GNUC_UNUSED,
static int static int
qemuProcessLookupPTYs(virDomainChrDefPtr *devices, qemuProcessLookupPTYs(virDomainChrDefPtr *devices,
int count, int count,
virHashTablePtr info) GHashTable *info)
{ {
size_t i; size_t i;
@ -2209,7 +2209,7 @@ qemuProcessLookupPTYs(virDomainChrDefPtr *devices,
static int static int
qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm, qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm,
virHashTablePtr info) GHashTable *info)
{ {
size_t i = 0; size_t i = 0;
@ -2249,7 +2249,7 @@ qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm,
static void static void
qemuProcessRefreshChannelVirtioState(virQEMUDriverPtr driver, qemuProcessRefreshChannelVirtioState(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virHashTablePtr info, GHashTable *info,
int booted) int booted)
{ {
size_t i; size_t i;
@ -2291,7 +2291,7 @@ qemuRefreshVirtioChannelState(virQEMUDriverPtr driver,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virHashTablePtr info = NULL; GHashTable *info = NULL;
int ret = -1; int ret = -1;
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
@ -2315,7 +2315,7 @@ qemuRefreshVirtioChannelState(virQEMUDriverPtr driver,
static int static int
qemuProcessRefreshPRManagerState(virDomainObjPtr vm, qemuProcessRefreshPRManagerState(virDomainObjPtr vm,
virHashTablePtr info) GHashTable *info)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
qemuMonitorPRManagerInfoPtr prManagerInfo; qemuMonitorPRManagerInfoPtr prManagerInfo;
@ -2343,7 +2343,7 @@ qemuRefreshPRManagerState(virQEMUDriverPtr driver,
virDomainObjPtr vm) virDomainObjPtr vm)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virHashTablePtr info = NULL; GHashTable *info = NULL;
int ret = -1; int ret = -1;
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER) || if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER) ||
@ -2438,7 +2438,7 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
qemuDomainLogContextPtr logCtxt) qemuDomainLogContextPtr logCtxt)
{ {
int ret = -1; int ret = -1;
virHashTablePtr info = NULL; GHashTable *info = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
bool retry = true; bool retry = true;
@ -7966,7 +7966,7 @@ qemuProcessRefreshDisks(virQEMUDriverPtr driver,
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
virHashTablePtr table = NULL; GHashTable *table = NULL;
int ret = -1; int ret = -1;
size_t i; size_t i;
@ -8194,7 +8194,7 @@ static int
qemuProcessRefreshLegacyBlockjobs(virQEMUDriverPtr driver, qemuProcessRefreshLegacyBlockjobs(virQEMUDriverPtr driver,
virDomainObjPtr vm) virDomainObjPtr vm)
{ {
virHashTablePtr blockJobs = NULL; GHashTable *blockJobs = NULL;
int ret = -1; int ret = -1;
qemuDomainObjEnterMonitor(driver, vm); qemuDomainObjEnterMonitor(driver, vm);

View File

@ -69,7 +69,7 @@ virQEMUQAPISchemaObjectGet(const char *field,
struct virQEMUQAPISchemaTraverseContext { struct virQEMUQAPISchemaTraverseContext {
const char *prevquery; const char *prevquery;
virHashTablePtr schema; GHashTable *schema;
char **queries; char **queries;
virJSONValuePtr returnType; virJSONValuePtr returnType;
size_t depth; size_t depth;
@ -92,7 +92,7 @@ virQEMUQAPISchemaTraverseContextValidateDepth(struct virQEMUQAPISchemaTraverseCo
static void static void
virQEMUQAPISchemaTraverseContextInit(struct virQEMUQAPISchemaTraverseContext *ctxt, virQEMUQAPISchemaTraverseContextInit(struct virQEMUQAPISchemaTraverseContext *ctxt,
char **queries, char **queries,
virHashTablePtr schema) GHashTable *schema)
{ {
memset(ctxt, 0, sizeof(*ctxt)); memset(ctxt, 0, sizeof(*ctxt));
ctxt->schema = schema; ctxt->schema = schema;
@ -429,7 +429,7 @@ virQEMUQAPISchemaTraverse(const char *baseName,
*/ */
int int
virQEMUQAPISchemaPathGet(const char *query, virQEMUQAPISchemaPathGet(const char *query,
virHashTablePtr schema, GHashTable *schema,
virJSONValuePtr *entry) virJSONValuePtr *entry)
{ {
VIR_AUTOSTRINGLIST elems = NULL; VIR_AUTOSTRINGLIST elems = NULL;
@ -478,7 +478,7 @@ virQEMUQAPISchemaPathGet(const char *query,
bool bool
virQEMUQAPISchemaPathExists(const char *query, virQEMUQAPISchemaPathExists(const char *query,
virHashTablePtr schema) GHashTable *schema)
{ {
return virQEMUQAPISchemaPathGet(query, schema, NULL) == 1; return virQEMUQAPISchemaPathGet(query, schema, NULL) == 1;
} }
@ -489,7 +489,7 @@ virQEMUQAPISchemaEntryProcess(size_t pos G_GNUC_UNUSED,
void *opaque) void *opaque)
{ {
const char *name; const char *name;
virHashTablePtr schema = opaque; GHashTable *schema = opaque;
if (!(name = virJSONValueObjectGetString(item, "name"))) { if (!(name = virJSONValueObjectGetString(item, "name"))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@ -511,10 +511,10 @@ virQEMUQAPISchemaEntryProcess(size_t pos G_GNUC_UNUSED,
* Converts the schema into the hash-table used by the functions working with * Converts the schema into the hash-table used by the functions working with
* the schema. @schemareply is consumed and freed. * the schema. @schemareply is consumed and freed.
*/ */
virHashTablePtr GHashTable *
virQEMUQAPISchemaConvert(virJSONValuePtr schemareply) virQEMUQAPISchemaConvert(virJSONValuePtr schemareply)
{ {
g_autoptr(virHashTable) schema = NULL; g_autoptr(GHashTable) schema = NULL;
g_autoptr(virJSONValue) schemajson = schemareply; g_autoptr(virJSONValue) schemajson = schemareply;
if (!(schema = virHashNew(virJSONValueHashFree))) if (!(schema = virHashNew(virJSONValueHashFree)))

View File

@ -25,12 +25,12 @@
int int
virQEMUQAPISchemaPathGet(const char *query, virQEMUQAPISchemaPathGet(const char *query,
virHashTablePtr schema, GHashTable *schema,
virJSONValuePtr *entry); virJSONValuePtr *entry);
bool bool
virQEMUQAPISchemaPathExists(const char *query, virQEMUQAPISchemaPathExists(const char *query,
virHashTablePtr schema); GHashTable *schema);
virHashTablePtr GHashTable *
virQEMUQAPISchemaConvert(virJSONValuePtr schemareply); virQEMUQAPISchemaConvert(virJSONValuePtr schemareply);

View File

@ -901,7 +901,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuSnapshotDiskContext, qemuSnapshotDiskContextCl
static int static int
qemuSnapshotDiskBitmapsPropagate(qemuSnapshotDiskDataPtr dd, qemuSnapshotDiskBitmapsPropagate(qemuSnapshotDiskDataPtr dd,
virJSONValuePtr actions, virJSONValuePtr actions,
virHashTablePtr blockNamedNodeData) GHashTable *blockNamedNodeData)
{ {
qemuBlockNamedNodeDataPtr entry; qemuBlockNamedNodeDataPtr entry;
size_t i; size_t i;
@ -932,7 +932,7 @@ qemuSnapshotDiskPrepareOneBlockdev(virQEMUDriverPtr driver,
qemuSnapshotDiskDataPtr dd, qemuSnapshotDiskDataPtr dd,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
bool reuse, bool reuse,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
@ -983,7 +983,7 @@ qemuSnapshotDiskPrepareOne(virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
virDomainSnapshotDiskDefPtr snapdisk, virDomainSnapshotDiskDefPtr snapdisk,
qemuSnapshotDiskDataPtr dd, qemuSnapshotDiskDataPtr dd,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
bool reuse, bool reuse,
bool updateConfig, bool updateConfig,
qemuDomainAsyncJob asyncJob, qemuDomainAsyncJob asyncJob,
@ -1099,7 +1099,7 @@ qemuSnapshotDiskPrepareActiveExternal(virDomainObjPtr vm,
virDomainMomentObjPtr snap, virDomainMomentObjPtr snap,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
bool reuse, bool reuse,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL; g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
@ -1130,7 +1130,7 @@ qemuSnapshotDiskPrepareActiveExternal(virDomainObjPtr vm,
static qemuSnapshotDiskContextPtr static qemuSnapshotDiskContextPtr
qemuSnapshotDiskPrepareDisksTransient(virDomainObjPtr vm, qemuSnapshotDiskPrepareDisksTransient(virDomainObjPtr vm,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL; g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
@ -1279,7 +1279,7 @@ qemuSnapshotDiskCreate(qemuSnapshotDiskContextPtr snapctxt,
static int static int
qemuSnapshotCreateActiveExternalDisks(virDomainObjPtr vm, qemuSnapshotCreateActiveExternalDisks(virDomainObjPtr vm,
virDomainMomentObjPtr snap, virDomainMomentObjPtr snap,
virHashTablePtr blockNamedNodeData, GHashTable *blockNamedNodeData,
unsigned int flags, unsigned int flags,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
@ -1320,7 +1320,7 @@ qemuSnapshotCreateDisksTransient(virDomainObjPtr vm,
virQEMUDriverPtr driver = priv->driver; virQEMUDriverPtr driver = priv->driver;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL; g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) { if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, asyncJob))) if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, asyncJob)))
@ -1362,7 +1362,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
int compressed; int compressed;
g_autoptr(virCommand) compressor = NULL; g_autoptr(virCommand) compressor = NULL;
virQEMUSaveDataPtr data = NULL; virQEMUSaveDataPtr data = NULL;
g_autoptr(virHashTable) blockNamedNodeData = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL;
/* If quiesce was requested, then issue a freeze command, and a /* If quiesce was requested, then issue a freeze command, and a
* counterpart thaw command when it is actually sent to agent. * counterpart thaw command when it is actually sent to agent.

View File

@ -66,7 +66,7 @@ struct _virNetDaemon {
int sigwatch; int sigwatch;
#endif /* !WIN32 */ #endif /* !WIN32 */
virHashTablePtr servers; GHashTable *servers;
virJSONValuePtr srvObject; virJSONValuePtr srvObject;
virNetDaemonShutdownCallback shutdownPrepareCb; virNetDaemonShutdownCallback shutdownPrepareCb;

View File

@ -58,7 +58,7 @@ struct _virSecuritySELinuxData {
char *alt_domain_context; char *alt_domain_context;
char *file_context; char *file_context;
char *content_context; char *content_context;
virHashTablePtr mcs; GHashTable *mcs;
bool skipAllLabel; bool skipAllLabel;
struct selabel_handle *label_handle; struct selabel_handle *label_handle;
}; };

View File

@ -47,7 +47,7 @@ VIR_LOG_INIT("util.filecache");
struct _virFileCache { struct _virFileCache {
virObjectLockable parent; virObjectLockable parent;
virHashTablePtr table; GHashTable *table;
char *dir; char *dir;
char *suffix; char *suffix;

View File

@ -33,7 +33,7 @@ VIR_LOG_INIT("util.hash");
struct _virHashAtomic { struct _virHashAtomic {
virObjectLockable parent; virObjectLockable parent;
virHashTablePtr hash; GHashTable *hash;
}; };
static virClassPtr virHashAtomicClass; static virClassPtr virHashAtomicClass;
@ -78,11 +78,11 @@ virHashTableStringKey(const void *vkey)
* virHashNew: * virHashNew:
* @dataFree: callback to free data * @dataFree: callback to free data
* *
* Create a new virHashTablePtr. * Create a new GHashTable *.
* *
* Returns the newly created object. * Returns the newly created object.
*/ */
virHashTablePtr GHashTable *
virHashNew(virHashDataFree dataFree) virHashNew(virHashDataFree dataFree)
{ {
ignore_value(virHashTableSeedInitialize()); ignore_value(virHashTableSeedInitialize());
@ -127,7 +127,7 @@ virHashAtomicDispose(void *obj)
* deallocated with function provided at creation time. * deallocated with function provided at creation time.
*/ */
void void
virHashFree(virHashTablePtr table) virHashFree(GHashTable *table)
{ {
if (table == NULL) if (table == NULL)
return; return;
@ -148,7 +148,7 @@ virHashFree(virHashTablePtr table)
* Returns 0 the addition succeeded and -1 in case of error. * Returns 0 the addition succeeded and -1 in case of error.
*/ */
int int
virHashAddEntry(virHashTablePtr table, const char *name, void *userdata) virHashAddEntry(GHashTable *table, const char *name, void *userdata)
{ {
if (!table || !name) if (!table || !name)
return -1; return -1;
@ -177,7 +177,7 @@ virHashAddEntry(virHashTablePtr table, const char *name, void *userdata)
* Returns 0 the addition succeeded and -1 in case of error. * Returns 0 the addition succeeded and -1 in case of error.
*/ */
int int
virHashUpdateEntry(virHashTablePtr table, const char *name, virHashUpdateEntry(GHashTable *table, const char *name,
void *userdata) void *userdata)
{ {
if (!table || !name) if (!table || !name)
@ -213,7 +213,7 @@ virHashAtomicUpdate(virHashAtomicPtr table,
* Returns a pointer to the userdata * Returns a pointer to the userdata
*/ */
void * void *
virHashLookup(virHashTablePtr table, virHashLookup(GHashTable *table,
const char *name) const char *name)
{ {
if (!table || !name) if (!table || !name)
@ -233,7 +233,7 @@ virHashLookup(virHashTablePtr table,
* Returns true if the entry exists and false otherwise * Returns true if the entry exists and false otherwise
*/ */
bool bool
virHashHasEntry(virHashTablePtr table, virHashHasEntry(GHashTable *table,
const char *name) const char *name)
{ {
if (!table || !name) if (!table || !name)
@ -253,7 +253,7 @@ virHashHasEntry(virHashTablePtr table,
* *
* Returns a pointer to the userdata * Returns a pointer to the userdata
*/ */
void *virHashSteal(virHashTablePtr table, const char *name) void *virHashSteal(GHashTable *table, const char *name)
{ {
g_autofree void *orig_name = NULL; g_autofree void *orig_name = NULL;
void *val = NULL; void *val = NULL;
@ -294,7 +294,7 @@ virHashAtomicSteal(virHashAtomicPtr table,
* -1 in case of error * -1 in case of error
*/ */
ssize_t ssize_t
virHashSize(virHashTablePtr table) virHashSize(GHashTable *table)
{ {
if (table == NULL) if (table == NULL)
return -1; return -1;
@ -315,7 +315,7 @@ virHashSize(virHashTablePtr table)
* Returns 0 if the removal succeeded and -1 in case of error or not found. * Returns 0 if the removal succeeded and -1 in case of error or not found.
*/ */
int int
virHashRemoveEntry(virHashTablePtr table, virHashRemoveEntry(GHashTable *table,
const char *name) const char *name)
{ {
if (!table || !name) if (!table || !name)
@ -356,7 +356,7 @@ virHashRemoveEntry(virHashTablePtr table,
* Returns 0 on success or -1 on failure. * Returns 0 on success or -1 on failure.
*/ */
int int
virHashForEach(virHashTablePtr table, virHashIterator iter, void *opaque) virHashForEach(GHashTable *table, virHashIterator iter, void *opaque)
{ {
GHashTableIter htitr; GHashTableIter htitr;
void *key; void *key;
@ -377,7 +377,7 @@ virHashForEach(virHashTablePtr table, virHashIterator iter, void *opaque)
int int
virHashForEachSafe(virHashTablePtr table, virHashForEachSafe(GHashTable *table,
virHashIterator iter, virHashIterator iter,
void *opaque) void *opaque)
{ {
@ -397,7 +397,7 @@ virHashForEachSafe(virHashTablePtr table,
int int
virHashForEachSorted(virHashTablePtr table, virHashForEachSorted(GHashTable *table,
virHashIterator iter, virHashIterator iter,
void *opaque) void *opaque)
{ {
@ -448,7 +448,7 @@ virHashSearcherWrapFunc(gpointer key,
* Returns number of items removed on success, -1 on failure * Returns number of items removed on success, -1 on failure
*/ */
ssize_t ssize_t
virHashRemoveSet(virHashTablePtr table, virHashRemoveSet(GHashTable *table,
virHashSearcher iter, virHashSearcher iter,
const void *opaque) const void *opaque)
{ {
@ -468,7 +468,7 @@ virHashRemoveSet(virHashTablePtr table,
* deallocated with the function provided at creation time. * deallocated with the function provided at creation time.
*/ */
void void
virHashRemoveAll(virHashTablePtr table) virHashRemoveAll(GHashTable *table)
{ {
if (!table) if (!table)
return; return;
@ -489,7 +489,7 @@ virHashRemoveAll(virHashTablePtr table)
* The elements are processed in a undefined order. Caller is * The elements are processed in a undefined order. Caller is
* responsible for freeing the @name. * responsible for freeing the @name.
*/ */
void *virHashSearch(virHashTablePtr table, void *virHashSearch(GHashTable *table,
virHashSearcher iter, virHashSearcher iter,
const void *opaque, const void *opaque,
char **name) char **name)
@ -522,7 +522,7 @@ virHashGetItemsKeySorter(const void *va,
virHashKeyValuePairPtr virHashKeyValuePairPtr
virHashGetItems(virHashTablePtr table, virHashGetItems(GHashTable *table,
size_t *nitems, size_t *nitems,
bool sortKeys) bool sortKeys)
{ {
@ -560,7 +560,7 @@ virHashGetItems(virHashTablePtr table,
struct virHashEqualData struct virHashEqualData
{ {
bool equal; bool equal;
virHashTablePtr table2; GHashTable *table2;
virHashValueComparator compar; virHashValueComparator compar;
}; };
@ -581,8 +581,8 @@ static int virHashEqualSearcher(const void *payload, const char *name,
return 0; return 0;
} }
bool virHashEqual(virHashTablePtr table1, bool virHashEqual(GHashTable *table1,
virHashTablePtr table2, GHashTable *table2,
virHashValueComparator compar) virHashValueComparator compar)
{ {
struct virHashEqualData data = { struct virHashEqualData data = {

View File

@ -9,12 +9,6 @@
#pragma once #pragma once
/*
* The hash table.
*/
typedef GHashTable virHashTable;
typedef virHashTable *virHashTablePtr;
typedef struct _virHashAtomic virHashAtomic; typedef struct _virHashAtomic virHashAtomic;
typedef virHashAtomic *virHashAtomicPtr; typedef virHashAtomic *virHashAtomicPtr;
@ -57,17 +51,17 @@ typedef int (*virHashSearcher) (const void *payload, const char *name,
/* /*
* Constructor and destructor. * Constructor and destructor.
*/ */
virHashTablePtr virHashNew(virHashDataFree dataFree); GHashTable *virHashNew(virHashDataFree dataFree);
virHashAtomicPtr virHashAtomicNew(virHashDataFree dataFree); virHashAtomicPtr virHashAtomicNew(virHashDataFree dataFree);
void virHashFree(virHashTablePtr table); void virHashFree(GHashTable *table);
ssize_t virHashSize(virHashTablePtr table); ssize_t virHashSize(GHashTable *table);
/* /*
* Add a new entry to the hash table. * Add a new entry to the hash table.
*/ */
int virHashAddEntry(virHashTablePtr table, int virHashAddEntry(GHashTable *table,
const char *name, void *userdata); const char *name, void *userdata);
int virHashUpdateEntry(virHashTablePtr table, int virHashUpdateEntry(GHashTable *table,
const char *name, const char *name,
void *userdata); void *userdata);
int virHashAtomicUpdate(virHashAtomicPtr table, int virHashAtomicUpdate(virHashAtomicPtr table,
@ -77,24 +71,24 @@ int virHashAtomicUpdate(virHashAtomicPtr table,
/* /*
* Remove an entry from the hash table. * Remove an entry from the hash table.
*/ */
int virHashRemoveEntry(virHashTablePtr table, int virHashRemoveEntry(GHashTable *table,
const char *name); const char *name);
/* /*
* Remove all entries from the hash table. * Remove all entries from the hash table.
*/ */
void virHashRemoveAll(virHashTablePtr table); void virHashRemoveAll(GHashTable *table);
/* /*
* Retrieve the userdata. * Retrieve the userdata.
*/ */
void *virHashLookup(virHashTablePtr table, const char *name); void *virHashLookup(GHashTable *table, const char *name);
bool virHashHasEntry(virHashTablePtr table, const char *name); bool virHashHasEntry(GHashTable *table, const char *name);
/* /*
* Retrieve & remove the userdata. * Retrieve & remove the userdata.
*/ */
void *virHashSteal(virHashTablePtr table, const char *name); void *virHashSteal(GHashTable *table, const char *name);
void *virHashAtomicSteal(virHashAtomicPtr table, void *virHashAtomicSteal(virHashAtomicPtr table,
const char *name); const char *name);
@ -116,7 +110,7 @@ struct _virHashKeyValuePair {
const void *key; const void *key;
const void *value; const void *value;
}; };
virHashKeyValuePairPtr virHashGetItems(virHashTablePtr table, virHashKeyValuePairPtr virHashGetItems(GHashTable *table,
size_t *nitems, size_t *nitems,
bool sortedKeys); bool sortedKeys);
@ -127,19 +121,17 @@ virHashKeyValuePairPtr virHashGetItems(virHashTablePtr table,
* of two keys. * of two keys.
*/ */
typedef int (*virHashValueComparator)(const void *value1, const void *value2); typedef int (*virHashValueComparator)(const void *value1, const void *value2);
bool virHashEqual(virHashTablePtr table1, bool virHashEqual(GHashTable *table1,
virHashTablePtr table2, GHashTable *table2,
virHashValueComparator compar); virHashValueComparator compar);
/* /*
* Iterators * Iterators
*/ */
int virHashForEach(virHashTablePtr table, virHashIterator iter, void *opaque); int virHashForEach(GHashTable *table, virHashIterator iter, void *opaque);
int virHashForEachSafe(virHashTablePtr table, virHashIterator iter, void *opaque); int virHashForEachSafe(GHashTable *table, virHashIterator iter, void *opaque);
int virHashForEachSorted(virHashTablePtr table, virHashIterator iter, void *opaque); int virHashForEachSorted(GHashTable *table, virHashIterator iter, void *opaque);
ssize_t virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, const void *opaque); ssize_t virHashRemoveSet(GHashTable *table, virHashSearcher iter, const void *opaque);
void *virHashSearch(virHashTablePtr table, virHashSearcher iter, void *virHashSearch(GHashTable *table, virHashSearcher iter,
const void *opaque, char **name); const void *opaque, char **name);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virHashTable, g_hash_table_unref);

View File

@ -70,8 +70,8 @@ iptablesPrivateChainCreate(virFirewallPtr fw,
void *opaque) void *opaque)
{ {
iptablesGlobalChainData *data = opaque; iptablesGlobalChainData *data = opaque;
virHashTablePtr chains = NULL; GHashTable *chains = NULL;
virHashTablePtr links = NULL; GHashTable *links = NULL;
const char *const *tmp; const char *const *tmp;
int ret = -1; int ret = -1;
size_t i; size_t i;

View File

@ -58,7 +58,7 @@ struct _virLockSpace {
char *dir; char *dir;
virMutex lock; virMutex lock;
virHashTablePtr resources; GHashTable *resources;
}; };

View File

@ -43,7 +43,7 @@ VIR_LOG_INIT("util.virmacmap");
struct virMacMap { struct virMacMap {
virObjectLockable parent; virObjectLockable parent;
virHashTablePtr macs; GHashTable *macs;
}; };

View File

@ -4291,7 +4291,7 @@ virStorageFileCanonicalizePath(const char *path,
virStorageFileSimplifyPathReadlinkCallback cb, virStorageFileSimplifyPathReadlinkCallback cb,
void *cbdata) void *cbdata)
{ {
virHashTablePtr cycle = NULL; GHashTable *cycle = NULL;
bool beginSlash = false; bool beginSlash = false;
bool beginDoubleSlash = false; bool beginDoubleSlash = false;
char **components = NULL; char **components = NULL;
@ -5160,7 +5160,7 @@ virStorageFileGetMetadataRecurseReadHeader(virStorageSourcePtr src,
gid_t gid, gid_t gid,
char **buf, char **buf,
size_t *headerLen, size_t *headerLen,
virHashTablePtr cycle) GHashTable *cycle)
{ {
int ret = -1; int ret = -1;
const char *uniqueName; const char *uniqueName;
@ -5205,7 +5205,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
virStorageSourcePtr parent, virStorageSourcePtr parent,
uid_t uid, gid_t gid, uid_t uid, gid_t gid,
bool report_broken, bool report_broken,
virHashTablePtr cycle, GHashTable *cycle,
unsigned int depth) unsigned int depth)
{ {
virStorageFileFormat orig_format = src->format; virStorageFileFormat orig_format = src->format;
@ -5309,7 +5309,7 @@ virStorageFileGetMetadata(virStorageSourcePtr src,
uid_t uid, gid_t gid, uid_t uid, gid_t gid,
bool report_broken) bool report_broken)
{ {
virHashTablePtr cycle = NULL; GHashTable *cycle = NULL;
virStorageType actualType = virStorageSourceGetActualType(src); virStorageType actualType = virStorageSourceGetActualType(src);
int ret = -1; int ret = -1;

View File

@ -45,7 +45,7 @@ VIR_LOG_INIT("util.systemd");
#endif #endif
struct _virSystemdActivation { struct _virSystemdActivation {
virHashTablePtr fds; GHashTable *fds;
}; };
typedef struct _virSystemdActivationEntry virSystemdActivationEntry; typedef struct _virSystemdActivationEntry virSystemdActivationEntry;

View File

@ -145,11 +145,11 @@ static const char *commonRules[] = {
}; };
static virHashTablePtr static GHashTable *
virNWFilterCreateVarsFrom(virHashTablePtr vars1, virNWFilterCreateVarsFrom(GHashTable *vars1,
virHashTablePtr vars2) GHashTable *vars2)
{ {
virHashTablePtr res = virHashNew(virNWFilterVarValueHashFree); GHashTable *res = virHashNew(virNWFilterVarValueHashFree);
if (!res) if (!res)
return NULL; return NULL;
@ -197,13 +197,13 @@ virNWFilterInstReset(virNWFilterInstPtr inst)
static int static int
virNWFilterDefToInst(const char *xml, virNWFilterDefToInst(const char *xml,
virHashTablePtr vars, GHashTable *vars,
virNWFilterInstPtr inst); virNWFilterInstPtr inst);
static int static int
virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def, virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def,
virNWFilterRuleDefPtr rule, virNWFilterRuleDefPtr rule,
virHashTablePtr vars, GHashTable *vars,
virNWFilterInstPtr inst) virNWFilterInstPtr inst)
{ {
virNWFilterRuleInstPtr ruleinst; virNWFilterRuleInstPtr ruleinst;
@ -235,10 +235,10 @@ virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def,
static int static int
virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDefPtr inc, virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDefPtr inc,
virHashTablePtr vars, GHashTable *vars,
virNWFilterInstPtr inst) virNWFilterInstPtr inst)
{ {
virHashTablePtr tmpvars = NULL; GHashTable *tmpvars = NULL;
int ret = -1; int ret = -1;
char *xml; char *xml;
@ -266,7 +266,7 @@ virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDefPtr inc,
static int static int
virNWFilterDefToInst(const char *xml, virNWFilterDefToInst(const char *xml,
virHashTablePtr vars, GHashTable *vars,
virNWFilterInstPtr inst) virNWFilterInstPtr inst)
{ {
size_t i; size_t i;
@ -322,7 +322,7 @@ static void testRemoveCommonRules(char *rules)
} }
static int testSetOneParameter(virHashTablePtr vars, static int testSetOneParameter(GHashTable *vars,
const char *name, const char *name,
const char *value) const char *value)
{ {
@ -344,7 +344,7 @@ static int testSetOneParameter(virHashTablePtr vars,
return 0; return 0;
} }
static int testSetDefaultParameters(virHashTablePtr vars) static int testSetDefaultParameters(GHashTable *vars)
{ {
if (testSetOneParameter(vars, "IPSETNAME", "tck_test") < 0 || if (testSetOneParameter(vars, "IPSETNAME", "tck_test") < 0 ||
testSetOneParameter(vars, "A", "1.1.1.1") || testSetOneParameter(vars, "A", "1.1.1.1") ||
@ -368,7 +368,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
{ {
char *actualargv = NULL; char *actualargv = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virHashTablePtr vars = virHashNew(virNWFilterVarValueHashFree); GHashTable *vars = virHashNew(virNWFilterVarValueHashFree);
virNWFilterInst inst; virNWFilterInst inst;
int ret = -1; int ret = -1;

View File

@ -43,7 +43,7 @@ struct testBackingXMLjsonXMLdata {
int type; int type;
const char *xml; const char *xml;
bool legacy; bool legacy;
virHashTablePtr schema; GHashTable *schema;
virJSONValuePtr schemaroot; virJSONValuePtr schemaroot;
}; };
@ -133,7 +133,7 @@ static const char *testJSONtoJSONPath = abs_srcdir "/qemublocktestdata/jsontojso
struct testJSONtoJSONData { struct testJSONtoJSONData {
const char *name; const char *name;
virHashTablePtr schema; GHashTable *schema;
virJSONValuePtr schemaroot; virJSONValuePtr schemaroot;
}; };
@ -192,7 +192,7 @@ struct testQemuDiskXMLToJSONImageData {
struct testQemuDiskXMLToJSONData { struct testQemuDiskXMLToJSONData {
virQEMUDriverPtr driver; virQEMUDriverPtr driver;
virHashTablePtr schema; GHashTable *schema;
virJSONValuePtr schemaroot; virJSONValuePtr schemaroot;
const char *name; const char *name;
bool fail; bool fail;
@ -459,7 +459,7 @@ testQemuDiskXMLToPropsValidateFileSrcOnly(const void *opaque)
struct testQemuImageCreateData { struct testQemuImageCreateData {
const char *name; const char *name;
const char *backingname; const char *backingname;
virHashTablePtr schema; GHashTable *schema;
virJSONValuePtr schemaroot; virJSONValuePtr schemaroot;
virQEMUDriverPtr driver; virQEMUDriverPtr driver;
virQEMUCapsPtr qemuCaps; virQEMUCapsPtr qemuCaps;
@ -586,7 +586,7 @@ testQemuImageCreate(const void *opaque)
static const char *bitmapDetectPrefix = "qemublocktestdata/bitmap/"; static const char *bitmapDetectPrefix = "qemublocktestdata/bitmap/";
static void static void
testQemuDetectBitmapsWorker(virHashTablePtr nodedata, testQemuDetectBitmapsWorker(GHashTable *nodedata,
const char *nodename, const char *nodename,
virBufferPtr buf) virBufferPtr buf)
{ {
@ -617,7 +617,7 @@ testQemuDetectBitmaps(const void *opaque)
{ {
const char *name = opaque; const char *name = opaque;
g_autoptr(virJSONValue) nodedatajson = NULL; g_autoptr(virJSONValue) nodedatajson = NULL;
g_autoptr(virHashTable) nodedata = NULL; g_autoptr(GHashTable) nodedata = NULL;
g_autofree char *actual = NULL; g_autofree char *actual = NULL;
g_autofree char *expectpath = NULL; g_autofree char *expectpath = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@ -729,7 +729,7 @@ testQemuBackupIncrementalBitmapCalculate(const void *opaque)
{ {
const struct testQemuBackupIncrementalBitmapCalculateData *data = opaque; const struct testQemuBackupIncrementalBitmapCalculateData *data = opaque;
g_autoptr(virJSONValue) nodedatajson = NULL; g_autoptr(virJSONValue) nodedatajson = NULL;
g_autoptr(virHashTable) nodedata = NULL; g_autoptr(GHashTable) nodedata = NULL;
g_autoptr(virJSONValue) actions = virJSONValueNewArray(); g_autoptr(virJSONValue) actions = virJSONValueNewArray();
g_autofree char *expectpath = NULL; g_autofree char *expectpath = NULL;
g_autoptr(virStorageSource) target = NULL; g_autoptr(virStorageSource) target = NULL;
@ -784,7 +784,7 @@ testQemuCheckpointDelete(const void *opaque)
g_autofree char *expectpath = NULL; g_autofree char *expectpath = NULL;
g_autoptr(virJSONValue) actions = NULL; g_autoptr(virJSONValue) actions = NULL;
g_autoptr(virJSONValue) nodedatajson = NULL; g_autoptr(virJSONValue) nodedatajson = NULL;
g_autoptr(virHashTable) nodedata = NULL; g_autoptr(GHashTable) nodedata = NULL;
g_autoptr(GSList) reopenimages = NULL; g_autoptr(GSList) reopenimages = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@ -834,7 +834,7 @@ testQemuBlockBitmapValidate(const void *opaque)
{ {
const struct testQemuBlockBitmapValidateData *data = opaque; const struct testQemuBlockBitmapValidateData *data = opaque;
g_autoptr(virJSONValue) nodedatajson = NULL; g_autoptr(virJSONValue) nodedatajson = NULL;
g_autoptr(virHashTable) nodedata = NULL; g_autoptr(GHashTable) nodedata = NULL;
bool actual; bool actual;
if (!(nodedatajson = virTestLoadFileJSON(bitmapDetectPrefix, data->name, if (!(nodedatajson = virTestLoadFileJSON(bitmapDetectPrefix, data->name,
@ -875,7 +875,7 @@ testQemuBlockBitmapBlockcopy(const void *opaque)
g_autofree char *expectpath = NULL; g_autofree char *expectpath = NULL;
g_autoptr(virJSONValue) actions = NULL; g_autoptr(virJSONValue) actions = NULL;
g_autoptr(virJSONValue) nodedatajson = NULL; g_autoptr(virJSONValue) nodedatajson = NULL;
g_autoptr(virHashTable) nodedata = NULL; g_autoptr(GHashTable) nodedata = NULL;
g_autoptr(virStorageSource) fakemirror = virStorageSourceNew(); g_autoptr(virStorageSource) fakemirror = virStorageSourceNew();
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@ -927,7 +927,7 @@ testQemuBlockBitmapBlockcommit(const void *opaque)
g_autofree char *expectpath = NULL; g_autofree char *expectpath = NULL;
g_autoptr(virJSONValue) actionsMerge = NULL; g_autoptr(virJSONValue) actionsMerge = NULL;
g_autoptr(virJSONValue) nodedatajson = NULL; g_autoptr(virJSONValue) nodedatajson = NULL;
g_autoptr(virHashTable) nodedata = NULL; g_autoptr(GHashTable) nodedata = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
bool active = data->top == data->chain; bool active = data->top == data->chain;
@ -975,7 +975,7 @@ mymain(void)
struct testQemuBlockBitmapBlockcommitData blockbitmapblockcommitdata; struct testQemuBlockBitmapBlockcommitData blockbitmapblockcommitdata;
char *capslatest_x86_64 = NULL; char *capslatest_x86_64 = NULL;
g_autoptr(virQEMUCaps) caps_x86_64 = NULL; g_autoptr(virQEMUCaps) caps_x86_64 = NULL;
g_autoptr(virHashTable) qmp_schema_x86_64 = NULL; g_autoptr(GHashTable) qmp_schema_x86_64 = NULL;
virJSONValuePtr qmp_schemaroot_x86_64_blockdev_add = NULL; virJSONValuePtr qmp_schemaroot_x86_64_blockdev_add = NULL;
g_autoptr(virStorageSource) bitmapSourceChain = NULL; g_autoptr(virStorageSource) bitmapSourceChain = NULL;

View File

@ -410,7 +410,7 @@ static struct testQemuHotplugCpuData *
testQemuHotplugCpuPrepare(const char *test, testQemuHotplugCpuPrepare(const char *test,
bool modern, bool modern,
bool fail, bool fail,
virHashTablePtr qmpschema) GHashTable *qmpschema)
{ {
qemuDomainObjPrivatePtr priv = NULL; qemuDomainObjPrivatePtr priv = NULL;
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
@ -510,7 +510,7 @@ struct testQemuHotplugCpuParams {
bool state; bool state;
bool modern; bool modern;
bool fail; bool fail;
virHashTablePtr schema; GHashTable *schema;
}; };
@ -594,7 +594,7 @@ testQemuHotplugCpuIndividual(const void *opaque)
static int static int
mymain(void) mymain(void)
{ {
g_autoptr(virHashTable) qmpschema = NULL; g_autoptr(GHashTable) qmpschema = NULL;
int ret = 0; int ret = 0;
struct qemuHotplugTestData data = {0}; struct qemuHotplugTestData data = {0};
struct testQemuHotplugCpuParams cpudata; struct testQemuHotplugCpuParams cpudata;

View File

@ -38,7 +38,7 @@ typedef struct _qemuMigParamsData qemuMigParamsData;
struct _qemuMigParamsData { struct _qemuMigParamsData {
virDomainXMLOptionPtr xmlopt; virDomainXMLOptionPtr xmlopt;
const char *name; const char *name;
virHashTablePtr qmpschema; GHashTable *qmpschema;
}; };
@ -191,7 +191,7 @@ qemuMigParamsTestJSON(const void *opaque)
static int static int
mymain(void) mymain(void)
{ {
g_autoptr(virHashTable) qmpschema = NULL; g_autoptr(GHashTable) qmpschema = NULL;
virQEMUDriver driver; virQEMUDriver driver;
int ret = 0; int ret = 0;

View File

@ -45,7 +45,7 @@ struct _testQemuMonitorJSONSimpleFuncData {
int (* func) (qemuMonitorPtr mon); int (* func) (qemuMonitorPtr mon);
virDomainXMLOptionPtr xmlopt; virDomainXMLOptionPtr xmlopt;
const char *reply; const char *reply;
virHashTablePtr schema; GHashTable *schema;
bool allowDeprecated; bool allowDeprecated;
bool allowRemoved; bool allowRemoved;
}; };
@ -53,7 +53,7 @@ struct _testQemuMonitorJSONSimpleFuncData {
typedef struct _testGenericData testGenericData; typedef struct _testGenericData testGenericData;
struct _testGenericData { struct _testGenericData {
virDomainXMLOptionPtr xmlopt; virDomainXMLOptionPtr xmlopt;
virHashTablePtr schema; GHashTable *schema;
}; };
const char *queryBlockReply = const char *queryBlockReply =
@ -771,7 +771,7 @@ testQemuMonitorJSONAttachChardev(const void *opaque)
static int static int
qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionPtr xmlopt, qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionPtr xmlopt,
virHashTablePtr schema, GHashTable *schema,
const char *label, const char *label,
virDomainChrSourceDefPtr chr, virDomainChrSourceDefPtr chr,
const char *expectargs, const char *expectargs,
@ -818,7 +818,7 @@ qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionPtr xmlopt,
static int static int
qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt, qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt,
virHashTablePtr schema) GHashTable *schema)
{ {
virDomainChrSourceDef chr; virDomainChrSourceDef chr;
int ret = 0; int ret = 0;
@ -1642,7 +1642,8 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque)
const testGenericData *data = opaque; const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt; virDomainXMLOptionPtr xmlopt = data->xmlopt;
int ret = -1; int ret = -1;
virHashTablePtr blockDevices = NULL, expectedBlockDevices = NULL; GHashTable *blockDevices = NULL;
GHashTable *expectedBlockDevices = NULL;
struct qemuDomainDiskInfo *info; struct qemuDomainDiskInfo *info;
g_autoptr(qemuMonitorTest) test = NULL; g_autoptr(qemuMonitorTest) test = NULL;
@ -1716,7 +1717,7 @@ testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo(const void *opaque)
{ {
const testGenericData *data = opaque; const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt; virDomainXMLOptionPtr xmlopt = data->xmlopt;
virHashTablePtr blockstats = NULL; GHashTable *blockstats = NULL;
qemuBlockStatsPtr stats; qemuBlockStatsPtr stats;
int ret = -1; int ret = -1;
g_autoptr(qemuMonitorTest) test = NULL; g_autoptr(qemuMonitorTest) test = NULL;
@ -2008,7 +2009,8 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque)
const testGenericData *data = opaque; const testGenericData *data = opaque;
virDomainXMLOptionPtr xmlopt = data->xmlopt; virDomainXMLOptionPtr xmlopt = data->xmlopt;
int ret = -1; int ret = -1;
virHashTablePtr info = NULL, expectedInfo = NULL; GHashTable *info = NULL;
GHashTable *expectedInfo = NULL;
qemuMonitorChardevInfo info0 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT }; qemuMonitorChardevInfo info0 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT };
qemuMonitorChardevInfo info1 = { (char *) "/dev/pts/21", VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED }; qemuMonitorChardevInfo info1 = { (char *) "/dev/pts/21", VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED };
qemuMonitorChardevInfo info2 = { (char *) "/dev/pts/20", VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT }; qemuMonitorChardevInfo info2 = { (char *) "/dev/pts/20", VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT };
@ -2404,7 +2406,7 @@ testQemuMonitorJSONqemuMonitorJSONGetDumpGuestMemoryCapability(const void *opaqu
struct testCPUData { struct testCPUData {
const char *name; const char *name;
virDomainXMLOptionPtr xmlopt; virDomainXMLOptionPtr xmlopt;
virHashTablePtr schema; GHashTable *schema;
}; };
@ -2588,7 +2590,7 @@ struct testCPUInfoData {
size_t maxvcpus; size_t maxvcpus;
virDomainXMLOptionPtr xmlopt; virDomainXMLOptionPtr xmlopt;
bool fast; bool fast;
virHashTablePtr schema; GHashTable *schema;
}; };
@ -2773,7 +2775,7 @@ testBlockNodeNameDetect(const void *opaque)
char *actual = NULL; char *actual = NULL;
virJSONValuePtr namedNodesJson = NULL; virJSONValuePtr namedNodesJson = NULL;
virJSONValuePtr blockstatsJson = NULL; virJSONValuePtr blockstatsJson = NULL;
virHashTablePtr nodedata = NULL; GHashTable *nodedata = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
int ret = -1; int ret = -1;
@ -2815,7 +2817,7 @@ testBlockNodeNameDetect(const void *opaque)
struct testQAPISchemaData { struct testQAPISchemaData {
virHashTablePtr schema; GHashTable *schema;
const char *name; const char *name;
const char *query; const char *query;
const char *json; const char *json;
@ -2895,7 +2897,7 @@ testQAPISchemaValidate(const void *opaque)
static int static int
testQAPISchemaObjectDeviceAdd(const void *opaque) testQAPISchemaObjectDeviceAdd(const void *opaque)
{ {
virHashTablePtr schema = (virHashTablePtr) opaque; GHashTable *schema = (GHashTable *) opaque;
virJSONValuePtr entry; virJSONValuePtr entry;
if (virQEMUQAPISchemaPathGet("device_add/arg-type", schema, &entry) < 0) { if (virQEMUQAPISchemaPathGet("device_add/arg-type", schema, &entry) < 0) {

View File

@ -84,7 +84,7 @@ struct _qemuMonitorTest {
qemuMonitorTestItemPtr *items; qemuMonitorTestItemPtr *items;
virDomainObjPtr vm; virDomainObjPtr vm;
virHashTablePtr qapischema; GHashTable *qapischema;
}; };
@ -1141,7 +1141,7 @@ qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr vm, virDomainObjPtr vm,
virQEMUDriverPtr driver, virQEMUDriverPtr driver,
const char *greeting, const char *greeting,
virHashTablePtr schema) GHashTable *schema)
{ {
qemuMonitorTestPtr test = NULL; qemuMonitorTestPtr test = NULL;
virDomainChrSourceDef src; virDomainChrSourceDef src;
@ -1341,7 +1341,7 @@ qemuMonitorTestPtr
qemuMonitorTestNewFromFileFull(const char *fileName, qemuMonitorTestNewFromFileFull(const char *fileName,
virQEMUDriverPtr driver, virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virHashTablePtr qmpschema) GHashTable *qmpschema)
{ {
qemuMonitorTestPtr ret = NULL; qemuMonitorTestPtr ret = NULL;
g_autofree char *jsonstr = NULL; g_autofree char *jsonstr = NULL;

View File

@ -86,7 +86,7 @@ qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr vm, virDomainObjPtr vm,
virQEMUDriverPtr driver, virQEMUDriverPtr driver,
const char *greeting, const char *greeting,
virHashTablePtr schema); GHashTable *schema);
qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName, qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
@ -94,7 +94,7 @@ qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName,
qemuMonitorTestPtr qemuMonitorTestNewFromFileFull(const char *fileName, qemuMonitorTestPtr qemuMonitorTestNewFromFileFull(const char *fileName,
virQEMUDriverPtr driver, virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virHashTablePtr qmpschema); GHashTable *qmpschema);
qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt); qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt);

View File

@ -74,17 +74,17 @@ virMutex m = VIR_MUTEX_INITIALIZER;
* "$path:$name" and value is just XATTR "$value". We don't need * "$path:$name" and value is just XATTR "$value". We don't need
* to list XATTRs a path has, therefore we don't need something * to list XATTRs a path has, therefore we don't need something
* more clever. */ * more clever. */
virHashTablePtr xattr_paths = NULL; GHashTable *xattr_paths = NULL;
/* The UID:GID is stored in a hash table. Again, for simplicity, /* The UID:GID is stored in a hash table. Again, for simplicity,
* the path is the key and the value is an uint32_t , where * the path is the key and the value is an uint32_t , where
* the lower half is UID and the higher is GID. */ * the lower half is UID and the higher is GID. */
virHashTablePtr chown_paths = NULL; GHashTable *chown_paths = NULL;
/* The SELinux label is stored in a hash table. For simplicity, /* The SELinux label is stored in a hash table. For simplicity,
* the path is the key and the value is the label. */ * the path is the key and the value is the label. */
virHashTablePtr selinux_paths = NULL; GHashTable *selinux_paths = NULL;
static void static void

View File

@ -521,7 +521,7 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv,
g_autoptr(virDomainObj) vm = NULL; g_autoptr(virDomainObj) vm = NULL;
size_t nargs = 0; size_t nargs = 0;
size_t i; size_t i;
g_autoptr(virHashTable) schema = NULL; g_autoptr(GHashTable) schema = NULL;
g_autoptr(virCommand) cmd = NULL; g_autoptr(virCommand) cmd = NULL;
unsigned int parseFlags = info->parseFlags; unsigned int parseFlags = info->parseFlags;
@ -767,7 +767,7 @@ mymain(void)
{ {
int ret = 0; int ret = 0;
g_autofree char *fakerootdir = NULL; g_autofree char *fakerootdir = NULL;
g_autoptr(virHashTable) capslatest = NULL; g_autoptr(GHashTable) capslatest = NULL;
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE); fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);

View File

@ -133,7 +133,7 @@ mymain(void)
int ret = 0; int ret = 0;
g_autofree char *fakerootdir = NULL; g_autofree char *fakerootdir = NULL;
g_autoptr(virQEMUDriverConfig) cfg = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL;
g_autoptr(virHashTable) capslatest = NULL; g_autoptr(GHashTable) capslatest = NULL;
g_autoptr(virConnect) conn = NULL; g_autoptr(virConnect) conn = NULL;
capslatest = testQemuGetLatestCaps(); capslatest = testQemuGetLatestCaps();

View File

@ -558,7 +558,7 @@ testQemuGetLatestCapsForArch(const char *arch,
} }
virHashTablePtr GHashTable *
testQemuGetLatestCaps(void) testQemuGetLatestCaps(void)
{ {
const char *archs[] = { const char *archs[] = {
@ -568,7 +568,7 @@ testQemuGetLatestCaps(void)
"s390x", "s390x",
"x86_64", "x86_64",
}; };
virHashTablePtr capslatest; GHashTable *capslatest;
size_t i; size_t i;
if (!(capslatest = virHashNew(g_free))) if (!(capslatest = virHashNew(g_free)))
@ -664,7 +664,7 @@ testQemuCapsIterate(const char *suffix,
int int
testQemuInfoSetArgs(struct testQemuInfo *info, testQemuInfoSetArgs(struct testQemuInfo *info,
virHashTablePtr capslatest, ...) GHashTable *capslatest, ...)
{ {
va_list argptr; va_list argptr;
testQemuInfoArgName argname; testQemuInfoArgName argname;

View File

@ -96,7 +96,7 @@ int testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps,
char *testQemuGetLatestCapsForArch(const char *arch, char *testQemuGetLatestCapsForArch(const char *arch,
const char *suffix); const char *suffix);
virHashTablePtr testQemuGetLatestCaps(void); GHashTable *testQemuGetLatestCaps(void);
typedef int (*testQemuCapsIterateCallback)(const char *inputDir, typedef int (*testQemuCapsIterateCallback)(const char *inputDir,
const char *prefix, const char *prefix,
@ -109,7 +109,7 @@ int testQemuCapsIterate(const char *suffix,
void *opaque); void *opaque);
int testQemuInfoSetArgs(struct testQemuInfo *info, int testQemuInfoSetArgs(struct testQemuInfo *info,
virHashTablePtr capslatest, ...); GHashTable *capslatest, ...);
void testQemuInfoClear(struct testQemuInfo *info); void testQemuInfoClear(struct testQemuInfo *info);
#endif #endif

View File

@ -22,7 +22,7 @@
#include "qemu/qemu_qapi.h" #include "qemu/qemu_qapi.h"
struct testQEMUSchemaValidateCtxt { struct testQEMUSchemaValidateCtxt {
virHashTablePtr schema; GHashTable *schema;
virBufferPtr debug; virBufferPtr debug;
bool allowDeprecated; bool allowDeprecated;
}; };
@ -533,7 +533,7 @@ testQEMUSchemaValidateRecurse(virJSONValuePtr obj,
int int
testQEMUSchemaValidate(virJSONValuePtr obj, testQEMUSchemaValidate(virJSONValuePtr obj,
virJSONValuePtr root, virJSONValuePtr root,
virHashTablePtr schema, GHashTable *schema,
bool allowDeprecated, bool allowDeprecated,
virBufferPtr debug) virBufferPtr debug)
{ {
@ -568,7 +568,7 @@ testQEMUSchemaValidate(virJSONValuePtr obj,
int int
testQEMUSchemaValidateCommand(const char *command, testQEMUSchemaValidateCommand(const char *command,
virJSONValuePtr arguments, virJSONValuePtr arguments,
virHashTablePtr schema, GHashTable *schema,
bool allowDeprecated, bool allowDeprecated,
bool allowRemoved, bool allowRemoved,
virBufferPtr debug) virBufferPtr debug)
@ -783,7 +783,7 @@ testQEMUSchemaGetLatest(const char *arch)
} }
virHashTablePtr GHashTable *
testQEMUSchemaLoadLatest(const char *arch) testQEMUSchemaLoadLatest(const char *arch)
{ {
virJSONValuePtr schema; virJSONValuePtr schema;
@ -795,7 +795,7 @@ testQEMUSchemaLoadLatest(const char *arch)
} }
virHashTablePtr GHashTable *
testQEMUSchemaLoad(const char *filename) testQEMUSchemaLoad(const char *filename)
{ {
virJSONValuePtr schema; virJSONValuePtr schema;

View File

@ -25,14 +25,14 @@
int int
testQEMUSchemaValidate(virJSONValuePtr obj, testQEMUSchemaValidate(virJSONValuePtr obj,
virJSONValuePtr root, virJSONValuePtr root,
virHashTablePtr schema, GHashTable *schema,
bool allowDeprecated, bool allowDeprecated,
virBufferPtr debug); virBufferPtr debug);
int int
testQEMUSchemaValidateCommand(const char *command, testQEMUSchemaValidateCommand(const char *command,
virJSONValuePtr arguments, virJSONValuePtr arguments,
virHashTablePtr schema, GHashTable *schema,
bool allowDeprecated, bool allowDeprecated,
bool allowRemoved, bool allowRemoved,
virBufferPtr debug); virBufferPtr debug);
@ -45,8 +45,8 @@ testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry,
virJSONValuePtr virJSONValuePtr
testQEMUSchemaGetLatest(const char* arch); testQEMUSchemaGetLatest(const char* arch);
virHashTablePtr GHashTable *
testQEMUSchemaLoadLatest(const char *arch); testQEMUSchemaLoadLatest(const char *arch);
virHashTablePtr GHashTable *
testQEMUSchemaLoad(const char *filename); testQEMUSchemaLoad(const char *filename);

View File

@ -14,10 +14,10 @@
VIR_LOG_INIT("tests.hashtest"); VIR_LOG_INIT("tests.hashtest");
static virHashTablePtr static GHashTable *
testHashInit(void) testHashInit(void)
{ {
virHashTablePtr hash; GHashTable *hash;
ssize_t i; ssize_t i;
if (!(hash = virHashNew(NULL))) if (!(hash = virHashNew(NULL)))
@ -55,7 +55,7 @@ testHashCheckForEachCount(void *payload G_GNUC_UNUSED,
} }
static int static int
testHashCheckCount(virHashTablePtr hash, size_t count) testHashCheckCount(GHashTable *hash, size_t count)
{ {
size_t iter_count = 0; size_t iter_count = 0;
@ -85,7 +85,7 @@ struct testInfo {
static int static int
testHashGrow(const void *data G_GNUC_UNUSED) testHashGrow(const void *data G_GNUC_UNUSED)
{ {
virHashTablePtr hash; GHashTable *hash;
int ret = -1; int ret = -1;
if (!(hash = testHashInit())) if (!(hash = testHashInit()))
@ -106,7 +106,7 @@ static int
testHashUpdate(const void *data G_GNUC_UNUSED) testHashUpdate(const void *data G_GNUC_UNUSED)
{ {
int count = G_N_ELEMENTS(uuids) + G_N_ELEMENTS(uuids_new); int count = G_N_ELEMENTS(uuids) + G_N_ELEMENTS(uuids_new);
virHashTablePtr hash; GHashTable *hash;
size_t i; size_t i;
int ret = -1; int ret = -1;
@ -144,7 +144,7 @@ static int
testHashRemove(const void *data G_GNUC_UNUSED) testHashRemove(const void *data G_GNUC_UNUSED)
{ {
int count = G_N_ELEMENTS(uuids) - G_N_ELEMENTS(uuids_subset); int count = G_N_ELEMENTS(uuids) - G_N_ELEMENTS(uuids_subset);
virHashTablePtr hash; GHashTable *hash;
size_t i; size_t i;
int ret = -1; int ret = -1;
@ -178,7 +178,7 @@ testHashRemoveForEachSome(void *payload G_GNUC_UNUSED,
const char *name, const char *name,
void *data) void *data)
{ {
virHashTablePtr hash = data; GHashTable *hash = data;
size_t i; size_t i;
for (i = 0; i < G_N_ELEMENTS(uuids_subset); i++) { for (i = 0; i < G_N_ELEMENTS(uuids_subset); i++) {
@ -201,7 +201,7 @@ testHashRemoveForEachAll(void *payload G_GNUC_UNUSED,
const char *name, const char *name,
void *data) void *data)
{ {
virHashTablePtr hash = data; GHashTable *hash = data;
virHashRemoveEntry(hash, name); virHashRemoveEntry(hash, name);
return 0; return 0;
@ -212,7 +212,7 @@ static int
testHashRemoveForEach(const void *data) testHashRemoveForEach(const void *data)
{ {
const struct testInfo *info = data; const struct testInfo *info = data;
virHashTablePtr hash; GHashTable *hash;
int ret = -1; int ret = -1;
if (!(hash = testHashInit())) if (!(hash = testHashInit()))
@ -238,7 +238,7 @@ static int
testHashSteal(const void *data G_GNUC_UNUSED) testHashSteal(const void *data G_GNUC_UNUSED)
{ {
int count = G_N_ELEMENTS(uuids) - G_N_ELEMENTS(uuids_subset); int count = G_N_ELEMENTS(uuids) - G_N_ELEMENTS(uuids_subset);
virHashTablePtr hash; GHashTable *hash;
size_t i; size_t i;
int ret = -1; int ret = -1;
@ -291,7 +291,7 @@ testHashRemoveSetIter(const void *payload G_GNUC_UNUSED,
static int static int
testHashRemoveSet(const void *data G_GNUC_UNUSED) testHashRemoveSet(const void *data G_GNUC_UNUSED)
{ {
virHashTablePtr hash; GHashTable *hash;
int count = 0; int count = 0;
int rcount; int rcount;
int ret = -1; int ret = -1;
@ -335,7 +335,7 @@ testHashSearchIter(const void *payload G_GNUC_UNUSED,
static int static int
testHashSearch(const void *data G_GNUC_UNUSED) testHashSearch(const void *data G_GNUC_UNUSED)
{ {
virHashTablePtr hash; GHashTable *hash;
void *entry; void *entry;
int ret = -1; int ret = -1;
@ -364,7 +364,7 @@ testHashSearch(const void *data G_GNUC_UNUSED)
static int static int
testHashGetItems(const void *data G_GNUC_UNUSED) testHashGetItems(const void *data G_GNUC_UNUSED)
{ {
virHashTablePtr hash; GHashTable *hash;
virHashKeyValuePairPtr array = NULL; virHashKeyValuePairPtr array = NULL;
int ret = -1; int ret = -1;
char keya[] = "a"; char keya[] = "a";
@ -419,7 +419,8 @@ testHashEqualCompValue(const void *value1, const void *value2)
static int static int
testHashEqual(const void *data G_GNUC_UNUSED) testHashEqual(const void *data G_GNUC_UNUSED)
{ {
virHashTablePtr hash1, hash2 = NULL; GHashTable *hash1;
GHashTable *hash2 = NULL;
int ret = -1; int ret = -1;
char keya[] = "a"; char keya[] = "a";
char keyb[] = "b"; char keyb[] = "b";
@ -480,7 +481,7 @@ testHashEqual(const void *data G_GNUC_UNUSED)
static int static int
testHashDuplicate(const void *data G_GNUC_UNUSED) testHashDuplicate(const void *data G_GNUC_UNUSED)
{ {
g_autoptr(virHashTable) hash = NULL; g_autoptr(GHashTable) hash = NULL;
if (!(hash = virHashNew(NULL))) if (!(hash = virHashNew(NULL)))
return -1; return -1;