1. 14 2月, 2014 1 次提交
    • P
      qemu: Switch snapshot deletion to the new API functions · 8f4091d6
      Peter Krempa 提交于
      Use the new storage driver APIs to delete snapshot backing files in case
      of failure instead of directly relying on "unlink". This will help us in
      the future when we will be adding network based storage without local
      representation in the host.
      8f4091d6
  2. 21 1月, 2014 1 次提交
    • Y
      Introduce Libvirt Wireshark dissector · 4f32c5f7
      Yuto KAWAMURA(kawamuray) 提交于
      Introduce Wireshark dissector plugin which adds support to Wireshark
      for dissecting libvirt RPC protocol.
      Added following files to build Wireshark dissector from libvirt source
      tree.
      * tools/wireshark/*: Source tree of Wireshark dissector plugin.
      
      Added followings to configure.ac or Makefile.am.
      configure.ac
      * --with-wireshark-dissector: Enable support for building Wireshark
        dissector.
      * --with-ws-plugindir: Specify wireshark plugin directory that dissector
        will installed.
      * Added tools/wireshark/{Makefile,src/Makefile} to  AC_CONFIG_FILES.
      Makefile.am
      * Added tools/wireshark/ to SUBDIR.
      4f32c5f7
  3. 17 1月, 2014 1 次提交
  4. 25 12月, 2013 1 次提交
  5. 14 12月, 2013 1 次提交
  6. 10 12月, 2013 2 次提交
  7. 05 12月, 2013 1 次提交
    • P
      maint: Kill usage of atoi() · df36af58
      Peter Krempa 提交于
      Kill the use of atoi() and introduce syntax check to forbid it and it's
      friends (atol, atoll, atof, atoq).
      
      Also fix a typo in variable name holding the cylinders count of a disk
      pool (apparently unused).
      
      examples/domsuspend/suspend.c will need a larger scale refactor as the
      whole example file is broken thus it will be exempted from the syntax
      check for now.
      df36af58
  8. 26 11月, 2013 1 次提交
  9. 06 11月, 2013 1 次提交
    • M
      virpcitest: Introduce testVirPCIDeviceReset · 21685c95
      Michal Privoznik 提交于
      This addition, however, requires some refactoring to be done.  First of
      all, to match the best practice we should detach the device prior
      resetting it. That's why testVirPCIDeviceDetach is detaching all devices
      within 0000:00:01.0 and 0000:00:03.0 range. Then, the brand new test
      will reset the 0000:00:02.0 device, so the last testVirPCIDeviceReattach
      can reattach all the devices back.
      
      In order to perform a PCI device reset, the dummy config file is not
      sufficient anymore and must be replaced with real PCI config (binary
      mess). Such config files are to be stored under tests/virpcitestdata/
      and ought to have '.config' suffix.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      21685c95
  10. 05 11月, 2013 1 次提交
    • M
      virpcitest: Test virPCIDeviceDetach · 25527ae2
      Michal Privoznik 提交于
      This commit introduces yet another test under virpcitest:
      virPCIDeviceDetach. However, in order to be able to do this, the
      virpcimock needs to be extended to model the kernel behavior on PCI
      device binding and unbinding (create 'driver' symlinks under the device
      tree, check for device ID in driver's ID table, etc.)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      25527ae2
  11. 04 11月, 2013 1 次提交
  12. 31 10月, 2013 1 次提交
    • E
      maint: avoid further typedef accidents · fb861352
      Eric Blake 提交于
      To make it easier to forbid future attempts at a confusing typedef
      name ending in Ptr that isn't actually a pointer, insist that we
      follow our preferred style of 'typedef foo *fooPtr'.
      
      * cfg.mk (sc_forbid_const_pointer_typedef): Enforce consistent
      style, to prevent issue fixed in previous storage patch.
      * src/conf/capabilities.h (virCapsPtr): Fix offender.
      * src/security/security_stack.c (virSecurityStackItemPtr):
      Likewise.
      * tests/qemucapabilitiestest.c (testQemuDataPtr): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fb861352
  13. 23 10月, 2013 1 次提交
    • M
      build: Fix prohibit_int_ijk (and iijjkk) on RHEL 5 · ecddd7a3
      Martin Kletzander 提交于
      On RHEL 5, make syntax-check was failing because even strings like
      'int isTempChain' matched the 'int i' rule.  To be honest, I haven't
      found the root cause, but the change added makes it work as expected
      and keeps the proper behavior on newer systems as well.
      ecddd7a3
  14. 21 10月, 2013 1 次提交
  15. 15 10月, 2013 1 次提交
    • E
      build: syntax check to avoid 'const fooPtr' · e7981016
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Now that the code base has been cleaned, enforce it with a syntax
      checker.
      
      * cfg.mk (sc_forbid_const_pointer_typedef): New rule.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e7981016
  16. 24 9月, 2013 1 次提交
  17. 10 9月, 2013 1 次提交
    • E
      tests: check remaining .x files · e561951d
      Eric Blake 提交于
      We have been adding new .x files without keeping the list of
      *-structs files up-to-date.  This adds the support for the
      recent additions.
      
      In the process of testing this, I also noticed that Fedora 19's
      use of dwarves-1.10 (providing pdwtags version 1.9) was producing
      a single line on stderr but still giving enough useful info on
      stdout that we could check structs; the real goal of checking
      stderr separately from stdout was to avoid the bug in dwarves-1.9
      where stdout was empty (see bug http://bugzilla.redhat.com/772358).
      
      * src/Makefile.am (struct_prefix, PROTOCOL_STRUCTS): Add missing
      struct tests.
      (PDWTAGS): Work with Fedora 19 pdwtags.
      (lxc_monitor_protocol-struct, lock_protocol-struct): New rules.
      * src/lxc_monitor_protocol-structs: New file.
      * src/lock_protocol-structs): Likewise.
      * cfg.mk (generated_files): Enlarge list.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e561951d
  18. 04 9月, 2013 1 次提交
    • E
      build: enforce makefile conditional style · ec81852f
      Eric Blake 提交于
      Automake has builtin support to prevent botched conditional nesting,
      but only if you use:
      if FOO
      else !FOO
      endif !FOO
      
      An example error message when using the wrong name:
      
      daemon/Makefile.am:378: error: else reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
      daemon/Makefile.am:381: error: endif reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
      
      As our makefiles tend to have quite a bit of nested conditionals,
      it's better to take advantage of the benefits of the build system
      double-checking that our conditionals are well-nested, but that
      requires a syntax check to enforce our usage style.
      
      Alas, unlike C preprocessor and spec files, we can't use indentation
      to make it easier to see how deeply nesting goes.
      
      * cfg.mk (sc_makefile_conditionals): New rule.
      * daemon/Makefile.am: Enforce the style.
      * gnulib/tests/Makefile.am: Likewise.
      * python/Makefile.am: Likewise.
      * src/Makefile.am: Likewise.
      * tests/Makefile.am: Likewise.
      * tools/Makefile.am: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ec81852f
  19. 03 9月, 2013 1 次提交
  20. 29 8月, 2013 1 次提交
    • D
      Prohibit unbounded arrays in XDR protocols · a4d1cfdc
      Daniel P. Berrange 提交于
      The use of <> is a security issue for RPC parameters, since a
      malicious client can set a huge array length causing arbitrary
      memory allocation in the daemon.
      
      It is also a robustness issue for RPC return values, because if
      the stream is corrupted, it can cause the client to also allocate
      arbitrary memory.
      
      Use a syntax-check rule to prohibit any use of <>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a4d1cfdc
  21. 08 8月, 2013 2 次提交
  22. 19 7月, 2013 2 次提交
    • E
      maint: split long lines in Makefiles · d21d40bf
      Eric Blake 提交于
      Makefiles are another easy file to enforce line limits.
      
      Mostly straightforward; interesting tricks worth noting:
      src/Makefile.am: $(confdir) was already defined, use it in more places
      tests/Makefile.am: path_add and VG required some interesting compression
      
      * cfg.mk (sc_prohibit_long_lines): Add another test.
      * Makefile.am: Fix offenders.
      * daemon/Makefile.am: Likewise.
      * docs/Makefile.am: Likewise.
      * python/Makefile.am: Likewise.
      * src/Makefile.am: Likewise.
      * tests/Makefile.am: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d21d40bf
    • E
      tests: split long lines · 684c90bf
      Eric Blake 提交于
      Long lines are harder to read and harder to diff; in fact, if lines get
      too long (> 1000 bytes), it starts causing issues where git send-email
      refuses to send patches for the file.  I've cleaned up the tests
      directory in the past (see commits bd6c46fa, 3b750d13), but new long
      lines have been introduced in the meantime.
      
      Why 90 instead of 80? Because there were too many tests on the fringe
      edge, and I didn't want to edit that many files.
      
      Add a syntax check to prevent future long lines.
      
      * cfg.mk (sc_prohibit_long_lines): New rule.
      * tests/qemuxml2argvdata/qemuxml2argv-*.args: Split lines of any
      file with content longer than 90 columns.
      * tests/storagevolxml2argvdata/*.argv: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      684c90bf
  23. 11 7月, 2013 1 次提交
  24. 10 7月, 2013 2 次提交
    • M
      Introduce OOM reporting to virAsprintf · dc6f2dad
      Michal Privoznik 提交于
      Actually, I'm turning this function into a macro as filename,
      function name and line number needs to be passed. The new
      function virAsprintfInternal is introduced with the extended set
      of arguments.
      dc6f2dad
    • E
      build: honor autogen.sh --no-git · 1e503ee5
      Eric Blake 提交于
      Based on a report by Chandrashekar Shastri, at
      https://bugzilla.redhat.com/show_bug.cgi?id=979360
      
      On systems where git cannot access the outside world, a developer
      can instead arrange to get a copy of gnulib at the right commit
      via side channels (such as NFS share drives), set GNULIB_SRCDIR,
      then use ./autogen.sh --no-git.  In this setup, we will now
      avoid direct use of git.  Of course, this means no automatic
      gnulib updates when libvirt.git updates its submodule, but it
      is expected that any developer in such a situation is already
      prepared to deal with the fallout.
      
      * .gnulib: Update to latest, for bootstrap.
      * bootstrap: Synchronize from gnulib.
      * autogen.sh (no_git): Avoid git when requested.
      * cfg.mk (_update_required): Skip automatic rerun of bootstrap if
      we can't use git.
      * docs/compiling.html.in: Document this setup.
      * docs/hacking.html.in: Mention this.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1e503ee5
  25. 25 6月, 2013 1 次提交
  26. 05 6月, 2013 1 次提交
    • E
      maint: don't use config.h in .h files · 1add9c78
      Eric Blake 提交于
      Enforce the rule that .h files don't need to (redundantly)
      include <config.h>.
      
      * cfg.mk (sc_prohibit_config_h_in_headers): New rule.
      (_virsh_includes): Delete; instead, inline a smaller number of
      exclusions...
      (exclude_file_name_regexp--sc_require_config_h)
      (exclude_file_name_regexp--sc_require_config_h_first): ...here.
      * daemon/libvirtd.h (includes): Fix offenders.
      * src/driver.h (includes): Likewise.
      * src/gnutls_1_0_compat.h (includes): Likewise.
      * src/libxl/libxl_conf.h (includes): Likewise.
      * src/libxl/libxl_driver.h (includes): Likewise.
      * src/lxc/lxc_conf.h (includes): Likewise.
      * src/lxc/lxc_driver.h (includes): Likewise.
      * src/lxc/lxc_fuse.h (includes): Likewise.
      * src/network/bridge_driver.h (includes): Likewise.
      * src/phyp/phyp_driver.h (includes): Likewise.
      * src/qemu/qemu_conf.h (includes): Likewise.
      * src/util/virnetlink.h (includes): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1add9c78
  27. 28 5月, 2013 2 次提交
    • E
      syntax: fix broken error message in previous patch · 0c8926da
      Eric Blake 提交于
      Osier Yang pointed out that I introduced a syntax error in my
      syntax check (I really shouldn't make last-minute changes without
      testing them....).
      
      /bin/sh: -c: line 2: syntax error near unexpected token `;'
      /bin/sh: -c: line 2: `  { echo 'maint.mk: incorrect whitespace, see HACKING for rules' 2>&; \'
      make: *** [bracket-spacing-check] Error 1
      
      * cfg.mk (bracket-spacing-check): Fix copy-and-paste error.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0c8926da
    • E
      syntax-check: mandate space after mid-line semicolon · 134e685b
      Eric Blake 提交于
      Enforce the style cleanup in the previous patch.
      
      * build-aux/bracket-spacing.pl: Enforce trailing spacing.
      * cfg.mk (bracket-spacing-check): Tweak error wording.
      * docs/hacking.html.in: Document the rule.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      134e685b
  28. 24 5月, 2013 1 次提交
  29. 21 5月, 2013 2 次提交
    • E
      maint: enforce correct copyright usage · 0e55024e
      Eric Blake 提交于
      To ensure we don't regress and cause the need for further
      cleanups, add a 'make syntax-check' rule that ensures new
      files have proper copyright contents.
      
      * cfg.mk (sc_copyright_address): Rename...
      (sc_copyright_usage): ...and enhance.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0e55024e
    • E
      maint: follow recommended practice for using LGPL · de483052
      Eric Blake 提交于
      https://www.gnu.org/licenses/gpl-howto.html states:
      
      You should also include a copy of the license itself somewhere in the
      distribution of your program. All programs, whether they are released
      under the GPL or LGPL, should include the text version of the GPL. In
      GNU programs the license is usually in a file called COPYING.
      
      If you are releasing your program under the LGPL, you should also
      include the text version of the LGPL, usually in a file called
      COPYING.LESSER. Please note that, since the LGPL is a set of
      additional permissions on top of the GPL, it's important to include
      both licenses so users have all the materials they need to understand
      their rights.
      
      * configure.ac (COPYING): No more games with non-git file.
      * COPYING: New file, copied from gnulib.
      * COPYING.LIB: Rename...
      * COPYING.LESSER: ...to this.
      * .gitignore: Track licenses in git.
      * cfg.mk (exclude_file_name_regexp--sc_copyright_address): Tweak
      rule.
      * libvirt.spec.in (daemon, client, python): Reflect rename.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      de483052
  30. 14 5月, 2013 1 次提交
    • D
      Remove & ban use of select() for waiting for I/O · 8845d8df
      Daniel P. Berrange 提交于
      Use of the select() system call is inherantly dangerous since
      applications will hit a buffer overrun if any FD number exceeds
      the size of the select set size (typically 1024). Replace the
      two uses of select() with poll() and use cfg.mk to ban any
      future use of select().
      
      NB: This changes the phyp driver so that it uses an infinite
      timeout, instead of busy-waiting for 1ms at a time.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8845d8df
  31. 11 5月, 2013 1 次提交
    • L
      util: move virFile* functions from virutil.c to virfile.c · bfe7721d
      Laine Stump 提交于
      These all existed before virfile.c was created, and for some reason
      weren't moved.
      
      This is mostly straightfoward, although the syntax rule prohibiting
      write() had to be changed to have an exception for virfile.c instead
      of virutil.c.
      
      This movement pointed out that there is a function called
      virBuildPath(), and another almost identical function called
      virFileBuildPath(). They really should be a single function, which
      I'll take care of as soon as I figure out what the arglist should look
      like.
      bfe7721d
  32. 07 5月, 2013 1 次提交
  33. 03 5月, 2013 1 次提交
    • E
      build: avoid useless virAsprintf · 25ae3d30
      Eric Blake 提交于
      virAsprintf(&foo, "%s", bar) is wasteful compared to
      foo = strdup(bar) (or eventually, VIR_STRDUP(foo, bar),
      but one thing at a time...).
      
      Noticed while reviewing Laine's attempt to clean up broken
      qemu:///session.
      
      * cfg.mk (sc_prohibit_asprintf): Enhance rule.
      * src/esx/esx_storage_backend_vmfs.c
      (esxStorageBackendVMFSVolumeLookupByKey): Fix offender.
      * src/network/bridge_driver.c (networkStateInitialize): Likewise.
      * src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopDHCPOpen):
      Likewise.
      * src/storage/storage_backend_sheepdog.c
      (virStorageBackendSheepdogRefreshVol): Likewise.
      * src/util/vircgroup.c (virCgroupAddTaskStrController): Likewise.
      * src/util/virdnsmasq.c (addnhostsAdd): Likewise.
      * src/xen/block_stats.c (xenLinuxDomainDeviceID): Likewise.
      * src/xen/xen_driver.c (xenUnifiedConnectOpen): Likewise.
      * tools/virsh.c (vshGetTypedParamValue): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      25ae3d30
  34. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88