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,
const char *suffix)
{
g_autoptr(virHashTable) disks = virHashNew(NULL);
g_autoptr(GHashTable) disks = virHashNew(NULL);
size_t i;
int ndisks;
bool backup_all = false;

View File

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

View File

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@
#define VIR_FROM_THIS VIR_FROM_NWFILTER
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -69,15 +69,15 @@ struct _virStorageVolObjList {
/* key string -> virStorageVolObj mapping
* for (1), lockless lookup-by-key */
virHashTable *objsKey;
GHashTable *objsKey;
/* name string -> virStorageVolObj mapping
* for (1), lockless lookup-by-name */
virHashTable *objsName;
GHashTable *objsName;
/* path string -> virStorageVolObj mapping
* for (1), lockless lookup-by-path */
virHashTable *objsPath;
GHashTable *objsPath;
};
struct _virStoragePoolObj {
@ -101,11 +101,11 @@ struct _virStoragePoolObjList {
/* uuid string -> virStoragePoolObj mapping
* for (1), lockless lookup-by-uuid */
virHashTable *objs;
GHashTable *objs;
/* name string -> virStoragePoolObj mapping
* 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;
g_autoptr(hypervInvokeParamsList) params = NULL;
g_auto(virBuffer) eprQuery = VIR_BUFFER_INITIALIZER;
g_autoptr(virHashTable) autostartParam = NULL;
g_autoptr(GHashTable) autostartParam = NULL;
const char *methodName = NULL;
hypervWmiClassInfoListPtr embeddedParamClass = NULL;
const char *enabledValue = NULL, *disabledValue = NULL;
@ -1806,7 +1806,7 @@ hypervDomainSetMemoryFlags(virDomainPtr domain, unsigned long memory,
Msvm_VirtualSystemSettingData *vssd = NULL;
Msvm_MemorySettingData *memsd = NULL;
g_auto(virBuffer) eprQuery = VIR_BUFFER_INITIALIZER;
g_autoptr(virHashTable) memResource = NULL;
g_autoptr(GHashTable) memResource = NULL;
virCheckFlags(0, -1);

View File

@ -312,18 +312,18 @@ hypervAddEprParam(hypervInvokeParamsListPtr params, const char *name,
* @priv: hypervPrivate object associated with the connection
* @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
* 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)
{
size_t i;
size_t count;
g_autoptr(virHashTable) table = NULL;
g_autoptr(GHashTable) table = NULL;
XmlSerializerInfo *typeinfo = NULL;
hypervWmiClassInfoPtr classInfo = NULL;
@ -366,7 +366,7 @@ hypervCreateEmbeddedParam(hypervPrivate *priv, hypervWmiClassInfoListPtr info)
* -1 otherwise.
*/
int
hypervSetEmbeddedProperty(virHashTablePtr table,
hypervSetEmbeddedProperty(GHashTable *table,
const char *name,
const char *value)
{
@ -382,7 +382,7 @@ hypervSetEmbeddedProperty(virHashTablePtr table,
* @table: pointer to table of properties to add
* @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.
*
* Upon successfull return the @table is consumed and the pointer is cleared out.
@ -393,7 +393,7 @@ int
hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
hypervPrivate *priv,
const char *name,
virHashTablePtr *table,
GHashTable **table,
hypervWmiClassInfoListPtr info)
{
hypervParamPtr p = NULL;
@ -424,7 +424,7 @@ hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
* Free the embedded param hash table.
*/
void
hypervFreeEmbeddedParam(virHashTablePtr p)
hypervFreeEmbeddedParam(GHashTable *p)
{
virHashFree(p);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3285,7 +3285,7 @@ ebtablesSubChainInstSort(const void *a, const void *b)
static int
ebtablesGetSubChainInsts(virHashTablePtr chains,
ebtablesGetSubChainInsts(GHashTable *chains,
bool incoming,
ebtablesSubChainInstPtr **insts,
size_t *ninsts)
@ -3328,8 +3328,8 @@ ebiptablesApplyNewRules(const char *ifname,
{
size_t i, j;
g_autoptr(virFirewall) fw = virFirewallNew();
g_autoptr(virHashTable) chains_in_set = virHashNew(NULL);
g_autoptr(virHashTable) chains_out_set = virHashNew(NULL);
g_autoptr(GHashTable) chains_in_set = virHashNew(NULL);
g_autoptr(GHashTable) chains_out_set = virHashNew(NULL);
bool haveEbtables = false;
bool haveIptables = 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.
*/
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
*/
static char *
virNWFilterPrintVars(virHashTablePtr vars,
virNWFilterPrintVars(GHashTable *vars,
const char *separator,
bool reportMAC,
bool reportIP)
@ -195,11 +195,11 @@ virNWFilterPrintVars(virHashTablePtr vars,
* Creates a new hash table with contents of var1 and var2 added where
* contents of var2 will overwrite those of var1.
*/
static virHashTablePtr
virNWFilterCreateVarsFrom(virHashTablePtr vars1,
virHashTablePtr vars2)
static GHashTable *
virNWFilterCreateVarsFrom(GHashTable *vars1,
GHashTable *vars2)
{
virHashTablePtr res = virHashNew(virNWFilterVarValueHashFree);
GHashTable *res = virHashNew(virNWFilterVarValueHashFree);
if (!res)
return NULL;
@ -248,7 +248,7 @@ virNWFilterInstReset(virNWFilterInstPtr inst)
static int
virNWFilterDefToInst(virNWFilterDriverStatePtr driver,
virNWFilterDefPtr def,
virHashTablePtr vars,
GHashTable *vars,
enum instCase useNewFilter,
bool *foundNewFilter,
virNWFilterInstPtr inst);
@ -256,7 +256,7 @@ virNWFilterDefToInst(virNWFilterDriverStatePtr driver,
static int
virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def,
virNWFilterRuleDefPtr rule,
virHashTablePtr vars,
GHashTable *vars,
virNWFilterInstPtr inst)
{
virNWFilterRuleInstPtr ruleinst;
@ -288,13 +288,13 @@ virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def,
static int
virNWFilterIncludeDefToRuleInst(virNWFilterDriverStatePtr driver,
virNWFilterIncludeDefPtr inc,
virHashTablePtr vars,
GHashTable *vars,
enum instCase useNewFilter,
bool *foundNewFilter,
virNWFilterInstPtr inst)
{
virNWFilterObjPtr obj;
virHashTablePtr tmpvars = NULL;
GHashTable *tmpvars = NULL;
virNWFilterDefPtr childdef;
virNWFilterDefPtr newChilddef;
int ret = -1;
@ -369,7 +369,7 @@ virNWFilterIncludeDefToRuleInst(virNWFilterDriverStatePtr driver,
static int
virNWFilterDefToInst(virNWFilterDriverStatePtr driver,
virNWFilterDefPtr def,
virHashTablePtr vars,
GHashTable *vars,
enum instCase useNewFilter,
bool *foundNewFilter,
virNWFilterInstPtr inst)
@ -404,8 +404,8 @@ virNWFilterDefToInst(virNWFilterDriverStatePtr driver,
static int
virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
virHashTablePtr vars,
virHashTablePtr missing_vars,
GHashTable *vars,
GHashTable *missing_vars,
int useNewFilter,
virNWFilterDriverStatePtr driver)
{
@ -441,7 +441,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
}
}
} else if (inc) {
g_autoptr(virHashTable) tmpvars = NULL;
g_autoptr(GHashTable) tmpvars = NULL;
VIR_DEBUG("Following filter %s", inc->filterref);
if (!(obj = virNWFilterObjListFindInstantiateFilter(driver->nwfilters,
@ -516,7 +516,7 @@ virNWFilterDoInstantiate(virNWFilterTechDriverPtr techdriver,
const char *learning;
bool reportIP = false;
virHashTablePtr missing_vars = virHashNew(virNWFilterVarValueHashFree);
GHashTable *missing_vars = virHashNew(virNWFilterVarValueHashFree);
memset(&inst, 0, sizeof(inst));
@ -639,7 +639,7 @@ virNWFilterDoInstantiate(virNWFilterTechDriverPtr techdriver,
static int
virNWFilterVarHashmapAddStdValue(virHashTablePtr table,
virNWFilterVarHashmapAddStdValue(GHashTable *table,
const char *var,
const char *value)
{
@ -940,7 +940,7 @@ enum {
static int
virNWFilterBuildOne(virNWFilterDriverStatePtr driver,
virNWFilterBindingDefPtr binding,
virHashTablePtr skipInterfaces,
GHashTable *skipInterfaces,
int step)
{
bool skipIface;
@ -982,7 +982,7 @@ virNWFilterBuildOne(virNWFilterDriverStatePtr driver,
struct virNWFilterBuildData {
virNWFilterDriverStatePtr driver;
virHashTablePtr skipInterfaces;
GHashTable *skipInterfaces;
int step;
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -435,7 +435,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
virDomainObjPtr vm)
{
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);
size_t i;
int rc;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -86,7 +86,7 @@ qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr vm,
virQEMUDriverPtr driver,
const char *greeting,
virHashTablePtr schema);
GHashTable *schema);
qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName,
virDomainXMLOptionPtr xmlopt,
@ -94,7 +94,7 @@ qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName,
qemuMonitorTestPtr qemuMonitorTestNewFromFileFull(const char *fileName,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
virHashTablePtr qmpschema);
GHashTable *qmpschema);
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
* to list XATTRs a path has, therefore we don't need something
* more clever. */
virHashTablePtr xattr_paths = NULL;
GHashTable *xattr_paths = NULL;
/* 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 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 path is the key and the value is the label. */
virHashTablePtr selinux_paths = NULL;
GHashTable *selinux_paths = NULL;
static void

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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