1. 25 2月, 2011 2 次提交
    • D
      Allow hash tables to use generic pointers as keys · 16ba2aaf
      Daniel P. Berrange 提交于
      Relax the restriction that the hash table key must be a string
      by allowing an arbitrary hash code generator + comparison func
      to be provided
      
      * util/hash.c, util/hash.h: Allow any pointer as a key
      * internal.h: Include stdbool.h as standard.
      * conf/domain_conf.c, conf/domain_conf.c,
        conf/nwfilter_params.c, nwfilter/nwfilter_gentech_driver.c,
        nwfilter/nwfilter_gentech_driver.h, nwfilter/nwfilter_learnipaddr.c,
        qemu/qemu_command.c, qemu/qemu_driver.c,
        qemu/qemu_process.c, uml/uml_driver.c,
        xen/xm_internal.c: s/char */void */ in hash callbacks
      16ba2aaf
    • D
      Remove deallocator parameter from hash functions · 6952708c
      Daniel P. Berrange 提交于
      Since the deallocator is passed into the constructor of
      a hash table it is not desirable to pass it into each
      function again. Remove it from all functions, but provide
      a virHashSteal to allow a item to be removed from a hash
      table without deleteing it.
      
      * src/util/hash.c, src/util/hash.h: Remove deallocator
        param from all functions. Add virHashSteal
      * src/libvirt_private.syms: Add virHashSteal
      * src/conf/domain_conf.c, src/conf/nwfilter_params.c,
        src/nwfilter/nwfilter_learnipaddr.c,
        src/qemu/qemu_command.c, src/xen/xm_internal.c: Update
        for changed hash API
      6952708c
  2. 24 2月, 2011 1 次提交
  3. 21 2月, 2011 1 次提交
    • E
      hash: make virHashFree more free-like · 03ba07cb
      Eric Blake 提交于
      Two-argument free functions are uncommon; match the style elsewhere
      by caching the callback at creation.
      
      * src/util/hash.h (virHashCreate, virHashFree): Move deallocator
      argument to creation.
      * cfg.mk (useless_free_options): Add virHashFree.
      * src/util/hash.c (_virHashTable): Track deallocator.
      (virHashCreate, virHashFree): Update to new signature.
      * src/conf/domain_conf.c (virDomainObjListDeinit)
      (virDomainObjListInit, virDomainDiskDefForeachPath)
      (virDomainSnapshotObjListDeinit, virDomainSnapshotObjListInit):
      Update callers.
      * src/conf/nwfilter_params.c (virNWFilterHashTableFree)
      (virNWFilterHashTableCreate): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterTriggerVMFilterRebuild):
      Likewise.
      * src/cpu/cpu_generic.c (genericHashFeatures, genericBaseline):
      Likewise.
      * src/xen/xm_internal.c (xenXMOpen, xenXMClose): Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit)
      (virNWFilterLearnShutdown): Likewise.
      * src/qemu/qemu_command.c (qemuDomainPCIAddressSetCreate)
      (qemuDomainPCIAddressSetFree): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      03ba07cb
  4. 18 2月, 2011 3 次提交
    • C
      factor common code in virHashAddEntry and virHashUpdateEntry · 7f1c65e5
      Christophe Fergeau 提交于
      The only difference between these 2 functions is that one errors
      out when the entry is already present while the other modifies
      the existing entry. Add an helper function with a boolean argument
      indicating whether existing entries should be updated or not, and
      use this helper in both functions.
      7f1c65e5
    • C
      add hash table rebalancing in virHashUpdateEntry · 5c5880e0
      Christophe Fergeau 提交于
      The code in virHashUpdateEntry and virHashAddEntry is really
      similar. However, the latter rebalances the hash table when
      one of its buckets contains too many elements while the former
      does not. Fix this discrepancy.
      5c5880e0
    • E
      hash: modernize debug code · aebe04d7
      Eric Blake 提交于
      * src/util/hash.c (virHashGrow) [DEBUG_GROW]: Use modern logging.
      Reported by Christophe Fergeau.
      aebe04d7
  5. 15 2月, 2011 1 次提交
  6. 14 2月, 2011 1 次提交
  7. 01 2月, 2010 1 次提交
  8. 19 10月, 2009 1 次提交
    • D
      Remove bogus const annotations to hash iterator · cf577653
      Daniel P. Berrange 提交于
      Most of the hash iterators need to modify either payload of
      data args. The const annotation prevents this.
      
      * src/util/hash.h, src/util/hash.c: Remove const-ness from
        virHashForEach/Iterator
      * src/xen/xm_internal.c: Remove bogus casts
      cf577653
  9. 21 9月, 2009 2 次提交
    • D
      Move all shared utility files to src/util/ · 1355e055
      Daniel P. Berrange 提交于
      * src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
        src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
        src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
        src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
        src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
        src/qparams.h, src/stats_linux.c, src/stats_linux.h,
        src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
        src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
        src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
        src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
        into src/util/
      * daemon/Makefile.am: Add -Isrc/util/ to build flags
      * src/Makefile.am: Add -Isrc/util/ to build flags and update for
        moved files
      * src/libvirt_private.syms: Export cgroup APIs since they're now
        in util rather than linking directly to drivers
      * src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
        when built under PROXY
      * proxy/Makefile.am: Update for changed file locations. Remove
        bogus build of event.c
      * tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
      1355e055
    • D
      Move all XML configuration handling to src/conf/ · e0a48c99
      Daniel P. Berrange 提交于
      * src/capabilities.c, src/capabilities.h, src/domain_conf.c,
        src/domain_conf.h, src/domain_event.c, src/domain_event.h,
        src/interface_conf.c, src/interface_conf.h,
        src/network_conf.c, src/network_conf.h, src/node_device_conf.c,
        src/node_device_conf.h, src/secret_conf.c, src/secret_conf.h,
        src/storage_conf.c, src/storage_conf.h, src/storage_encryption_conf.c,
        src/storage_encryption_conf.h: Move to src/conf/
      * src/Makefile.am: Add -Isrc/conf to the individual build targets
        which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS
        and SELINUX_CFLAGS from global INCLUDES and only have them in build
        targets which actually need them.  Create a libvirt_conf.la
        convenience library for all config parsers
      * src/hostusb.h: Remove bogus include of domain_conf.h
      * tests/Makefile.am: Add -Isrc/conf. Remove bogus -I$builddir/src
        since it never has any generated header files
      * daemon/Makefile.am: Add -Isrc/conf
      * proxy/Makefile.am: Add -Isrc/conf and cope with renamed files
      * src/hash.c: Remove bogus include of libxml/threads.h
      e0a48c99
  10. 05 9月, 2009 1 次提交
  11. 11 8月, 2009 1 次提交
  12. 23 1月, 2009 1 次提交
    • J
      maint: update list of error function names and adapt · 6278bb19
      Jim Meyering 提交于
      * Makefile.maint (msg_gen_function): Update list.
      Remove some now-unused names, add some new ones.
      * src/hash.c (virHashError): Remove unused definition.
      * src/openvz_conf.h (openvzLog): Likewise.
      * src/xen_unified.c: Mark newly-exposed diagnostics for translation.
      6278bb19
  13. 05 11月, 2008 2 次提交
  14. 14 10月, 2008 1 次提交
    • J
      avoid many format string warnings · fd52c6ff
      Jim Meyering 提交于
      Building with --disable-nls exposed many new warnings like these:
      virsh.c:4952: warning: format not a string literal and no format ...
      util.c:163: warning: format not a string literal and no format arguments
      All but one of the following changes add a "%s" argument before
      the offending _(...) argument.
      
      This was the only manual change:
      * src/lxc_driver.c (lxcVersion): Use %s and strerror(errno)
      rather than %m, to avoid a warning from gcc -Wformat-security.
      
      Add "%s" before each warned about format-string-with-no-%-directive:
      * src/domain_conf.c (virDomainHostdevSubsysUsbDefParseXML)
      (virDomainDefParseString, virDomainDefParseFile):
      * src/hash.c (virGetConnect, __virGetDomain, virReleaseDomain)
      (__virGetNetwork, virReleaseNetwork, __virGetStoragePool)
      (virReleaseStoragePool, __virGetStorageVol, virReleaseStorageVol):
      * src/lxc_container.c (lxcContainerChild):
      * src/lxc_driver.c (lxcDomainDefine, lxcDomainUndefine)
      (lxcDomainGetInfo, lxcGetOSType, lxcDomainDumpXML)
      (lxcSetupInterfaces, lxcDomainStart, lxcDomainCreateAndStart)
      (lxcVersion, lxcGetSchedulerParameters):
      * src/network_conf.c (virNetworkDefParseString)
      (virNetworkDefParseFile):
      * src/openvz_conf.c (openvzReadNetworkConf, openvzLoadDomains):
      * src/openvz_driver.c (openvzDomainDefineCmd)
      (openvzDomainGetInfo, openvzDomainDumpXML, openvzDomainShutdown)
      (openvzDomainReboot, ADD_ARG_LIT, openvzDomainDefineXML)
      (openvzDomainCreateXML, openvzDomainCreate, openvzDomainUndefine)
      (openvzDomainSetAutostart, openvzDomainGetAutostart)
      (openvzDomainSetVcpus):
      * src/qemu_driver.c (qemudDomainBlockPeek, qemudDomainMemoryPeek):
      * src/remote_internal.c (remoteDomainBlockPeek)
      (remoteDomainMemoryPeek, remoteAuthPolkit):
      * src/sexpr.c (sexpr_new, _string2sexpr):
      * src/storage_backend_disk.c (virStorageBackendDiskMakeDataVol)
      (virStorageBackendDiskCreateVol):
      * src/storage_backend_fs.c
      (virStorageBackendFileSystemNetFindPoolSources):
      * src/storage_backend_logical.c (virStorageBackendLogicalFindLVs)
      (virStorageBackendLogicalFindPoolSources):
      * src/test.c (testOpenDefault, testOpenFromFile, testOpen)
      (testGetDomainInfo, testDomainRestore)
      (testNodeGetCellsFreeMemory):
      * src/util.c (virExec):
      * src/virsh.c (cmdAttachDevice, cmdDetachDevice)
      (cmdAttachInterface, cmdDetachInterface, cmdAttachDisk)
      (cmdDetachDisk, cmdEdit):
      * src/xend_internal.c (do_connect, wr_sync, xend_op_ext)
      (urlencode, xenDaemonDomainCreateXML)
      (xenDaemonDomainLookupByName_ids, xenDaemonDomainLookupByID)
      (xenDaemonParseSxprOS, xend_parse_sexp_desc_char)
      (xenDaemonParseSxprChar, xenDaemonParseSxprDisks)
      (xenDaemonParseSxpr, sexpr_to_xend_topology, sexpr_to_domain)
      (xenDaemonDomainFetch, xenDaemonDomainGetAutostart)
      (xenDaemonDomainSetAutostart, xenDaemonDomainMigratePerform)
      (xenDaemonDomainDefineXML, xenDaemonGetSchedulerType)
      (xenDaemonGetSchedulerParameters)
      (xenDaemonSetSchedulerParameters, xenDaemonDomainBlockPeek)
      (xenDaemonFormatSxprChr, virDomainXMLDevID):
      * src/xm_internal.c (xenXMConfigCacheRefresh, xenXMDomainPinVcpu)
      (xenXMDomainCreate, xenXMDomainDefineXML)
      (xenXMDomainAttachDevice, xenXMDomainDetachDevice):
      * src/xml.c (virXPathString, virXPathNumber, virXPathLong)
      (virXPathULong, virXPathBoolean, virXPathNode, virXPathNodeSet):
      * src/xs_internal.c (xenStoreOpen):
      fd52c6ff
  15. 09 10月, 2008 1 次提交
  16. 07 10月, 2008 1 次提交
  17. 22 5月, 2008 1 次提交
  18. 15 5月, 2008 1 次提交
  19. 29 4月, 2008 2 次提交
  20. 18 4月, 2008 1 次提交
    • R
      Fixes for MinGW. · 8df91acf
      Richard W.M. Jones 提交于
      	* configure.in: Fix pkg-config detection of libxml2,
      	  add -lgcrypt to gnutls lib.
      	* src/Makefile.am: If compiling --without-libvirtd then
      	  don't compile any part of the storage driver.
      	* configure.in, src/hash.c, src/internal.h: Detect availability
      	  of pthread library and compile out mutex code if not available.
      	* src/storage_driver.c, src/util.c: Ignore some missing
      	  headers on MinGW.
      8df91acf
  21. 11 4月, 2008 1 次提交
  22. 04 4月, 2008 1 次提交
    • D
      typos fixes · a528e973
      Daniel Veillard 提交于
      * docs//* src/conf.c src/hash.c src/libvirt.c src/proxy_internal.c
       src/remote_internal.c src/virsh.c src/xen_internal.c
       src/xend_internal.c src/xml.c: applied patch from Atsushi SAKAI
       fixing a lot of typos
      Daniel
      a528e973
  23. 31 3月, 2008 1 次提交
  24. 20 2月, 2008 1 次提交
  25. 08 2月, 2008 1 次提交
    • D
      virHashRemoveSet bugfixes · e9b3bc77
      Daniel Veillard 提交于
      * src/hash.c: fix a couple of problems in virHashRemoveSet based
        on Hiroyuki Kaguchi patch and explanations.
      Daniel
      e9b3bc77
  26. 06 2月, 2008 1 次提交
  27. 31 1月, 2008 1 次提交
  28. 30 1月, 2008 2 次提交
    • J
      Enable the <config.h>-requiring test; fix violations · a3781881
      Jim Meyering 提交于
      Use <config.h>, not "config.h", per autoconf documentation.
      * Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable.
      * .x-sc_require_config_h: New file, to list exempted files.
      * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
      a3781881
    • J
      Given code like if (foo) free (foo); remove the useless "if (foo) " part. · acff2d11
      Jim Meyering 提交于
      Likewise, given if (foo != NULL) free (foo); remove the useless "if" test.
      
      * proxy/libvirt_proxy.c: Remove unnecessary "if" test before free.
      * python/generator.py: Likewise.
      * qemud/qemud.c: Likewise.
      * src/buf.c: Likewise.
      * src/conf.c: Likewise.
      * src/hash.c: Likewise.
      * src/iptables.c: Likewise.
      * src/libvirt.c: Likewise.
      * src/openvz_conf.c: Likewise.
      * src/qemu_conf.c: Likewise.
      * src/qemu_driver.c: Likewise.
      * src/remote_internal.c: Likewise.
      * src/test.c: Likewise.
      * src/virsh.c: Likewise.
      * src/virterror.c: Likewise.
      * src/xen_internal.c: Likewise.
      * src/xen_unified.c: Likewise.
      * src/xend_internal.c: Likewise.
      * src/xm_internal.c: Likewise.
      * src/xml.c: Likewise.
      * src/xmlrpc.c: Likewise.
      * src/xs_internal.c: Likewise.
      * tests/testutils.c: Likewise.
      * tests/xencapstest.c: Likewise.
      * tests/xmconfigtest.c: Likewise.
      acff2d11
  29. 22 1月, 2008 1 次提交
  30. 12 12月, 2007 1 次提交
    • J
      Use a variable name as sizeof argument, not a type name. · 49230350
      Jim Meyering 提交于
      Given code like: T *var = calloc (n, sizeof (T));
      Convert to this: T *var = calloc (n, sizeof (*var));
      This first-cut change adjusts all malloc, calloc, and
      realloc statements.
      
      The only binary differences are in remote_internal.c
      (due to the bug fix) and in xmlrpc.c (due to factorization).
      
      * python/libvir.c: As above.
      * qemud/event.c: Likewise.
      * qemud/mdns.c: Likewise.
      * qemud/qemud.c: Likewise.
      * qemud/remote.c: Likewise.
      * src/bridge.c: Likewise.
      * src/buf.c: Likewise.
      * src/conf.c: Likewise.
      * src/hash.c: Likewise.
      * src/iptables.c: Likewise.
      * src/openvz_conf.c: Likewise.
      * src/qemu_conf.c: Likewise.
      * src/qemu_driver.c: Likewise.
      * src/test.c: Likewise.
      * src/xen_internal.c: Likewise.
      * src/xen_unified.c: Likewise.
      * src/xm_internal.c: Likewise.
      * src/xml.c: Likewise.
      * tests/qemuxml2argvtest.c: Likewise.
      * src/xmlrpc.c (xmlRpcValuePtr): Likewise, and minor factorization.
      * src/remote_internal.c (remoteAuthMakeCredentials): Use the right
      type when allocating space for an array of cred _pointers_.
      49230350
  31. 06 12月, 2007 1 次提交
    • J
      Include "config.h". · 87396257
      Jim Meyering 提交于
      * qemud/event.c: Likewise.
      * src/buf.c: Likewise.
      * src/hash.c: Likewise.
      * src/nodeinfo.c: Likewise.
      * src/openvz_conf.c: Likewise.
      * src/proxy_internal.c: Likewise.
      * src/virterror.c: Likewise.
      * src/xmlrpc.c: Likewise.
      * src/xs_internal.c: Likewise.
      * tests/conftest.c: Likewise.
      * tests/xmlrpctest.c: Likewise.
      This fixes a mingw build failure reported by Rich Jones.
      
      Author: Jim Meyering <meyering@redhat.com>
      87396257
  32. 01 12月, 2007 1 次提交
  33. 06 7月, 2007 1 次提交
    • R
      Fri Jul 6 16:00:00 BST 2007 Richard W.M. Jones <rjones@redhat.com> · 16eae80e
      Richard W.M. Jones 提交于
      	* src/hash.c, src/internal.h: Remove virGetDomainByID function
      	  as it is not used or exported.
      	* src/proxy_internal.c, src/qemu_driver.c, src/remote_internal.c,
      	  src/test.c, src/xend_internal.c, src/xs_internal.c: Fix
      	  all callers to virGetDomain and virGetNetwork functions -
      	  the callers do not need to set virterror since it is already
      	  set inside the functions.
      16eae80e