1. 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
  2. 18 2月, 2011 1 次提交
  3. 12 2月, 2011 1 次提交
  4. 10 2月, 2011 1 次提交
    • E
      maint: whitespace cleanup · 1652fa2f
      Eric Blake 提交于
      * .dir-locals.el (html-mode): Let emacs help out.
      * cfg.mk (sc_TAB_in_indentation): Check more files.
      * docs/internals/command.html.in: Fix offenders.
      * docs/formatdomain.html.in: Likewise.
      * docs/internals.html.in: Likewise.
      Reported by Jiri Denemark.
      1652fa2f
  5. 04 2月, 2011 1 次提交
    • E
      smartcard: add domain conf support · c1be1a2e
      Eric Blake 提交于
      * src/conf/domain_conf.h (virDomainSmartcardType): New enum.
      (virDomainSmartcardDef, virDomainDeviceCcidAddress): New structs.
      (virDomainDef): Include smartcards.
      (virDomainSmartcardDefIterator): New typedef.
      (virDomainSmartcardDefFree, virDomainSmartcardDefForeach): New
      prototypes.
      (virDomainControllerType, virDomainDeviceAddressType): Add ccid
      enum values.
      (virDomainDeviceInfo): Add ccid address type.
      * src/conf/domain_conf.c (virDomainSmartcard): Convert between
      enum and string.
      (virDomainSmartcardDefParseXML, virDomainSmartcardDefFormat)
      (virDomainSmartcardDefFree, virDomainDeviceCcidAddressParseXML)
      (virDomainDefMaybeAddSmartcardController): New functions.
      (virDomainDefParseXML): Parse the new XML.
      (virDomainDefFormat): Convert back to XML.
      (virDomainDefFree): Clean up.
      (virDomainDeviceInfoIterate): Iterate over passthrough aliases.
      (virDomainController, virDomainDeviceAddress)
      (virDomainDeviceInfoParseXML, virDomainDeviceInfoFormat)
      (virDomainDefAddImplicitControllers): Support new values.
      * src/libvirt_private.syms (domain_conf.h): New exports.
      * cfg.mk (useless_free_options): List new function.
      c1be1a2e
  6. 30 1月, 2011 1 次提交
    • E
      maint: reject raw close, popen in 'make syntax-check' · 030ce43b
      Eric Blake 提交于
      commit f1fe9671 was supposed to make sure we use files.h
      macros to avoid double close, but it didn't work.
      
      Meanwhile, virCommand is vastly superior to system(), fork(),
      and popen() (also to virExec, but we haven't completed that
      conversion), so enforce that, too.
      
      * cfg.mk (sc_prohibit_close): Fix typo that excluded close, and
      add pclose.
      (sc_prohibit_fork_wrappers): New rule, for fork, system, and popen.
      * .x-sc_prohibit_close: More exemptions.
      * .x-sc_prohibit_fork_wrappers: New file.
      * Makefile.am (syntax_check_exceptions): Ship new file.
      * src/datatypes.c (virReleaseConnect): Tweak comment to avoid
      false positive.
      * src/util/files.h (VIR_CLOSE): Likewise.
      030ce43b
  7. 28 1月, 2011 1 次提交
    • E
      qemu: fix error messages · b96b6f47
      Eric Blake 提交于
      Regression in commit caa805ea let a lot of bad messages slip in.
      
      * cfg.mk (msg_gen_function): Fix function name.
      * src/qemu/qemu_cgroup.c (qemuRemoveCgroup): Fix fallout from
      'make syntax-check'.
      * src/qemu/qemu_driver.c (qemudDomainGetInfo)
      (qemuDomainWaitForMigrationComplete, qemudStartVMDaemon)
      (qemudDomainSaveFlag, qemudDomainAttachDevice)
      (qemuDomainUpdateDeviceFlags): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
      (qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
      Likewise.
      b96b6f47
  8. 19 1月, 2011 1 次提交
    • M
      Simplify "NWFilterPool" to "NWFilter" · 2c0db5b5
      Matthias Bolte 提交于
      The public object is called NWFilter but the corresponding private
      object is called NWFilterPool. I don't see compelling reasons for this
      Pool suffix. One might argue that an NWFilter is a "pool" of rules, etc.
      
      Remove the Pool suffix from NWFilterPool. No functional change included.
      2c0db5b5
  9. 15 1月, 2011 2 次提交
    • E
      maint: improve sc_prohibit_strncmp syntax check · 63dbc84a
      Eric Blake 提交于
      * .gnulib: Update, for sc_prohibit_strcmp fix.
      * cfg.mk: Adjust copyright; the only FSF portions come from when
      this file was copied from coreutils.
      (sc_prohibit_strncmp): Copy bug-fixes from sc_prohibit_strcmp.
      * .x-sc_prohibit_strcmp: Delete, now that rule is smarter.
      * .x-sc_prohibit_strncmp: Likewise.
      * Makefile.am (syntax_check_exceptions): Track deletion.
      63dbc84a
    • E
      domain_conf: split source data out from ChrDef · 98334e7c
      Eric Blake 提交于
      This opens up the possibility of reusing the smaller ChrSourceDef
      for both qemu monitor and a passthrough smartcard device.
      
      * src/conf/domain_conf.h (_virDomainChrDef): Factor host
      details...
      (_virDomainChrSourceDef): ...into new struct.
      (virDomainChrSourceDefFree): New prototype.
      * src/conf/domain_conf.c (virDomainChrDefFree)
      (virDomainChrDefParseXML, virDomainChrDefFormat): Split...
      (virDomainChrSourceDefClear, virDomainChrSourceDefFree)
      (virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
      ...into new functions.
      (virDomainChrDefParseTargetXML): Update clients to reflect type
      split.
      * src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
      (virVMXFormatSerial, virVMXFormatParallel): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
      * src/xen/xend_internal.c (xenDaemonParseSxprChar)
      (xenDaemonFormatSxprChr): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
      (vboxAttachParallel): Likewise.
      * src/security/security_dac.c (virSecurityDACSetChardevLabel)
      (virSecurityDACSetChardevCallback)
      (virSecurityDACRestoreChardevLabel)
      (virSecurityDACRestoreChardevCallback): Likewise.
      * src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback)
      (SELinuxRestoreSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback): Likewise.
      * src/security/virt-aa-helper.c (get_files): Likewise.
      * src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
      Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
      * src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
      (umlDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.c (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr, qemuBuildCommandLine)
      (qemuParseCommandLineChr): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
      (qemuDomainObjPrivateXMLParse): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
      (qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
      (qemuPrepareMonitorChr, qemudShutdownVMDaemon)
      (qemuDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.h (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr): Delete, now that they are static.
      * src/libvirt_private.syms (domain_conf.h): New exports.
      * cfg.mk (useless_free_options): Update list.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
      tests.
      98334e7c
  10. 18 12月, 2010 1 次提交
  11. 10 12月, 2010 1 次提交
    • H
      threadpool impl · 482380b5
      Hu Tao 提交于
      * src/util/threadpool.c, src/util/threadpool.h: Thread pool
        implementation
      * src/Makefile.am: Build thread pool
      * src/libvirt_private.syms: Export public functions
      482380b5
  12. 03 12月, 2010 2 次提交
    • D
      Introduce new APIs for spawning processes · f16ad06f
      Daniel P. Berrange 提交于
      This introduces a new set of APIs in src/util/command.h
      to use for invoking commands. This is intended to replace
      all current usage of virRun and virExec variants, with a
      more flexible and less error prone API.
      
      * src/util/command.c: New file.
      * src/util/command.h: New header.
      * src/Makefile.am (UTIL_SOURCES): Build it.
      * src/libvirt_private.syms: Export symbols internally.
      * tests/commandtest.c: New test.
      * tests/Makefile.am (check_PROGRAMS): Run it.
      * tests/commandhelper.c: Auxiliary program.
      * tests/commanddata/test2.log - test15.log: New expected outputs.
      * cfg.mk (useless_free_options): Add virCommandFree.
      (msg_gen_function): Add virCommandError.
      * po/POTFILES.in: New translation.
      * .x-sc_avoid_write: Add exemption.
      * tests/.gitignore: Ignore new built file.
      f16ad06f
    • E
      util: add virVasprintf · fce3baee
      Eric Blake 提交于
      * src/util/util.h (virVasprintf): New declaration.
      * src/util/util.c (virVasprintf): New function.
      (virAsprintf): Use it.
      * src/util/virtaudit.c (virAuditSend): Likewise.
      * src/libvirt_private.syms: Export it.
      * cfg.mk (sc_prohibit_asprintf): Also prohibit vasprintf.
      * .x-sc_prohibit_asprintf: Add exemption.
      fce3baee
  13. 01 12月, 2010 1 次提交
  14. 25 11月, 2010 3 次提交
    • E
      maint: prohibit most uses of xmlGetProp · 416c09bc
      Eric Blake 提交于
      Making this change makes it easier to spot the memory leaks
      that will be fixed in the next patch.
      
      * cfg.mk (sc_prohibit_xmlGetProp): New rule.
      * .x-sc_prohibit_xmlGetProp: New exception.
      * Makefile.am (EXTRA_DIST): Ship exception file.
      * tools/virsh.c (cmdDetachInterface, cmdDetachDisk): Adjust
      offenders.
      * src/conf/storage_conf.c (virStoragePoolDefParseSource):
      Likewise.
      * src/conf/network_conf.c (virNetworkDHCPRangeDefParseXML)
      (virNetworkIPParseXML): Likewise.
      416c09bc
    • E
      maint: ensure syntax check exceptions are distributed · 97cde147
      Eric Blake 提交于
      * Makefile.am (EXTRA_DIST): Factor exceptions files...
      (syntax_check_excpetions): into new list.  Include recently added
      exceptions.
      * cfg.mk (sc_x_sc_dist_check): New check, copied from coreutils.
      97cde147
    • E
      build: enforce files.h usage · f1fe9671
      Eric Blake 提交于
      * cfg.mk (sc_prohibit_close): New syntax-check rule.
      * src/util/pci.c (pciWaitForDeviceCleanup): Fix violation.
      * .x-sc_prohibit_close: New exceptions.
      * Makefile.am (EXTRA_DIST): Distribute new file.
      f1fe9671
  15. 19 11月, 2010 1 次提交
    • E
      maint: tighten strncmp syntax check · d2af8ffc
      Eric Blake 提交于
      Using 'int ret = strcmp(a, b)' in a qsort function is a valid use of
      str[n]cmp that should _not_ be turned to STREQ, but it was falling
      foul of our specific syntax-check.  Meanwhile, gnulib's maint.mk
      already has a tighter bound for strcmp, so we can copy that regex and
      just check for strncmp, which results in fewer false positives that
      require exceptions.
      
      * cfg.mk (sc_prohibit_strcmp_and_strncmp): Rename...
      (sc_prohibit_strncmp): ...to this, and tighten, to mirror
      maint.mk's sc_prohibit_strcmp's better regex.
      * Makefile.am (syntax_check_exceptions): Update exception rule.
      * .x-sc_prohibit_strcmp_and_strncmp: Rename...
      * .x-sc_prohibit_strncmp: ...and trim.
      d2af8ffc
  16. 18 11月, 2010 2 次提交
    • E
      maint: avoid remaining sprintf uses · e8aba782
      Eric Blake 提交于
      * cfg.mk (sc_prohibit_sprintf): New rule.
      (sc_prohibit_asprintf): Avoid false positives.
      * docs/hacking.html.in (Printf-style functions): Document the
      policy.
      * HACKING: Regenerate.
      * .x-sc_prohibit_sprintf: New exemptions.
      * Makefile.am (syntax_check_exceptions): Ship new file.
      * src/vbox/vbox_tmpl.c (vboxStartMachine, vboxAttachUSB): Use
      virAsprintf instead.
      * src/uml/uml_driver.c (umlOpenMonitor): Use snprintf instead.
      * tools/virsh.c (cmdDetachInterface): Likewise.
      * src/security/security_selinux.c (SELinuxGenSecurityLabel):
      Likewise.
      * src/openvz/openvz_driver.c (openvzDomainDefineCmd): Likewise,
      and ensure large enough buffer.
      e8aba782
    • E
      virt-aa-helper: translate error messages · c811d46f
      Eric Blake 提交于
      These messages are visible to the user, so they should be
      consistently translated.
      
      * cfg.mk (msg_gen_function): Add vah_error, vah_warning.
      * src/security/virt-aa-helper.c: Translate messages.
      (catchXMLError): Fix capitalization.
      c811d46f
  17. 13 11月, 2010 1 次提交
  18. 09 11月, 2010 1 次提交
  19. 27 10月, 2010 1 次提交
    • E
      maint: fix syntax-check failure of previous patch · 1987b090
      Eric Blake 提交于
      * cfg.mk (sc_prohibit_trailing_blank_lines): Delete; this is
      adequately covered by maint.mk's sc_prohibit_empty_lines_at_EOF.
      * .x-sc_prohibit_empty_lines_at_EOF: New file, to exempt raw
      patches.
      * Makefile.am (EXTRA_DIST): Include new exemption.
      1987b090
  20. 11 8月, 2010 1 次提交
  21. 05 8月, 2010 1 次提交
    • E
      build: rerun bootstrap if po/Makevars got nuked · 5f211d4b
      Eric Blake 提交于
      There has been a frequent complaint of:
      
      make[2]: Entering directory `/home/remote/eblake/libvirt/po'
      make[2]: *** No rule to make target `/config.status', needed by `Makefile'.  Stop.
      
      It happens after nuking and regenerating the po directory,
      which is a common action after running anything like
      'make dist' or 'make rpm' that dirties all the .po files.
      
      Teach autogen.sh that it must regenerate po/Makevars to avoid
      the missing variable declaration, and teach cfg.mk to recognize
      that a nuked po directory is cause to rerun autogen.sh.
      
      * cfg.mk (_update_required): Check for po/Makevars.
      * autogen.sh (bootstrap): Run bootstrap if it got lost.
      Diagnosed by Justin Clift.
      5f211d4b
  22. 24 7月, 2010 1 次提交
    • C
      Qemu remote protocol. · 337d201e
      Chris Lalancette 提交于
      Since we are adding a new "per-hypervisor" protocol, we
      make it so that the qemu remote protocol uses a new
      PROTOCOL and PROGRAM number.  This allows us to easily
      distinguish it from the normal REMOTE protocol.
      
      This necessitates changing the proc in remote_message_header
      from a "remote_procedure" to an "unsigned", which should
      be the same size (and thus preserve the on-wire protocol).
      
      Changes since v1:
       - Fixed up a couple of script problems in remote_generate_stubs.pl
       - Switch an int flag to a bool in dispatch.c
      
      Changes since v2:
       - None
      
      Changes since v3:
       - Change unsigned proc to signed proc, to conform to spec
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      337d201e
  23. 02 6月, 2010 1 次提交
  24. 28 5月, 2010 1 次提交
  25. 22 5月, 2010 1 次提交
    • J
      Add simple bitmap operations to utils · 2f32d7af
      Jim Fehlig 提交于
      V2:
        - Move bitmap impl to src/util/bitmap.[ch]
        - Use CHAR_BIT instead of explicit '8'
        - Use size_t instead of unsigned int
        - Fix calculation of bitmap size in virBitmapAlloc
        - Ensure bit is within range of map in the set, clear, and get
          operations
        - Use bool in virBitmapGetBit
        - Add virBitmapFree to free-like funcs in cfg.mk
      
      V3:
        - Check for overflow in virBitmapAlloc
        - Fix copy and paste bug in virBitmapAlloc
        - Use size_t in prototypes
        - Add ATTRIBUTE_NONNULL in prototypes where appropriate
          and remove NULL check from impl
      
      V4:
        - Add ATTRIBUTE_RETURN_CHECK in prototypes where appropriate.
      2f32d7af
  26. 21 5月, 2010 2 次提交
  27. 20 5月, 2010 1 次提交
  28. 19 5月, 2010 1 次提交
    • J
      maint: enforce no-markup policy wrt VIR_WARN-like macros · 052893cf
      Jim Meyering 提交于
      * cfg.mk (sc_prohibit_gettext_markup): New rule, to enforce
      this policy.  Contrary to most diagnostic-emitting functions,
      where we require _(...) markup, here, we require that _() *not*
      be used for certain functions (or function-like macros).
      052893cf
  29. 18 5月, 2010 2 次提交
    • J
      maint: add more free-like functions to the list and deal with fallout · a986892e
      Jim Meyering 提交于
      * cfg.mk (useless_free_options): Add many vir*Free* function names,
      and then remove the useless if-before-free tests exposed by running
      make syntax-check.
      * src/conf/interface_conf.c (virInterfaceDefFree): Remove useless "if".
      (virInterfaceAssignDef): Likewise.
      * src/conf/network_conf.c (virNetworkAssignDef): Likewise.
      * src/conf/storage_conf.c (virStoragePoolObjAssignDef): Likewise.
      * src/node_device/node_device_hal.c (dev_create): Likewise.
      * src/security/virt-aa-helper.c (vahDeinit): Likewise.
      * src/test/test_driver.c (testNodeDeviceCreateXML): Likewise.
      * src/util/conf.c (virConfSetValue): Likewise.
      a986892e
    • J
      maint: add virCgroupFree to the list of free-like functions · 933522a3
      Jim Meyering 提交于
      This makes the useless-if-before-free test in maint.mk spot
      uses of virCgroupFree just like it does for free and the other
      listed functions.
      * cfg.mk (useless_free_options): Add virCgroupFree.
      Prompted by suggestion from Eric Blake.
      933522a3
  30. 11 5月, 2010 1 次提交
    • E
      maint: avoid spurious output if program not present · 7cdf2663
      Eric Blake 提交于
      Some shells warn about missing programs before redirection;
      the idiomatic way to silence them is to run the program check
      inside a subshell, with the redirections outside the subshell.
      But a subshell is only needed in places where it is reasonable
      to expect the use of such a noisy shell in the first place.
      
      * src/Makefile.am (remote_protocol-structs): Use subshell, for
      FreeBSD 8.0 /bin/sh.
      * cfg.mk (sc_preprocessor_indentation): Avoid subshell, since the
      only users running cfg.mk can be assumed to have decent tools.
      7cdf2663
  31. 28 4月, 2010 1 次提交
  32. 22 4月, 2010 2 次提交
    • E
      maint: enforce whitespace on shell scripts · 1f7560e2
      Eric Blake 提交于
      Noticed because virt-pki-validate was very inconsistent on
      using tabs vs. 8 spaces, sometimes mixing both paradigms on
      a single line.
      
      'git diff -b' shows significant changes only in cfg.mk.
      
      * cfg.mk (sc_TAB_in_indentation): Add a few files.
      * daemon/libvirtd.init.in: Avoid tabs.
      * tools/virt-pki-validate.in: Likewise.
      1f7560e2
    • E
      maint: ignore 'make syntax-check' failure files · 871aa6e3
      Eric Blake 提交于
      * .gitignore: Add exemption.
      * cfg.mk (local-checks-to-skip): Ignore a test to silence a skip
      warning.
      871aa6e3