]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: hash: Change type of hash table name/key to 'char'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 21 Oct 2020 11:31:16 +0000 (13:31 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 22 Oct 2020 13:02:46 +0000 (15:02 +0200)
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>
31 files changed:
src/conf/nwfilter_params.c
src/conf/virchrdev.c
src/conf/virdomainmomentobjlist.c
src/conf/virdomainobjlist.c
src/conf/virinterfaceobj.c
src/conf/virnetworkobj.c
src/conf/virnodedeviceobj.c
src/conf/virnwfilterbindingobjlist.c
src/conf/virsecretobj.c
src/conf/virstorageobj.c
src/hypervisor/virclosecallbacks.c
src/locking/lock_daemon.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_gentech_driver.c
src/qemu/qemu_blockjob.c
src/qemu/qemu_capabilities.c
src/qemu/qemu_checkpoint.c
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_process.c
src/qemu/qemu_snapshot.c
src/rpc/virnetdaemon.c
src/test/test_driver.c
src/util/virfilecache.c
src/util/virhash.c
src/util/virhash.h
src/util/virlockspace.c
src/util/virmacmap.c
tests/qemumonitorjsontest.c
tests/qemusecuritymock.c
tests/virhashtest.c

index fd05b45ca3d2a73818d311d93384aaedf564529f..73160a38a40d957617a521e1f3bac46ced3cbdae 100644 (file)
@@ -620,7 +620,7 @@ struct addToTableStruct {
 
 
 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;
index 0d2c9503ab1216f34e2b7c6ae5ccb547d3cbdafb..5e5c03d03bf2a2f650dbb9d1edc06379b6ddeca7 100644 (file)
@@ -279,7 +279,7 @@ virChrdevsPtr virChrdevAlloc(void)
  * 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;
index 43c77e6c54fa14688596a0915efec5da93af3b84..511bf1d4157c31bcbac32ea532f64b297a804d1f 100644 (file)
@@ -76,7 +76,7 @@ struct moment_act_on_descendant {
 
 static int
 virDomainMomentActOnDescendant(void *payload,
-                               const void *name,
+                               const char *name,
                                void *data)
 {
     virDomainMomentObjPtr obj = payload;
@@ -307,7 +307,7 @@ struct virDomainMomentNameData {
 
 
 static int virDomainMomentObjListCopyNames(void *payload,
-                                           const void *name G_GNUC_UNUSED,
+                                           const char *name G_GNUC_UNUSED,
                                            void *opaque)
 {
     virDomainMomentObjPtr obj = payload;
@@ -491,7 +491,7 @@ struct moment_set_relation {
 };
 static int
 virDomainMomentSetRelations(void *payload,
-                            const void *name G_GNUC_UNUSED,
+                            const char *name G_GNUC_UNUSED,
                             void *data)
 {
     virDomainMomentObjPtr obj = payload;
index 9e8757eff993ad78c7be2748df4ade7df30b98d2..e9a4b271df3a9450f4a70af8fdfc539ae16b0837 100644 (file)
@@ -95,7 +95,7 @@ static void virDomainObjListDispose(void *obj)
 
 
 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;
@@ -649,7 +649,7 @@ struct virDomainObjListData {
 
 static int
 virDomainObjListCount(void *payload,
-                      const void *name G_GNUC_UNUSED,
+                      const char *name G_GNUC_UNUSED,
                       void *opaque)
 {
     virDomainObjPtr obj = payload;
@@ -696,7 +696,7 @@ struct virDomainIDData {
 
 static int
 virDomainObjListCopyActiveIDs(void *payload,
-                              const void *name G_GNUC_UNUSED,
+                              const char *name G_GNUC_UNUSED,
                               void *opaque)
 {
     virDomainObjPtr obj = payload;
@@ -741,7 +741,7 @@ struct virDomainNameData {
 
 static int
 virDomainObjListCopyInactiveNames(void *payload,
-                                  const void *name G_GNUC_UNUSED,
+                                  const char *name G_GNUC_UNUSED,
                                   void *opaque)
 {
     virDomainObjPtr obj = payload;
@@ -797,7 +797,7 @@ struct virDomainListIterData {
 
 static int
 virDomainObjListHelper(void *payload,
-                       const void *name G_GNUC_UNUSED,
+                       const char *name G_GNUC_UNUSED,
                        void *opaque)
 {
     struct virDomainListIterData *data = opaque;
@@ -925,7 +925,7 @@ struct virDomainListData {
 
 static int
 virDomainObjListCollectIterator(void *payload,
-                                const void *name G_GNUC_UNUSED,
+                                const char *name G_GNUC_UNUSED,
                                 void *opaque)
 {
     struct virDomainListData *data = opaque;
index 1e29e12148084d12610d382d7e1b9383d23bee06..faf047dc5f5c123ce3f2b1521bbb0c67d051eff0 100644 (file)
@@ -161,7 +161,7 @@ struct _virInterfaceObjFindMACData {
 
 static int
 virInterfaceObjListFindByMACStringCb(void *payload,
-                                     const void *name G_GNUC_UNUSED,
+                                     const char *name G_GNUC_UNUSED,
                                      void *opaque)
 {
     virInterfaceObjPtr obj = payload;
@@ -269,7 +269,7 @@ struct _virInterfaceObjListExportData {
 
 static int
 virInterfaceObjListExportCallback(void *payload,
-                                  const void *name G_GNUC_UNUSED,
+                                  const char *name G_GNUC_UNUSED,
                                   void *opaque)
 {
     virInterfaceObjListExportDataPtr data = opaque;
@@ -361,7 +361,7 @@ struct _virInterfaceObjListCloneData {
 
 static int
 virInterfaceObjListCloneCb(void *payload,
-                           const void *name G_GNUC_UNUSED,
+                           const char *name G_GNUC_UNUSED,
                            void *opaque)
 {
     virInterfaceObjPtr srcObj = payload;
@@ -480,7 +480,7 @@ struct _virInterfaceObjNumOfInterfacesData {
 
 static int
 virInterfaceObjListNumOfInterfacesCb(void *payload,
-                                     const void *name G_GNUC_UNUSED,
+                                     const char *name G_GNUC_UNUSED,
                                      void *opaque)
 {
     virInterfaceObjPtr obj = payload;
@@ -522,7 +522,7 @@ struct _virInterfaceObjGetNamesData {
 
 static int
 virInterfaceObjListGetNamesCb(void *payload,
-                              const void *name G_GNUC_UNUSED,
+                              const char *name G_GNUC_UNUSED,
                               void *opaque)
 {
     virInterfaceObjPtr obj = payload;
index 3e537e512e664b579460b32248ff1776914ad01b..46205b163c406b6ce7c9d41aa0e0b4701eb22f72 100644 (file)
@@ -402,7 +402,7 @@ virNetworkObjFindByUUID(virNetworkObjListPtr nets,
 
 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;
@@ -1178,7 +1178,7 @@ struct virNetworkObjBridgeInUseHelperData {
 
 static int
 virNetworkObjBridgeInUseHelper(const void *payload,
-                               const void *name G_GNUC_UNUSED,
+                               const char *name G_GNUC_UNUSED,
                                const void *opaque)
 {
     int ret;
@@ -1355,7 +1355,7 @@ struct _virNetworkObjListExportData {
 
 static int
 virNetworkObjListExportCallback(void *payload,
-                                const void *name G_GNUC_UNUSED,
+                                const char *name G_GNUC_UNUSED,
                                 void *opaque)
 {
     virNetworkObjListExportDataPtr data = opaque;
@@ -1439,7 +1439,7 @@ struct virNetworkObjListForEachHelperData {
 
 static int
 virNetworkObjListForEachHelper(void *payload,
-                               const void *name G_GNUC_UNUSED,
+                               const char *name G_GNUC_UNUSED,
                                void *opaque)
 {
     struct virNetworkObjListForEachHelperData *data = opaque;
@@ -1489,7 +1489,7 @@ struct virNetworkObjListGetHelperData {
 
 static int
 virNetworkObjListGetHelper(void *payload,
-                           const void *name G_GNUC_UNUSED,
+                           const char *name G_GNUC_UNUSED,
                            void *opaque)
 {
     struct virNetworkObjListGetHelperData *data = opaque;
@@ -1576,7 +1576,7 @@ struct virNetworkObjListPruneHelperData {
 
 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;
@@ -1756,7 +1756,7 @@ struct _virNetworkObjPortListExportData {
 
 static int
 virNetworkObjPortListExportCallback(void *payload,
-                                    const void *name G_GNUC_UNUSED,
+                                    const char *name G_GNUC_UNUSED,
                                     void *opaque)
 {
     virNetworkObjPortListExportDataPtr data = opaque;
@@ -1834,7 +1834,7 @@ struct _virNetworkObjPortListForEachData {
 
 static int
 virNetworkObjPortForEachCallback(void *payload,
-                                 const void *name G_GNUC_UNUSED,
+                                 const char *name G_GNUC_UNUSED,
                                  void *opaque)
 {
     virNetworkObjPortListForEachData *data = opaque;
index dcac4c36bbff2bf05f3695cbb6833708de2e49e5..f240abf315914e3027a2220b2c13aa1f3542ef12 100644 (file)
@@ -199,7 +199,7 @@ virNodeDeviceObjListSearch(virNodeDeviceObjListPtr devs,
 
 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;
@@ -256,7 +256,7 @@ struct virNodeDeviceObjListFindByWWNsData {
 
 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;
@@ -292,7 +292,7 @@ virNodeDeviceObjListFindByWWNs(virNodeDeviceObjListPtr devs,
 
 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;
@@ -322,7 +322,7 @@ virNodeDeviceObjListFindByFabricWWN(virNodeDeviceObjListPtr devs,
 
 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;
@@ -354,7 +354,7 @@ struct virNodeDeviceObjListFindSCSIHostByWWNsData {
 
 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;
@@ -401,7 +401,7 @@ virNodeDeviceObjListFindSCSIHostByWWNs(virNodeDeviceObjListPtr devs,
 
 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;
@@ -729,7 +729,7 @@ struct virNodeDeviceCountData {
 
 static int
 virNodeDeviceObjListNumOfDevicesCallback(void *payload,
-                                         const void *name G_GNUC_UNUSED,
+                                         const char *name G_GNUC_UNUSED,
                                          void *opaque)
 {
     virNodeDeviceObjPtr obj = payload;
@@ -777,7 +777,7 @@ struct virNodeDeviceGetNamesData {
 
 static int
 virNodeDeviceObjListGetNamesCallback(void *payload,
-                                     const void *name G_GNUC_UNUSED,
+                                     const char *name G_GNUC_UNUSED,
                                      void *opaque)
 {
     virNodeDeviceObjPtr obj = payload;
@@ -884,7 +884,7 @@ struct _virNodeDeviceObjListExportData {
 
 static int
 virNodeDeviceObjListExportCallback(void *payload,
-                                   const void *name G_GNUC_UNUSED,
+                                   const char *name G_GNUC_UNUSED,
                                    void *opaque)
 {
     virNodeDeviceObjPtr obj = payload;
index 6f4ad0bae6b049fd0b29a016d9718e52edb10e52..4cbb62abfa701b48a24853871944700e3e4458b9 100644 (file)
@@ -345,7 +345,7 @@ struct virNWFilterBindingListIterData {
 
 static int
 virNWFilterBindingObjListHelper(void *payload,
-                                const void *name G_GNUC_UNUSED,
+                                const char *name G_GNUC_UNUSED,
                                 void *opaque)
 {
     struct virNWFilterBindingListIterData *data = opaque;
@@ -379,7 +379,7 @@ struct virNWFilterBindingListData {
 
 static int
 virNWFilterBindingObjListCollectIterator(void *payload,
-                                         const void *name G_GNUC_UNUSED,
+                                         const char *name G_GNUC_UNUSED,
                                          void *opaque)
 {
     struct virNWFilterBindingListData *data = opaque;
index a3ae64ec53264890e043122143d9779a15bf5d8f..146210fbe750d21bb2285a16aa2c7da0a615631a 100644 (file)
@@ -197,7 +197,7 @@ virSecretObjListFindByUUID(virSecretObjListPtr secrets,
 
 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;
@@ -410,7 +410,7 @@ struct virSecretCountData {
 
 static int
 virSecretObjListNumOfSecretsCallback(void *payload,
-                                     const void *name G_GNUC_UNUSED,
+                                     const char *name G_GNUC_UNUSED,
                                      void *opaque)
 {
     struct virSecretCountData *data = opaque;
@@ -443,7 +443,7 @@ struct virSecretListData {
 
 static int
 virSecretObjListGetUUIDsCallback(void *payload,
-                                 const void *name G_GNUC_UNUSED,
+                                 const char *name G_GNUC_UNUSED,
                                  void *opaque)
 {
     struct virSecretListData *data = opaque;
@@ -534,7 +534,7 @@ struct _virSecretObjListExportData {
 
 static int
 virSecretObjListExportCallback(void *payload,
-                               const void *name G_GNUC_UNUSED,
+                               const char *name G_GNUC_UNUSED,
                                void *opaque)
 {
     virSecretObjListExportDataPtr data = opaque;
index 1edcc3e0742728009e69a891ce613744ac5e40f8..219594582c23ecc52a95e7bf519ba9509dd1aada 100644 (file)
@@ -421,7 +421,7 @@ struct _virStoragePoolObjListForEachData {
 
 static int
 virStoragePoolObjListForEachCb(void *payload,
-                               const void *name G_GNUC_UNUSED,
+                               const char *name G_GNUC_UNUSED,
                                void *opaque)
 {
     virStoragePoolObjPtr obj = payload;
@@ -477,7 +477,7 @@ struct _virStoragePoolObjListSearchData {
 
 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;
@@ -728,7 +728,7 @@ struct _virStoragePoolObjForEachVolData {
 
 static int
 virStoragePoolObjForEachVolumeCb(void *payload,
-                                 const void *name G_GNUC_UNUSED,
+                                 const char *name G_GNUC_UNUSED,
                                  void *opaque)
 {
     int ret = 0;
@@ -767,7 +767,7 @@ struct _virStoragePoolObjSearchVolData {
 
 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;
@@ -864,7 +864,7 @@ struct _virStorageVolObjCountData {
 
 static int
 virStoragePoolObjNumOfVolumesCb(void *payload,
-                                const void *name G_GNUC_UNUSED,
+                                const char *name G_GNUC_UNUSED,
                                 void *opaque)
 {
     virStorageVolObjPtr volobj = payload;
@@ -913,7 +913,7 @@ struct _virStorageVolObjNameData {
 
 static int
 virStoragePoolObjVolumeGetNamesCb(void *payload,
-                                  const void *name G_GNUC_UNUSED,
+                                  const char *name G_GNUC_UNUSED,
                                   void *opaque)
 {
     virStorageVolObjPtr volobj = payload;
@@ -983,7 +983,7 @@ struct _virStoragePoolObjVolumeListExportData {
 
 static int
 virStoragePoolObjVolumeListExportCallback(void *payload,
-                                          const void *name G_GNUC_UNUSED,
+                                          const char *name G_GNUC_UNUSED,
                                           void *opaque)
 {
     virStorageVolObjPtr volobj = payload;
@@ -1430,7 +1430,7 @@ struct _virStoragePoolObjFindDuplicateData {
 
 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;
@@ -1832,7 +1832,7 @@ struct _virStoragePoolCountData {
 
 static int
 virStoragePoolObjNumOfStoragePoolsCb(void *payload,
-                                     const void *name G_GNUC_UNUSED,
+                                     const char *name G_GNUC_UNUSED,
                                      void *opaque)
 {
     virStoragePoolObjPtr obj = payload;
@@ -1884,7 +1884,7 @@ struct _virStoragePoolNameData {
 
 static int
 virStoragePoolObjGetNamesCb(void *payload,
-                            const void *name G_GNUC_UNUSED,
+                            const char *name G_GNUC_UNUSED,
                             void *opaque)
 {
     virStoragePoolObjPtr obj = payload;
@@ -2027,7 +2027,7 @@ struct _virStoragePoolObjListExportData {
 
 static int
 virStoragePoolObjListExportCallback(void *payload,
-                                    const void *name G_GNUC_UNUSED,
+                                    const char *name G_GNUC_UNUSED,
                                     void *opaque)
 {
     virStoragePoolObjPtr obj = payload;
index a73ab818daa5fb26ccd42315ab0c7827dfc16a61..d87fe845056c0a383a989021c6cb1ba88e2f6688 100644 (file)
@@ -246,7 +246,7 @@ struct virCloseCallbacksData {
 
 static int
 virCloseCallbacksGetOne(void *payload,
-                        const void *key,
+                        const char *key,
                         void *opaque)
 {
     struct virCloseCallbacksData *data = opaque;
index f1dabe56cd2bf5370d85dbea1b1436359b6eaf7a..8f16dfd0647998643bc0e347c2a4111522b82221 100644 (file)
@@ -362,7 +362,7 @@ struct virLockDaemonClientReleaseData {
 
 static int
 virLockDaemonClientReleaseLockspace(void *payload,
-                                    const void *name G_GNUC_UNUSED,
+                                    const char *name G_GNUC_UNUSED,
                                     void *opaque)
 {
     virLockSpacePtr lockspace = payload;
index a9cbaccdad5af3fd7aa2822fe0680370d1d2b347..c425af497cea4fd3033d390535b52c64303f2b95 100644 (file)
@@ -1754,7 +1754,7 @@ virNWFilterSnoopLeaseFileSave(virNWFilterSnoopIPLeasePtr ipl)
  */
 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;
@@ -1784,7 +1784,7 @@ virNWFilterSnoopPruneIter(const void *payload,
  */
 static int
 virNWFilterSnoopSaveIter(void *payload,
-                         const void *name G_GNUC_UNUSED,
+                         const char *name G_GNUC_UNUSED,
                          void *data)
 {
     virNWFilterSnoopReqPtr req = payload;
@@ -1951,7 +1951,7 @@ virNWFilterSnoopJoinThreads(void)
  */
 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;
index 073c91550abb22157e3fdaf3469adb46e3903843..ca6455c70d28a62c93fcfb489381adb5a0df4cd6 100644 (file)
@@ -140,12 +140,12 @@ struct printString
 
 
 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)
index c49c98e547dbb1408c86903f156f21797bbf65be..ed4a32e964593fc56537271d6ab21fd371887283 100644 (file)
@@ -481,7 +481,7 @@ qemuBlockJobIsRunning(qemuBlockJobDataPtr job)
 /* 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;
index 2249d035fb67a64810327510aafa9413231f40f0..a67fb785b52072efde70b9a29369c9b857255fda 100644 (file)
@@ -2156,7 +2156,7 @@ struct virQEMUCapsSearchDomcapsData {
 
 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;
index f45ab29d4c023b530e009d336ca12687c86d4282..fb76c211f82f128f91e438ec96925e19a2e5ebbb 100644 (file)
@@ -744,7 +744,7 @@ struct virQEMUCheckpointReparent {
 
 static int
 qemuCheckpointReparentChildren(void *payload,
-                               const void *name G_GNUC_UNUSED,
+                               const char *name G_GNUC_UNUSED,
                                void *data)
 {
     virDomainMomentObjPtr moment = payload;
index bea43a1ababe086ac649b6623599191bb829972f..161b369712e602cc6457961ff75ad5a3cfd83ad5 100644 (file)
@@ -2106,7 +2106,7 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobDataPtr job,
 
 static int
 qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload,
-                                              const void *name G_GNUC_UNUSED,
+                                              const char *name G_GNUC_UNUSED,
                                               void *opaque)
 {
     struct qemuDomainPrivateBlockJobFormatData *data = opaque;
@@ -6641,7 +6641,7 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
 
 /* 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;
@@ -10718,7 +10718,7 @@ qemuDomainPausedReasonToSuspendedEvent(virDomainPausedReason reason)
 
 static int
 qemuDomainDefHasManagedPRBlockjobIterator(void *payload,
-                                          const void *name G_GNUC_UNUSED,
+                                          const char *name G_GNUC_UNUSED,
                                           void *opaque)
 {
     qemuBlockJobDataPtr job = payload;
index 91b3b67cb66496f875f44a9d465b0b95477b20aa..fc69678f9b6d7c0c596fc8a06b81347bbbb1319a 100644 (file)
@@ -638,7 +638,7 @@ struct _virQEMUMomentRemove {
 };
 
 int qemuDomainMomentDiscardAll(void *payload,
-                               const void *name,
+                               const char *name,
                                void *data);
 
 int qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver,
index 89f6fd14993122d1ffee6e04c692a71d8c031a2c..91db2319fb25762a6e60717e5379f71667ad59cb 100644 (file)
@@ -8067,7 +8067,7 @@ qemuProcessRefreshCPU(virQEMUDriverPtr driver,
 
 static int
 qemuProcessRefreshLegacyBlockjob(void *payload,
-                                 const void *name,
+                                 const char *name,
                                  void *opaque)
 {
     const char *jobname = name;
index 47df102817358dd62e4843286e21a1f874acaa8c..a6241ab5d468e04579ec1a6e0912361c641b6d0d 100644 (file)
@@ -75,7 +75,7 @@ qemuSnapObjFromSnapshot(virDomainObjPtr vm,
 /* 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;
@@ -2265,7 +2265,7 @@ struct _virQEMUMomentReparent {
 
 static int
 qemuSnapshotChildrenReparent(void *payload,
-                             const void *name G_GNUC_UNUSED,
+                             const char *name G_GNUC_UNUSED,
                              void *data)
 {
     virDomainMomentObjPtr moment = payload;
index 3e2af53e82863c5efd820abb70709849f5fb1f0d..ce13f0d92764700193b516867074a17c0d116854 100644 (file)
@@ -86,7 +86,7 @@ static virClassPtr virNetDaemonClass;
 
 static int
 daemonServerClose(void *payload,
-                  const void *key G_GNUC_UNUSED,
+                  const char *key G_GNUC_UNUSED,
                   void *opaque G_GNUC_UNUSED);
 
 static void
@@ -228,7 +228,7 @@ struct collectData {
 
 static int
 collectServers(void *payload,
-               const void *name G_GNUC_UNUSED,
+               const char *name G_GNUC_UNUSED,
                void *opaque)
 {
     virNetServerPtr srv = virObjectRef(payload);
@@ -731,7 +731,7 @@ virNetDaemonAutoShutdownTimer(int timerid G_GNUC_UNUSED,
 
 static int
 daemonServerUpdateServices(void *payload,
-                           const void *key G_GNUC_UNUSED,
+                           const char *key G_GNUC_UNUSED,
                            void *opaque)
 {
     bool *enable = opaque;
@@ -752,7 +752,7 @@ virNetDaemonUpdateServices(virNetDaemonPtr dmn,
 
 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;
@@ -763,7 +763,7 @@ daemonServerProcessClients(void *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;
@@ -913,7 +913,7 @@ virNetDaemonQuit(virNetDaemonPtr dmn)
 
 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;
@@ -924,7 +924,7 @@ daemonServerClose(void *payload,
 
 static int
 daemonServerHasClients(void *payload,
-                       const void *key G_GNUC_UNUSED,
+                       const char *key G_GNUC_UNUSED,
                        void *opaque)
 {
     bool *clients = opaque;
index bb26fc247c7164bd9fdd911c7a47ea213be9bd28..5c02a8ebb077c72114dccd217d45f1c64f69c947 100644 (file)
@@ -8592,7 +8592,7 @@ struct _testMomentRemoveData {
 
 static int
 testDomainSnapshotDiscardAll(void *payload,
-                             const void *name G_GNUC_UNUSED,
+                             const char *name G_GNUC_UNUSED,
                              void *data)
 {
     virDomainMomentObjPtr snap = payload;
@@ -8612,7 +8612,7 @@ struct _testMomentReparentData {
 
 static int
 testDomainMomentReparentChildren(void *payload,
-                                 const void *name G_GNUC_UNUSED,
+                                 const char *name G_GNUC_UNUSED,
                                  void *data)
 {
     virDomainMomentObjPtr moment = payload;
@@ -8906,7 +8906,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
 
 static int
 testDomainCheckpointDiscardAll(void *payload,
-                               const void *name G_GNUC_UNUSED,
+                               const char *name G_GNUC_UNUSED,
                                void *data)
 {
     virDomainMomentObjPtr chk = payload;
index 6d75e2e4fb179c0271a25e5cfc67612b3d0075a7..cfb1d1d247282062f1cdacdf007942428382a640 100644 (file)
@@ -337,7 +337,7 @@ virFileCacheLookupByFunc(virFileCachePtr cache,
 
     virObjectLock(cache);
 
-    data = virHashSearch(cache->table, iter, iterData, (void **)&name);
+    data = virHashSearch(cache->table, iter, iterData, &name);
     virFileCacheValidate(cache, name, &data);
 
     virObjectRef(data);
index 8d56b4bb85ed3d83db044dc4e1197e38b2dd0055..f386839d6bd372be48416b9d1acaea14cbd766f3 100644 (file)
@@ -43,7 +43,7 @@ typedef struct _virHashEntry virHashEntry;
 typedef virHashEntry *virHashEntryPtr;
 struct _virHashEntry {
     struct _virHashEntry *next;
-    void *name;
+    char *name;
     void *payload;
 };
 
@@ -82,37 +82,37 @@ static int virHashAtomicOnceInit(void)
 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;
@@ -272,7 +272,7 @@ virHashFree(virHashTablePtr table)
 }
 
 static int
-virHashAddOrUpdateEntry(virHashTablePtr table, const void *name,
+virHashAddOrUpdateEntry(virHashTablePtr table, const char *name,
                         void *userdata,
                         bool is_update)
 {
@@ -337,7 +337,7 @@ virHashAddOrUpdateEntry(virHashTablePtr table, const void *name,
  * 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);
 }
@@ -355,7 +355,7 @@ virHashAddEntry(virHashTablePtr table, const void *name, void *userdata)
  * 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);
@@ -363,7 +363,7 @@ virHashUpdateEntry(virHashTablePtr table, const void *name,
 
 int
 virHashAtomicUpdate(virHashAtomicPtr table,
-                    const void *name,
+                    const char *name,
                     void *userdata)
 {
     int ret;
@@ -378,7 +378,7 @@ virHashAtomicUpdate(virHashAtomicPtr table,
 
 static virHashEntryPtr
 virHashGetEntry(const virHashTable *table,
-                const void *name)
+                const char *name)
 {
     size_t key;
     virHashEntryPtr entry;
@@ -406,7 +406,7 @@ virHashGetEntry(const virHashTable *table,
  * 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);
 
@@ -428,7 +428,7 @@ virHashLookup(const virHashTable *table, const void *name)
  */
 bool
 virHashHasEntry(const virHashTable *table,
-                const void *name)
+                const char *name)
 {
     return !!virHashGetEntry(table, name);
 }
@@ -444,7 +444,7 @@ virHashHasEntry(const virHashTable *table,
  *
  * 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) {
@@ -458,7 +458,7 @@ void *virHashSteal(virHashTablePtr table, const void *name)
 
 void *
 virHashAtomicSteal(virHashAtomicPtr table,
-                   const void *name)
+                   const char *name)
 {
     void *data;
 
@@ -500,7 +500,7 @@ virHashSize(const virHashTable *table)
  * 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;
@@ -615,7 +615,7 @@ virHashRemoveSet(virHashTablePtr table,
 
 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;
@@ -654,7 +654,7 @@ virHashRemoveAll(virHashTablePtr table)
 void *virHashSearch(const virHashTable *ctable,
                     virHashSearcher iter,
                     const void *data,
-                    void **name)
+                    char **name)
 {
     size_t i;
 
@@ -685,7 +685,7 @@ struct getKeysIter
 };
 
 static int virHashGetKeysIterator(void *payload,
-                                  const void *key, void *data)
+                                  const char *key, void *data)
 {
     struct getKeysIter *iter = data;
 
@@ -728,7 +728,7 @@ struct virHashEqualData
     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;
index a9b022f36299dc230c8398571b5e9fb05435bb04..78c74593908b165aec571c20f3ad0d20ddac5f5a 100644 (file)
@@ -40,7 +40,7 @@ typedef void (*virHashDataFree) (void *payload);
  *
  * 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
@@ -51,7 +51,7 @@ typedef int (*virHashIterator) (void *payload, const void *name, void *data);
  * 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);
 
 /**
@@ -64,7 +64,7 @@ typedef int (*virHashSearcher) (const void *payload, const void *name,
  *
  * Returns the hash code
  */
-typedef uint32_t (*virHashKeyCode)(const void *name,
+typedef uint32_t (*virHashKeyCode)(const char *name,
                                    uint32_t seed);
 /**
  * virHashKeyEqual:
@@ -75,7 +75,7 @@ typedef uint32_t (*virHashKeyCode)(const void *name,
  *
  * 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
@@ -86,7 +86,7 @@ typedef bool (*virHashKeyEqual)(const void *namea, const void *nameb);
  * 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
@@ -97,7 +97,7 @@ typedef void *(*virHashKeyCopy)(const void *name);
  * 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:
@@ -106,7 +106,7 @@ typedef char *(*virHashKeyPrintHuman) (const void *name);
  * Free any memory associated with the hash
  * key @name
  */
-typedef void (*virHashKeyFree)(void *name);
+typedef void (*virHashKeyFree)(char *name);
 
 /*
  * Constructor and destructor.
@@ -120,19 +120,19 @@ ssize_t virHashSize(const virHashTable *table);
  * 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.
@@ -142,15 +142,15 @@ ssize_t virHashRemoveAll(virHashTablePtr 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.
@@ -193,6 +193,6 @@ bool virHashEqual(const virHashTable *table1,
 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);
index 30d6a19d1dcaaab9b73466eb833295e347f77b90..2731d46dfc8d8a1ecf8bd6f23570acde477d9e0c 100644 (file)
@@ -683,7 +683,7 @@ struct virLockSpaceRemoveData {
 
 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;
index 94e73f3530446ef8482d7b426966a6f6692e8501..2d203e72afe72aa1e6097a4175d633e91f8abd38 100644 (file)
@@ -52,7 +52,7 @@ static virClassPtr virMacMapClass;
 
 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);
@@ -197,7 +197,7 @@ virMacMapLoadFile(virMacMapPtr mgr,
 
 static int
 virMACMapHashDumper(void *payload,
-                    const void *name,
+                    const char *name,
                     void *data)
 {
     virJSONValuePtr obj = virJSONValueNewObject();
index da7fd4625a0a5a3c58a29cd19ec88b717bf42c59..61935134af879f4d006eb050d5fcf0ecba7a0e62 100644 (file)
@@ -2732,7 +2732,7 @@ testQemuMonitorCPUInfo(const void *opaque)
 
 static int
 testBlockNodeNameDetectFormat(void *payload,
-                              const void *name,
+                              const char *name,
                               void *opaque)
 {
     qemuBlockNodeNameBackingChainDataPtr entry = payload;
index 839be556653e68bc613a7439faf78f22e0d83958..543a5f7f3fb56dddfdae49b1293f9dad18445038 100644 (file)
@@ -381,7 +381,7 @@ struct _checkOwnerData {
 
 static int
 checkOwner(void *payload,
-           const void *name,
+           const char *name,
            void *opaque)
 {
     checkOwnerData *data = opaque;
@@ -392,7 +392,7 @@ checkOwner(void *payload,
         !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;
     }
 
@@ -402,7 +402,7 @@ checkOwner(void *payload,
 
 static int
 printXATTR(void *payload,
-           const void *name,
+           const char *name,
            void *data)
 {
     bool *xattr_fail = data;
@@ -413,7 +413,7 @@ printXATTR(void *payload,
 
     /* 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;
 }
 
index 0ba5b9ed31d218bcf30904eb05976cf760d51cb4..ad50aae003433c161baafd6f4ca4e7ae50a50762 100644 (file)
@@ -46,7 +46,7 @@ testHashInit(void)
 
 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;
@@ -175,7 +175,7 @@ const int testHashCountRemoveForEachSome =
 
 static int
 testHashRemoveForEachSome(void *payload G_GNUC_UNUSED,
-                          const void *name,
+                          const char *name,
                           void *data)
 {
     virHashTablePtr hash = data;
@@ -198,7 +198,7 @@ const int testHashCountRemoveForEachAll = 0;
 
 static int
 testHashRemoveForEachAll(void *payload G_GNUC_UNUSED,
-                         const void *name,
+                         const char *name,
                          void *data)
 {
     virHashTablePtr hash = data;
@@ -266,7 +266,7 @@ testHashSteal(const void *data G_GNUC_UNUSED)
 
 static int
 testHashRemoveSetIter(const void *payload G_GNUC_UNUSED,
-                      const void *name,
+                      const char *name,
                       const void *data)
 {
     int *count = (int *) data;
@@ -326,7 +326,7 @@ const int testSearchIndex = G_N_ELEMENTS(uuids_subset) / 2;
 
 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);