1. 05 6月, 2014 2 次提交
    • E
      maint: detect VPATH builds when checking for gnulib update · 3cbd3b8e
      Eric Blake 提交于
      I accidentally typed 'make' in the srcdir of a VPATH build, and
      was surprised to see this:
      
      $ make
      /bin/sh: s/^[ +-]//;s/ .*//: No such file or directory
      INFO: gnulib update required; running ./autogen.sh first
      make: -n: Command not found
      ./autogen.sh
      I am going to run ./configure with no arguments - if you wish
      to pass any to it, please specify them on the ./autogen.sh command line.
      running bootstrap...
      ./bootstrap: Bootstrapping from checked-out libvirt sources...
      ./bootstrap: getting gnulib files...
      
      Oops - we're trying to execute some fairly bogus command names,
      and then trying to configure in-tree (which breaks all existing
      VPATH builds, since automake refuses to do a VPATH build if it
      detects an in-tree configure).  The third line (executing "-n")
      is fixed by updating to the latest gnulib; the rest of the problem
      is fixed by copying the same filtering in our cfg.mk as what
      gnulib just added, so that we avoid any $(shell) invocations which
      in turn depend on variables that are only populated by a working
      Makefile.  With that in place, we are back to the much nicer:
      
      $ make
      There seems to be no Makefile in this directory.
      You must run ./configure before running 'make'.
      make: *** [abort-due-to-no-makefile] Error 1
      
      Additionally, although harder to see - there was a trailing space in
      the message warning us that autogen would run an in-tree configure.
      
      * .gnulib: Update to latest, in part for maint.mk improvements.
      * cfg.mk (_update_required): Don't check for update in
      unconfigured directory.
      * autogen.sh (no_git): Drop trailing space.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3cbd3b8e
    • E
      maint: optimize locale.h syntax check · d804a58a
      Eric Blake 提交于
      Reusing the maint.mk code allows for a more efficient syntax check
      (fewer grep processes), and a more compact representation of what
      we are really checking for in commit 1919e355.
      
      * cfg.mk (sc_require_locale_h): Use maint.mk loop instead of
      rolling our own.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d804a58a
  2. 04 6月, 2014 1 次提交
  3. 03 6月, 2014 1 次提交
    • P
      storage: Move virStorageFileGetMetadata to the storage driver · 713cc3b0
      Peter Krempa 提交于
      My future work will modify the metadata crawler function to use the
      storage driver file APIs to access the files instead of accessing them
      directly so that we will be able to request the metadata for remote
      files too. To avoid linking the storage driver to every helper file
      using the utils code, the backing chain traversal function needs to be
      moved to the storage driver source.
      
      Additionally the virt-aa-helper and virstoragetest programs need to be
      linked with the storage driver as a result of this change.
      713cc3b0
  4. 13 5月, 2014 1 次提交
  5. 29 4月, 2014 1 次提交
    • E
      enforce sane readdir usage · eae00fb5
      Eric Blake 提交于
      Now that all clients have been adjusted, ensure that no future
      misuse of readdir is introduced into the code base.
      
      * cfg.mk (sc_prohibit_readdir): New rule.
      * src/util/virfile.c (virDirRead): Exempt the wrapper.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eae00fb5
  6. 08 4月, 2014 1 次提交
  7. 02 4月, 2014 1 次提交
    • E
      maint: ensure src/ directory includes are clean · cbfd9a61
      Eric Blake 提交于
      In 'make syntax-check', we have a rule that prevents layering
      violations between the various files in src.  However, we
      forgot to treat conf/ and the more recently-added access/ as
      lower-level directories, and were not detecting cases where
      they might have used a driver file.  Also, it's not nice that
      qemu can use storage/ but none of the other drivers could do so.
      
      * cfg.mk (sc_prohibit_cross_inclusion): Tighten rules for conf/
      and access/, let all other drivers use storage/.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      cbfd9a61
  8. 30 3月, 2014 1 次提交
    • M
      Prohibit Windows special chars in filenames · 8f21ae70
      Matthias Bolte 提交于
      Using any of these chars [:*?"<>|] in a filename is forbidden on
      Windows and breaks git operations on Windows as git is not able
      to create those files/directories on clone or pull.
      
      Because some of them can be used in UNIX filenames they tend to
      creep into filenames; especially : in PCI/SCSI device names that
      are used as filenames in test cases.
      8f21ae70
  9. 25 3月, 2014 1 次提交
  10. 21 3月, 2014 1 次提交
  11. 18 3月, 2014 4 次提交
  12. 14 3月, 2014 1 次提交
  13. 10 3月, 2014 1 次提交
  14. 03 3月, 2014 1 次提交
  15. 20 2月, 2014 1 次提交
    • D
      Introduce new OOM testing support · 590029f6
      Daniel P. Berrange 提交于
      The previous OOM testing support would re-run the entire "main"
      method each iteration, failing a different malloc each time.
      When a test suite has 'n' allocations, the number of repeats
      requires is  (n * (n + 1) ) / 2.  This gets very large, very
      quickly.
      
      This new OOM testing support instead integrates at the
      virtTestRun level, so each individual test case gets repeated,
      instead of the entire test suite. This means the values of
      'n' are orders of magnitude smaller.
      
      The simple usage is
      
         $ VIR_TEST_OOM=1 ./qemuxml2argvtest
         ...
         29) QEMU XML-2-ARGV clock-utc                                         ... OK
             Test OOM for nalloc=36 .................................... OK
         30) QEMU XML-2-ARGV clock-localtime                                   ... OK
             Test OOM for nalloc=36 .................................... OK
         31) QEMU XML-2-ARGV clock-france                                      ... OK
             Test OOM for nalloc=38 ...................................... OK
         ...
      
      the second lines reports how many mallocs have to be failed, and thus
      how many repeats of the test will be run.
      
      If it crashes, then running under valgrind will often show the problem
      
        $ VIR_TEST_OOM=1 ../run valgrind ./qemuxml2argvtest
      
      When debugging problems it is also helpful to select an individual
      test case
      
        $ VIR_TEST_RANGE=30 VIR_TEST_OOM=1 ../run valgrind ./qemuxml2argvtest
      
      When things get really tricky, it is possible to request that just
      specific allocs are failed. eg to fail allocs 5 -> 12, use
      
        $ VIR_TEST_RANGE=30 VIR_TEST_OOM=1:5-12 ../run valgrind ./qemuxml2argvtest
      
      In the worse case, you might want to know the stack trace of the
      alloc which was failed then VIR_TEST_OOM_TRACE can be set. If it
      is set to 1 then it will only print if it thinks a mistake happened.
      This is often not reliable, so setting it to 2 will make it print
      the stack trace for every alloc that is failed.
      
        $ VIR_TEST_OOM_TRACE=2 VIR_TEST_RANGE=30 VIR_TEST_OOM=1:5-5 ../run valgrind ./qemuxml2argvtest
        30) QEMU XML-2-ARGV clock-localtime                                   ... OK
            Test OOM for nalloc=36 !virAllocN
        /home/berrange/src/virt/libvirt/src/util/viralloc.c:180
        virHashCreateFull
        /home/berrange/src/virt/libvirt/src/util/virhash.c:144
        virDomainDefParseXML
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:11745
        virDomainDefParseNode
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:12646
        virDomainDefParse
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:12590
        testCompareXMLToArgvFiles
        /home/berrange/src/virt/libvirt/tests/qemuxml2argvtest.c:106
        virtTestRun
        /home/berrange/src/virt/libvirt/tests/testutils.c:250
        mymain
        /home/berrange/src/virt/libvirt/tests/qemuxml2argvtest.c:418 (discriminator 2)
        virtTestMain
        /home/berrange/src/virt/libvirt/tests/testutils.c:750
        ??
        ??:0
        _start
        ??:?
         FAILED
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      590029f6
  16. 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
  17. 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
  18. 17 1月, 2014 1 次提交
  19. 25 12月, 2013 1 次提交
  20. 14 12月, 2013 1 次提交
  21. 10 12月, 2013 2 次提交
  22. 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
  23. 26 11月, 2013 1 次提交
  24. 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
  25. 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
  26. 04 11月, 2013 1 次提交
  27. 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
  28. 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
  29. 21 10月, 2013 1 次提交
  30. 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
  31. 24 9月, 2013 1 次提交
  32. 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
  33. 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
  34. 03 9月, 2013 1 次提交
  35. 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