1. 20 7月, 2012 2 次提交
  2. 19 7月, 2012 12 次提交
  3. 18 7月, 2012 2 次提交
  4. 11 7月, 2012 1 次提交
    • E
      build: detect all improper uses of _("%s") · 0867a877
      Eric Blake 提交于
      The only useful translation of "%s" as a format string is "%s" (I
      suppose you could claim "%1$s" is also valid, but why bother).  So
      it is not worth translating; fixing this exposes some instances
      where we were failing to translate real error messages.  This makes
      the fix of commit 097da1ab more generic, as well as ensuring no
      future regressions.
      
      * cfg.mk (sc_prohibit_useless_translation): New rule.
      * src/lxc/lxc_driver.c (lxcSetVcpuBWLive): Fix offender.
      * src/openvz/openvz_conf.c (openvzReadFSConf): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupCgroupForVcpu): Likewise.
      * src/qemu/qemu_driver.c (qemuSetVcpusBWLive): Likewise.
      * src/xenapi/xenapi_utils.c (xenapiSessionErrorHandle): Likewise.
      0867a877
  5. 04 6月, 2012 1 次提交
    • E
      build: fix sc_prohibit_readlink · 85815b6a
      Eric Blake 提交于
      I noticed this during 'make syntax-check':
      
      prohibit_readlink
      grep: Unmatched ( or \(
      
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_readlink): Fix
      mismatched '('.
      85815b6a
  6. 02 6月, 2012 1 次提交
    • M
      virsh: Switch from generated cmd*Edit commands to nongenerated · 0766783a
      Michal Privoznik 提交于
      Currently, we either generate some cmd*Edit commands (cmdPoolEdit
      and cmdNetworkEdit) via sed script or copy the body of cmdEdit
      (e.g. cmdInterfaceEdit, cmdNWFilterEdit, etc.). This fact makes
      it harder to implement any new feature to our editing system.
      Therefore switch to new implementation - define macros to:
      - dump XML (EDIT_GET_XML)
      - take an action if XML wasn't changed,
        usually just vshPrint() (EDIT_NOT_CHANGED)
      - define new object (EDIT_DEFINE) - the edited XML is in @doc_edited
      - free object defined by EDIT_DEFINE (EDIT_FREE)
      and #include "virsh-edit.c"
      0766783a
  7. 29 5月, 2012 2 次提交
    • E
      virsh: avoid strncpy · dc4301c7
      Eric Blake 提交于
      strncpy is generally evil - it runs the risk of missing NUL
      termination, and more often than not wastes time zeroing way
      more bytes than strictly necessary.  We've avoided this evil
      in our virStrncpy wrapper, except for places where we forgot
      to use the wrapper; meanwhile, we have also added an even
      higher layer wrapper for setting virTypedParameter values.
      
      * tools/virsh.c (cmdMemtune, cmdBlkdeviotune): Use modern API.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_strncpy): Tighten.
      dc4301c7
    • E
      build: update to latest gnulib · e925ea31
      Eric Blake 提交于
      Gnulib finally relaxed the isatty license, needed as first mentioned here:
      https://www.redhat.com/archives/libvir-list/2012-February/msg01022.html
      
      Other improvements include better syntax-check rules (we can delete one
      of ours now that it is a duplicate) and better compiler warning usage.
      
      * .gnulib: Update to latest, for isatty.
      * cfg.mk (sc_prohibit_strncpy): Drop a now-redundant rule.
      * bootstrap.conf (gnulib_modules): Add isatty.
      * bootstrap: Resync from gnulib.
      e925ea31
  8. 28 5月, 2012 1 次提交
  9. 16 5月, 2012 2 次提交
    • E
      build: fix recent syntax-check breakage · 3337ba6d
      Eric Blake 提交于
      The use of readlink() in lxc_container.c is intentional; we don't
      want an absolute pathname there.
      
      * src/util/cgroup.h (VIR_CGROUP_SYSFS_MOUNT): Indent properly.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_readlink): Add
      exemption.
      3337ba6d
    • J
      qemu: Add support for -no-user-config · 63b42436
      Jiri Denemark 提交于
      Thanks to this new option we are now able to use modern CPU models (such
      as Westmere) defined in external configuration file.
      
      The qemu-1.1{,-device} data files for qemuhelptest are filled in with
      qemu-1.1-rc2 output for now. I will update those files with real
      qemu-1.1 output once it is released.
      63b42436
  10. 15 5月, 2012 1 次提交
    • E
      nodeinfo: add some more tests · 891a7f9e
      Eric Blake 提交于
      Test 2 data grabbed from a 2-core 1-node laptop.
      Test 3 data grabbed from a 48-cpu AMD Magny Cours box.
      
      * tests/nodeinfodata/linux-nodeinfo-sysfs-test-2*: New test data.
      * tests/nodeinfodata/linux-nodeinfo-sysfs-test-3*: Likewise.
      * tests/nodeinfotest.c (mymain): Run them.
      * cfg.mk
      (exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF): Exempt
      new test files.
      891a7f9e
  11. 01 5月, 2012 1 次提交
  12. 20 4月, 2012 1 次提交
    • E
      build: avoid strtol and strtod · ae27f341
      Eric Blake 提交于
      Ensure we don't introduce any more lousy integer parsing in new
      code, while avoiding a scrub-down of existing legacy code.
      
      Note that we also need to enable sc_prohibit_atoi_atof (see cfg.mk
      local-checks-to-skip) before we are bulletproof, but that also
      entails scrubbing I'm not ready to do at the moment.
      
      * src/util/util.c (virStrToLong_i, virStrToLong_ui)
      (virStrToLong_l, virStrToLong_ul, virStrToLong_ll)
      (virStrToLong_ull, virStrToDouble): Mark exemptions.
      * src/util/virmacaddr.c (virMacAddrParse): Likewise.
      * cfg.mk (sc_prohibit_strtol): New syntax check.
      (exclude_file_name_regexp--sc_prohibit_strtol): Ignore files that
      I'm not willing to fix yet.
      (local-checks-to-skip): Re-enable sc_prohibit_atoi_atof.
      ae27f341
  13. 31 3月, 2012 1 次提交
    • E
      build: fix mingw ssize_t, syntax check · 1012dc29
      Eric Blake 提交于
      We are so close to a release that we don't want to pull in a
      gnulib submodule update and risk regressions, since there has
      been a lot of other gnulib churn upstream.  However, there are
      a couple of gnulib issues that are worth fixing in isolation,
      by applying local patches to gnulib.
      
      There was an upstream gnulib bug in maint.mk that rendered most
      of our syntax checks ineffective (and fixing it flushed out a
      minor bug in our code):
      https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00194.html
      
      There is still an upstream bug where gnulib uses the wrong type
      for ssize_t on mingw; we need the fix now even though it has not
      yet been accepted into gnulib:
      https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00188.html
      
      * gnulib/local/top/maint.mk.diff: Pick up upstream gnulib
      maint.mk.
      * gnulib/local/m4/ssize_t.m4.diff: Work around gnulib bug.
      * src/libvirt.c: Remove unused header.
      * cfg.mk
      (exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF): Exempt
      gnulib local files.
      1012dc29
  14. 30 3月, 2012 2 次提交
  15. 27 3月, 2012 1 次提交
    • M
      Added syntax-check rule for return with parentheses · f0944525
      Martin Kletzander 提交于
      After cleanup introduced with previous commit, there is a need for
      syntax-check rule taking care of return(). Regexp used in 'prohibit'
      parameter is taken from the cleanup commit and modified so it fits
      'grep -E' format. Semicolon at the end is needed, otherwise the regexp
      could match return with cast.
      
      Exception is created for python source files because we don't have any
      documentation restricting the use of return that matches this case.
      f0944525
  16. 02 3月, 2012 2 次提交
    • E
      build: use correct type for pid and similar types · 3e2c3d8f
      Eric Blake 提交于
      No thanks to 64-bit windows, with 64-bit pid_t, we have to avoid
      constructs like 'int pid'.  Our API in libvirt-qemu cannot be
      changed without breaking ABI; but then again, libvirt-qemu can
      only be used on systems that support UNIX sockets, which rules
      out Windows (even if qemu could be compiled there) - so for all
      points on the call chain that interact with this API decision,
      we require a different variable name to make it clear that we
      audited the use for safety.
      
      Adding a syntax-check rule only solves half the battle; anywhere
      that uses printf on a pid_t still needs to be converted, but that
      will be a separate patch.
      
      * cfg.mk (sc_correct_id_types): New syntax check.
      * src/libvirt-qemu.c (virDomainQemuAttach): Document why we didn't
      use pid_t for pid, and validate for overflow.
      * include/libvirt/libvirt-qemu.h (virDomainQemuAttach): Tweak name
      for syntax check.
      * src/vmware/vmware_conf.c (vmwareExtractPid): Likewise.
      * src/driver.h (virDrvDomainQemuAttach): Likewise.
      * tools/virsh.c (cmdQemuAttach): Likewise.
      * src/remote/qemu_protocol.x (qemu_domain_attach_args): Likewise.
      * src/qemu_protocol-structs (qemu_domain_attach_args): Likewise.
      * src/util/cgroup.c (virCgroupPidCode, virCgroupKillInternal):
      Likewise.
      * src/qemu/qemu_command.c(qemuParseProcFileStrings): Likewise.
      (qemuParseCommandLinePid): Use pid_t for pid.
      * daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
      * src/conf/domain_conf.h (_virDomainObj): Likewise.
      * src/probes.d (rpc_socket_new): Likewise.
      * src/qemu/qemu_command.h (qemuParseCommandLinePid): Likewise.
      * src/qemu/qemu_driver.c (qemudGetProcessInfo, qemuDomainAttach):
      Likewise.
      * src/qemu/qemu_process.c (qemuProcessAttach): Likewise.
      * src/qemu/qemu_process.h (qemuProcessAttach): Likewise.
      * src/uml/uml_driver.c (umlGetProcessInfo): Likewise.
      * src/util/virnetdev.h (virNetDevSetNamespace): Likewise.
      * src/util/virnetdev.c (virNetDevSetNamespace): Likewise.
      * tests/testutils.c (virtTestCaptureProgramOutput): Likewise.
      * src/conf/storage_conf.h (_virStoragePerms): Use mode_t, uid_t,
      and gid_t rather than int.
      * src/security/security_dac.c (virSecurityDACSetOwnership): Likewise.
      * src/conf/storage_conf.c (virStorageDefParsePerms): Avoid
      compiler warning.
      3e2c3d8f
    • E
      build: prohibit cross-inclusion · 5c3a1564
      Eric Blake 提交于
      Make it easier to detect invalid cross-directory includes, by
      adding a syntax check.  The check is designed to be extensible:
      the default case lists only the non-driver directories, and
      specific directories can list a different set (for example,
      util/ can only use itself, network/ can only use itself, util/,
      or conf/).
      
      * .gnulib: Update to latest, for syntax check improvment.
      * cfg.mk (sc_prohibit_cross_inclusion): New check.
      (sc_prohibit_strncmp, sc_libvirt_unmarked_diagnostics): Simplify.
      5c3a1564
  17. 01 3月, 2012 1 次提交
    • E
      build: update to latest gnulib · 47d05109
      Eric Blake 提交于
      It's been a while, and we're between releases, so now's as good
      a time as any to resync.  This also fixes a build-breaker on
      cygwin, where cygwin 1.7.11 introduced a header bug in <termios.h>.
      
      * .gnulib: Update to latest.
      * bootstrap: Resync.
      * cfg.mk (sc_prohibit_strncmp): Copy upstream changes to
      sc_prohibit_strcmp.
      47d05109
  18. 25 2月, 2012 1 次提交
    • M
      Fixed URI parsing · 9f748277
      Martin Kletzander 提交于
      Function xmlParseURI does not remove square brackets around IPv6
      address when parsing. One of the solutions is making wrappers around
      functions working with xmlURI*. This assures that uri->server will be
      always properly assigned and it doesn't have to be changed when used
      on some new place in the code.
      For this purpose, functions virParseURI and virSaveURI were
      added. These function are wrappers around xmlParseURI and xmlSaveUri
      respectively.
      Also there is one new syntax check function to prohibit these functions
      anywhere else.
      
      File changes:
       - src/util/viruri.h        -- declaration
       - src/util/viruri.c        -- definition
       - src/libvirt_private.syms -- symbol export
       - src/Makefile.am          -- added source and header files
       - cfg.mk                   -- added sc_prohibit_xmlURI
       - all others               -- ID name and include fixes
      9f748277
  19. 04 2月, 2012 3 次提交
    • E
      python: use libvirt_util to avoid raw free · c700613b
      Eric Blake 提交于
      This patch starts the process of elevating the python binding code
      to be on the same level as the rest of libvirt when it comes to
      requiring good coding styles.  Statically linking against the
      libvirt_util library makes it much easier to write good code,
      rather than having to open-code and reinvent things locally.
      
      Done by global search and replace of s/free(/VIR_FREE(/, followed
      by hand-inspection of remaining malloc and redundant memset.
      
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation):
      Remove python from exemption.
      * python/Makefile.am (INCLUDES): Add gnulib and src/util.  Drop
      $(top_builddir)/$(subdir), as automake already guarantees that.
      (mylibs, myqemulibs): Pull in libvirt_util and gnulib.
      (libvirtmod_la_CFLAGS): Catch compiler warnings if configured to
      use -Werror.
      * python/typewrappers.c (libvirt_charPtrSizeWrap)
      (libvirt_charPtrWrap): Convert free to VIR_FREE.
      * python/generator.py (print_function_wrapper): Likewise.
      * python/libvirt-override.c: Likewise.
      c700613b
    • E
      build: expand rule to cover testsuite · 8fe454ce
      Eric Blake 提交于
      The bulk of this patch was done with:
      
      sed -i 's/\(\bfree *(/VIR_FREE(/g' tests/*.c
      
      followed by fixing the few compile errors that resulted.
      
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation):
      Remove tests from exemption.
      * tests/testutils.h: Add common header.
      * tests/commandhelper.c: Fix offenders.
      * tests/cputest.c: Likewise.
      * tests/domainsnapshotxml2xmltest.c: Likewise.
      * tests/interfacexml2xmltest.c: Likewise.
      * tests/networkxml2argvtest.c: Likewise.
      * tests/networkxml2xmltest.c: Likewise.
      * tests/nodedevxml2xmltest.c: Likewise.
      * tests/nodeinfotest.c: Likewise.
      * tests/nwfilterxml2xmltest.c: Likewise.
      * tests/qemuargv2xmltest.c: Likewise.
      * tests/qemuxml2argvtest.c: Likewise.
      * tests/qemuxml2xmltest.c: Likewise.
      * tests/qemuxmlnstest.c: Likewise.
      * tests/qparamtest.c: Likewise.
      * tests/sexpr2xmltest.c: Likewise.
      * tests/storagepoolxml2xmltest.c: Likewise.
      * tests/storagevolxml2xmltest.c: Likewise.
      * tests/testutils.c: Likewise.
      * tests/virshtest.c: Likewise.
      * tests/xencapstest.c: Likewise.
      * tests/xmconfigtest.c: Likewise.
      * tests/xml2sexprtest.c: Likewise.
      8fe454ce
    • E
      build: prohibit raw malloc and free · a7cfd709
      Eric Blake 提交于
      Our HACKING discourages use of malloc and free, for at least
      a couple of years now.  But we weren't enforcing it, until now :)
      
      For now, I've exempted python and tests, and will clean those up
      in subsequent patches.  Examples should be permanently exempt,
      since anyone copying our examples won't have use of our
      internal-only memory.h via libvirt_util.la.
      
      * cfg.mk (sc_prohibit_raw_allocation): New rule.
      (exclude_file_name_regexp--sc_prohibit_raw_allocation): and
      exemptions.
      * src/cpu/cpu.c (cpuDataFree): Avoid false positive.
      * src/conf/network_conf.c (virNetworkDNSSrvDefParseXML): Fix
      offenders.
      * src/libxl/libxl_conf.c (libxlMakeDomBuildInfo, libxlMakeVfb)
      (libxlMakeDeviceModelInfo): Likewise.
      * src/rpc/virnetmessage.c (virNetMessageSaveError): Likewise.
      * tools/virsh.c (_vshMalloc, _vshCalloc): Likewise.
      a7cfd709
  20. 26 1月, 2012 1 次提交
  21. 25 1月, 2012 1 次提交
    • E
      build: simplify xmlFreeNode usage · 78af0719
      Eric Blake 提交于
      Noticed while reviewing the previous patch; thankfully, there
      are no violations.
      
      * cfg.mk (useless_free_options): Add xmlFreeNode.
      78af0719