All users of virHashTable pass strings as the name/key of the entry.
Make this an official requirement by turning the variables to 'const
char *'.
For any other case it's better to use glib's GHashTable.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
static int
-addToTable(void *payload, const void *name, void *data)
+addToTable(void *payload, const char *name, void *data)
{
struct addToTableStruct *atts = (struct addToTableStruct *)data;
virNWFilterVarValuePtr val;
* Helper to clear stream callbacks when freeing the hash
*/
static int virChrdevFreeClearCallbacks(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data G_GNUC_UNUSED)
{
virChrdevHashEntry *ent = payload;
static int
virDomainMomentActOnDescendant(void *payload,
- const void *name,
+ const char *name,
void *data)
{
virDomainMomentObjPtr obj = payload;
static int virDomainMomentObjListCopyNames(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virDomainMomentObjPtr obj = payload;
};
static int
virDomainMomentSetRelations(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virDomainMomentObjPtr obj = payload;
static int virDomainObjListSearchID(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *data)
{
virDomainObjPtr obj = (virDomainObjPtr)payload;
static int
virDomainObjListCount(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virDomainObjPtr obj = payload;
static int
virDomainObjListCopyActiveIDs(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virDomainObjPtr obj = payload;
static int
virDomainObjListCopyInactiveNames(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virDomainObjPtr obj = payload;
static int
virDomainObjListHelper(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct virDomainListIterData *data = opaque;
static int
virDomainObjListCollectIterator(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct virDomainListData *data = opaque;
static int
virInterfaceObjListFindByMACStringCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virInterfaceObjPtr obj = payload;
static int
virInterfaceObjListExportCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virInterfaceObjListExportDataPtr data = opaque;
static int
virInterfaceObjListCloneCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virInterfaceObjPtr srcObj = payload;
static int
virInterfaceObjListNumOfInterfacesCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virInterfaceObjPtr obj = payload;
static int
virInterfaceObjListGetNamesCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virInterfaceObjPtr obj = payload;
static int
virNetworkObjSearchName(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *data)
{
virNetworkObjPtr obj = (virNetworkObjPtr) payload;
static int
virNetworkObjBridgeInUseHelper(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
int ret;
static int
virNetworkObjListExportCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virNetworkObjListExportDataPtr data = opaque;
static int
virNetworkObjListForEachHelper(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct virNetworkObjListForEachHelperData *data = opaque;
static int
virNetworkObjListGetHelper(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct virNetworkObjListGetHelperData *data = opaque;
static int
virNetworkObjListPruneHelper(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
const struct virNetworkObjListPruneHelperData *data = opaque;
static int
virNetworkObjPortListExportCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virNetworkObjPortListExportDataPtr data = opaque;
static int
virNetworkObjPortForEachCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virNetworkObjPortListForEachData *data = opaque;
static int
virNodeDeviceObjListFindBySysfsPathCallback(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload;
static int
virNodeDeviceObjListFindByWWNsCallback(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload;
static int
virNodeDeviceObjListFindByFabricWWNCallback(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload;
static int
virNodeDeviceObjListFindByCapCallback(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload;
static int
virNodeDeviceObjListFindSCSIHostByWWNsCallback(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload;
static int
virNodeDeviceObjListFindMediatedDeviceByUUIDCallback(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload;
static int
virNodeDeviceObjListNumOfDevicesCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virNodeDeviceObjPtr obj = payload;
static int
virNodeDeviceObjListGetNamesCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virNodeDeviceObjPtr obj = payload;
static int
virNodeDeviceObjListExportCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virNodeDeviceObjPtr obj = payload;
static int
virNWFilterBindingObjListHelper(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct virNWFilterBindingListIterData *data = opaque;
static int
virNWFilterBindingObjListCollectIterator(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct virNWFilterBindingListData *data = opaque;
static int
virSecretObjSearchName(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virSecretObjPtr obj = (virSecretObjPtr) payload;
static int
virSecretObjListNumOfSecretsCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct virSecretCountData *data = opaque;
static int
virSecretObjListGetUUIDsCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct virSecretListData *data = opaque;
static int
virSecretObjListExportCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virSecretObjListExportDataPtr data = opaque;
static int
virStoragePoolObjListForEachCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virStoragePoolObjPtr obj = payload;
static int
virStoragePoolObjListSearchCb(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virStoragePoolObjPtr obj = (virStoragePoolObjPtr) payload;
static int
virStoragePoolObjForEachVolumeCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
int ret = 0;
static int
virStoragePoolObjSearchVolumeCb(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virStorageVolObjPtr volobj = (virStorageVolObjPtr) payload;
static int
virStoragePoolObjNumOfVolumesCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virStorageVolObjPtr volobj = payload;
static int
virStoragePoolObjVolumeGetNamesCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virStorageVolObjPtr volobj = payload;
static int
virStoragePoolObjVolumeListExportCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virStorageVolObjPtr volobj = payload;
static int
virStoragePoolObjSourceFindDuplicateCb(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virStoragePoolObjPtr obj = (virStoragePoolObjPtr) payload;
static int
virStoragePoolObjNumOfStoragePoolsCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virStoragePoolObjPtr obj = payload;
static int
virStoragePoolObjGetNamesCb(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virStoragePoolObjPtr obj = payload;
static int
virStoragePoolObjListExportCallback(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virStoragePoolObjPtr obj = payload;
static int
virCloseCallbacksGetOne(void *payload,
- const void *key,
+ const char *key,
void *opaque)
{
struct virCloseCallbacksData *data = opaque;
static int
virLockDaemonClientReleaseLockspace(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virLockSpacePtr lockspace = payload;
*/
static int
virNWFilterSnoopPruneIter(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *data G_GNUC_UNUSED)
{
virNWFilterSnoopReqPtr req = (virNWFilterSnoopReqPtr)payload;
*/
static int
virNWFilterSnoopSaveIter(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virNWFilterSnoopReqPtr req = payload;
*/
static int
virNWFilterSnoopRemAllReqIter(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *data G_GNUC_UNUSED)
{
virNWFilterSnoopReqPtr req = (virNWFilterSnoopReqPtr)payload;
static int
-printString(void *payload G_GNUC_UNUSED, const void *name, void *data)
+printString(void *payload G_GNUC_UNUSED, const char *name, void *data)
{
struct printString *ps = data;
- if ((STREQ((char *)name, NWFILTER_STD_VAR_IP) && !ps->reportIP) ||
- (STREQ((char *)name, NWFILTER_STD_VAR_MAC) && !ps->reportMAC))
+ if ((STREQ(name, NWFILTER_STD_VAR_IP) && !ps->reportIP) ||
+ (STREQ(name, NWFILTER_STD_VAR_MAC) && !ps->reportMAC))
return 0;
if (virBufferUse(&ps->buf) && ps->separator)
/* returns 1 for a job we didn't reconnect to */
static int
qemuBlockJobRefreshJobsFindInactive(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *data G_GNUC_UNUSED)
{
const qemuBlockJobData *job = payload;
static int
virQEMUCapsSearchDomcaps(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virDomainCapsPtr domCaps = (virDomainCapsPtr) payload;
static int
qemuCheckpointReparentChildren(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virDomainMomentObjPtr moment = payload;
static int
qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
struct qemuDomainPrivateBlockJobFormatData *data = opaque;
/* Hash iterator callback to discard multiple snapshots. */
int qemuDomainMomentDiscardAll(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virDomainMomentObjPtr moment = payload;
static int
qemuDomainDefHasManagedPRBlockjobIterator(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
qemuBlockJobDataPtr job = payload;
};
int qemuDomainMomentDiscardAll(void *payload,
- const void *name,
+ const char *name,
void *data);
int qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver,
static int
qemuProcessRefreshLegacyBlockjob(void *payload,
- const void *name,
+ const char *name,
void *opaque)
{
const char *jobname = name;
/* Count how many snapshots in a set are external snapshots. */
static int
qemuSnapshotCountExternal(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virDomainMomentObjPtr snap = payload;
static int
qemuSnapshotChildrenReparent(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virDomainMomentObjPtr moment = payload;
static int
daemonServerClose(void *payload,
- const void *key G_GNUC_UNUSED,
+ const char *key G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED);
static void
static int
collectServers(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque)
{
virNetServerPtr srv = virObjectRef(payload);
static int
daemonServerUpdateServices(void *payload,
- const void *key G_GNUC_UNUSED,
+ const char *key G_GNUC_UNUSED,
void *opaque)
{
bool *enable = opaque;
static int
daemonServerProcessClients(void *payload,
- const void *key G_GNUC_UNUSED,
+ const char *key G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
virNetServerPtr srv = payload;
static int
daemonServerShutdownWait(void *payload,
- const void *key G_GNUC_UNUSED,
+ const char *key G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
virNetServerPtr srv = payload;
static int
daemonServerClose(void *payload,
- const void *key G_GNUC_UNUSED,
+ const char *key G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
virNetServerPtr srv = payload;
static int
daemonServerHasClients(void *payload,
- const void *key G_GNUC_UNUSED,
+ const char *key G_GNUC_UNUSED,
void *opaque)
{
bool *clients = opaque;
static int
testDomainSnapshotDiscardAll(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virDomainMomentObjPtr snap = payload;
static int
testDomainMomentReparentChildren(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virDomainMomentObjPtr moment = payload;
static int
testDomainCheckpointDiscardAll(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data)
{
virDomainMomentObjPtr chk = payload;
virObjectLock(cache);
- data = virHashSearch(cache->table, iter, iterData, (void **)&name);
+ data = virHashSearch(cache->table, iter, iterData, &name);
virFileCacheValidate(cache, name, &data);
virObjectRef(data);
typedef virHashEntry *virHashEntryPtr;
struct _virHashEntry {
struct _virHashEntry *next;
- void *name;
+ char *name;
void *payload;
};
VIR_ONCE_GLOBAL_INIT(virHashAtomic);
-static uint32_t virHashStrCode(const void *name, uint32_t seed)
+static uint32_t virHashStrCode(const char *name, uint32_t seed)
{
return virHashCodeGen(name, strlen(name), seed);
}
-static bool virHashStrEqual(const void *namea, const void *nameb)
+static bool virHashStrEqual(const char *namea, const char *nameb)
{
return STREQ(namea, nameb);
}
-static void *virHashStrCopy(const void *name)
+static char *virHashStrCopy(const char *name)
{
return g_strdup(name);
}
static char *
-virHashStrPrintHuman(const void *name)
+virHashStrPrintHuman(const char *name)
{
return g_strdup(name);
}
-static void virHashStrFree(void *name)
+static void virHashStrFree(char *name)
{
VIR_FREE(name);
}
static size_t
-virHashComputeKey(const virHashTable *table, const void *name)
+virHashComputeKey(const virHashTable *table, const char *name)
{
uint32_t value = table->keyCode(name, table->seed);
return value % table->size;
}
static int
-virHashAddOrUpdateEntry(virHashTablePtr table, const void *name,
+virHashAddOrUpdateEntry(virHashTablePtr table, const char *name,
void *userdata,
bool is_update)
{
* Returns 0 the addition succeeded and -1 in case of error.
*/
int
-virHashAddEntry(virHashTablePtr table, const void *name, void *userdata)
+virHashAddEntry(virHashTablePtr table, const char *name, void *userdata)
{
return virHashAddOrUpdateEntry(table, name, userdata, false);
}
* Returns 0 the addition succeeded and -1 in case of error.
*/
int
-virHashUpdateEntry(virHashTablePtr table, const void *name,
+virHashUpdateEntry(virHashTablePtr table, const char *name,
void *userdata)
{
return virHashAddOrUpdateEntry(table, name, userdata, true);
int
virHashAtomicUpdate(virHashAtomicPtr table,
- const void *name,
+ const char *name,
void *userdata)
{
int ret;
static virHashEntryPtr
virHashGetEntry(const virHashTable *table,
- const void *name)
+ const char *name)
{
size_t key;
virHashEntryPtr entry;
* Returns a pointer to the userdata
*/
void *
-virHashLookup(const virHashTable *table, const void *name)
+virHashLookup(const virHashTable *table, const char *name)
{
virHashEntryPtr entry = virHashGetEntry(table, name);
*/
bool
virHashHasEntry(const virHashTable *table,
- const void *name)
+ const char *name)
{
return !!virHashGetEntry(table, name);
}
*
* Returns a pointer to the userdata
*/
-void *virHashSteal(virHashTablePtr table, const void *name)
+void *virHashSteal(virHashTablePtr table, const char *name)
{
void *data = virHashLookup(table, name);
if (data) {
void *
virHashAtomicSteal(virHashAtomicPtr table,
- const void *name)
+ const char *name)
{
void *data;
* Returns 0 if the removal succeeded and -1 in case of error or not found.
*/
int
-virHashRemoveEntry(virHashTablePtr table, const void *name)
+virHashRemoveEntry(virHashTablePtr table, const char *name)
{
virHashEntryPtr entry;
virHashEntryPtr *nextptr;
static int
_virHashRemoveAllIter(const void *payload G_GNUC_UNUSED,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *data G_GNUC_UNUSED)
{
return 1;
void *virHashSearch(const virHashTable *ctable,
virHashSearcher iter,
const void *data,
- void **name)
+ char **name)
{
size_t i;
};
static int virHashGetKeysIterator(void *payload,
- const void *key, void *data)
+ const char *key, void *data)
{
struct getKeysIter *iter = data;
virHashValueComparator compar;
};
-static int virHashEqualSearcher(const void *payload, const void *name,
+static int virHashEqualSearcher(const void *payload, const char *name,
const void *data)
{
struct virHashEqualData *vhed = (void *)data;
*
* Returns -1 to stop the iteration, e.g. in case of an error
*/
-typedef int (*virHashIterator) (void *payload, const void *name, void *data);
+typedef int (*virHashIterator) (void *payload, const char *name, void *data);
/**
* virHashSearcher:
* @payload: the data in the hash
* Returns 1 if the hash entry is desired, 0 to move
* to next entry
*/
-typedef int (*virHashSearcher) (const void *payload, const void *name,
+typedef int (*virHashSearcher) (const void *payload, const char *name,
const void *data);
/**
*
* Returns the hash code
*/
-typedef uint32_t (*virHashKeyCode)(const void *name,
+typedef uint32_t (*virHashKeyCode)(const char *name,
uint32_t seed);
/**
* virHashKeyEqual:
*
* Returns true if the keys are equal, false otherwise
*/
-typedef bool (*virHashKeyEqual)(const void *namea, const void *nameb);
+typedef bool (*virHashKeyEqual)(const char *namea, const char *nameb);
/**
* virHashKeyCopy:
* @name: the hash key
* Returns a copy of @name which will eventually be passed to the
* 'virHashKeyFree' callback at the end of its lifetime.
*/
-typedef void *(*virHashKeyCopy)(const void *name);
+typedef char *(*virHashKeyCopy)(const char *name);
/**
* virHashKeyPrintHuman:
* @name: the hash key
* Returns a string representation of the key for use in error messages. Caller
* promises to always free the returned string.
*/
-typedef char *(*virHashKeyPrintHuman) (const void *name);
+typedef char *(*virHashKeyPrintHuman) (const char *name);
/**
* virHashKeyFree:
* Free any memory associated with the hash
* key @name
*/
-typedef void (*virHashKeyFree)(void *name);
+typedef void (*virHashKeyFree)(char *name);
/*
* Constructor and destructor.
* Add a new entry to the hash table.
*/
int virHashAddEntry(virHashTablePtr table,
- const void *name, void *userdata);
+ const char *name, void *userdata);
int virHashUpdateEntry(virHashTablePtr table,
- const void *name,
+ const char *name,
void *userdata);
int virHashAtomicUpdate(virHashAtomicPtr table,
- const void *name,
+ const char *name,
void *userdata);
/*
* Remove an entry from the hash table.
*/
int virHashRemoveEntry(virHashTablePtr table,
- const void *name);
+ const char *name);
/*
* Remove all entries from the hash table.
/*
* Retrieve the userdata.
*/
-void *virHashLookup(const virHashTable *table, const void *name);
-bool virHashHasEntry(const virHashTable *table, const void *name);
+void *virHashLookup(const virHashTable *table, const char *name);
+bool virHashHasEntry(const virHashTable *table, const char *name);
/*
* Retrieve & remove the userdata.
*/
-void *virHashSteal(virHashTablePtr table, const void *name);
+void *virHashSteal(virHashTablePtr table, const char *name);
void *virHashAtomicSteal(virHashAtomicPtr table,
- const void *name);
+ const char *name);
/*
* Get the hash table's key/value pairs and have them optionally sorted.
int virHashForEach(virHashTablePtr table, virHashIterator iter, void *data);
ssize_t virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, const void *data);
void *virHashSearch(const virHashTable *table, virHashSearcher iter,
- const void *data, void **name);
+ const void *data, char **name);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virHashTable, virHashFree);
static int
virLockSpaceRemoveResourcesForOwner(const void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
const void *opaque)
{
virLockSpaceResourcePtr res = (virLockSpaceResourcePtr)payload;
static int
virMacMapHashFree(void *payload,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
g_strfreev(payload);
static int
virMACMapHashDumper(void *payload,
- const void *name,
+ const char *name,
void *data)
{
virJSONValuePtr obj = virJSONValueNewObject();
static int
testBlockNodeNameDetectFormat(void *payload,
- const void *name,
+ const char *name,
void *opaque)
{
qemuBlockNodeNameBackingChainDataPtr entry = payload;
static int
checkOwner(void *payload,
- const void *name,
+ const char *name,
void *opaque)
{
checkOwnerData *data = opaque;
!virStringListHasString(data->paths, name)) {
fprintf(stderr,
"Path %s wasn't restored back to its original owner\n",
- (const char *) name);
+ name);
data->chown_fail = true;
}
static int
printXATTR(void *payload,
- const void *name,
+ const char *name,
void *data)
{
bool *xattr_fail = data;
/* Hash table key consists of "$path:$xattr_name", xattr
* value is then the value stored in the hash table. */
- printf("key=%s val=%s\n", (const char *) name, (const char *) payload);
+ printf("key=%s val=%s\n", name, (const char *) payload);
return 0;
}
static int
testHashCheckForEachCount(void *payload G_GNUC_UNUSED,
- const void *name G_GNUC_UNUSED,
+ const char *name G_GNUC_UNUSED,
void *data G_GNUC_UNUSED)
{
size_t *count = data;
static int
testHashRemoveForEachSome(void *payload G_GNUC_UNUSED,
- const void *name,
+ const char *name,
void *data)
{
virHashTablePtr hash = data;
static int
testHashRemoveForEachAll(void *payload G_GNUC_UNUSED,
- const void *name,
+ const char *name,
void *data)
{
virHashTablePtr hash = data;
static int
testHashRemoveSetIter(const void *payload G_GNUC_UNUSED,
- const void *name,
+ const char *name,
const void *data)
{
int *count = (int *) data;
static int
testHashSearchIter(const void *payload G_GNUC_UNUSED,
- const void *name,
+ const char *name,
const void *data G_GNUC_UNUSED)
{
return STREQ(uuids_subset[testSearchIndex], name);