1. 05 2月, 2013 1 次提交
    • E
      cutils: unsigned int parsing functions · e3f9fe2d
      Eduardo Habkost 提交于
      There are lots of duplicate parsing code using strto*() in QEMU, and
      most of that code is broken in one way or another. Even the visitors
      code have duplicate integer parsing code[1]. This introduces functions
      to help parsing unsigned int values: parse_uint() and parse_uint_full().
      
      Parsing functions for signed ints and floats will be submitted later.
      
      parse_uint_full() has all the checks made by opts_type_uint64() at
      opts-visitor.c:
      
       - Check for NULL (returns -EINVAL)
       - Check for negative numbers (returns -EINVAL)
       - Check for empty string (returns -EINVAL)
       - Check for overflow or other errno values set by strtoll() (returns
         -errno)
       - Check for end of string (reject invalid characters after number)
         (returns -EINVAL)
      
      parse_uint() does everything above except checking for the end of the
      string, so callers can continue parsing the remainder of string after
      the number.
      
      Unit tests included.
      
      [1] string-input-visitor.c:parse_int() could use the same parsing code
          used by opts-visitor.c:opts_type_int(), instead of duplicating that
          logic.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      e3f9fe2d
  2. 02 2月, 2013 1 次提交
    • A
      sparc: disable qtest in make check · baeddded
      Anthony Liguori 提交于
      We've seen this repeatedly in buildbot but I can now reliably
      reproduce it myself too.  With a few hundred runs of 'make check',
      qemu-system-sparc will hang consuming 100% CPU.  I've attached GDB
      to the hung process and unfortunately, I can't get anything useful
      out of GDB (RIP is not a valid simple and there is nothing else on
      the stack).
      
      At any rate, since this only manifests in qemu-system-sparc and it
      doesn't appear to be a qtest specific problem, I think we should
      disable it until the problem is resolved.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      baeddded
  3. 01 2月, 2013 1 次提交
  4. 27 1月, 2013 1 次提交
  5. 26 1月, 2013 5 次提交
    • A
      tests: Add gcov support for x86_64 qtest · c5cd02ba
      Andreas Färber 提交于
      Since x86_64 is a superset of i386 and reuses all its test cases, adopt
      all the i386 gcov source files as well, substituting their paths
      appropriately.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      c5cd02ba
    • A
      tests: Add gcov support for sparc64 qtest · cba040c2
      Andreas Färber 提交于
      m48t59-test is individually being executed for sparc and sparc64, so add
      the gcov source file for sparc64 as well.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      cba040c2
    • A
      tests: Fix gcov typo for tmp105-test · 6a694495
      Andreas Färber 提交于
      Commit 6e998903 introduced a new qtest
      test case but misspelled gcov, leading to no coverage analysis. Fix it.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      6a694495
    • P
      tests: adjust gcov variables for directory movement · 5f7a74a1
      Paolo Bonzini 提交于
      I had missed the introduction of the gcov-files-* variables.
      
      Cc: Blue Swirl <blauwirbel@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      5f7a74a1
    • P
      add hierarchical bitmap data type and test cases · e7c033c3
      Paolo Bonzini 提交于
      HBitmaps provides an array of bits.  The bits are stored as usual in an
      array of unsigned longs, but HBitmap is also optimized to provide fast
      iteration over set bits; going from one bit to the next is O(logB n)
      worst case, with B = sizeof(long) * CHAR_BIT: the result is low enough
      that the number of levels is in fact fixed.
      
      In order to do this, it stacks multiple bitmaps with progressively coarser
      granularity; in all levels except the last, bit N is set iff the N-th
      unsigned long is nonzero in the immediately next level.  When iteration
      completes on the last level it can examine the 2nd-last level to quickly
      skip entire words, and even do so recursively to skip blocks of 64 words or
      powers thereof (32 on 32-bit machines).
      
      Given an index in the bitmap, it can be split in group of bits like
      this (for the 64-bit case):
      
           bits 0-57 => word in the last bitmap     | bits 58-63 => bit in the word
           bits 0-51 => word in the 2nd-last bitmap | bits 52-57 => bit in the word
           bits 0-45 => word in the 3rd-last bitmap | bits 46-51 => bit in the word
      
      So it is easy to move up simply by shifting the index right by
      log2(BITS_PER_LONG) bits.  To move down, you shift the index left
      similarly, and add the word index within the group.  Iteration uses
      ffs (find first set bit) to find the next word to examine; this
      operation can be done in constant time in most current architectures.
      
      Setting or clearing a range of m bits on all levels, the work to perform
      is O(m + m/W + m/W^2 + ...), which is O(m) like on a regular bitmap.
      
      When iterating on a bitmap, each bit (on any level) is only visited
      once.  Hence, The total cost of visiting a bitmap with m bits in it is
      the number of bits that are set in all bitmaps.  Unless the bitmap is
      extremely sparse, this is also O(m + m/W + m/W^2 + ...), so the amortized
      cost of advancing from one bit to the next is usually constant.
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e7c033c3
  6. 17 1月, 2013 2 次提交
  7. 13 1月, 2013 8 次提交
  8. 06 1月, 2013 1 次提交
  9. 26 11月, 2012 2 次提交
  10. 19 11月, 2012 1 次提交
  11. 30 10月, 2012 2 次提交
  12. 24 10月, 2012 1 次提交
  13. 15 8月, 2012 1 次提交
  14. 28 7月, 2012 1 次提交
  15. 17 7月, 2012 1 次提交
  16. 08 6月, 2012 2 次提交
    • M
      qapi: Unit tests for visitor-based serialization · 2d496105
      Michael Roth 提交于
      Currently we test our visitors individually, and seperately for input
      vs. output. This is useful for validating internal representations
      against the native C types and vice-versa, and other visitor-specific
      testing, but it doesn't cover the potential use-case of using visitor
      pairs for serialization/deserialization very well, and makes it
      hard to easily extend the coverage for different C types / boundary
      conditions.
      
      To cover that we add a set of unit tests that takes a number of native C
      values, passes them into an output visitor, extracts the values with an
      input visitor, then compares the result to the original.
      
      Plugging in new visitors to the test harness only requires a user to
      implement the SerializeOps interface and add it to a list.
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      2d496105
    • M
      rewrite iov_* functions · 2278a69e
      Michael Tokarev 提交于
      This changes implementations of all iov_*
      functions, completing the previous step.
      
      All iov_* functions now ensure that this offset
      argument is within the iovec (using assertion),
      but lets to specify `bytes' value larger than
      actual length of the iovec - in this case they
      stops at the actual end of iovec.  It is also
      suggested to use convinient `-1' value as `bytes'
      to mean just this -- "up to the end".
      
      There's one very minor semantic change here: new
      requiriment is that `offset' points to inside of
      iovec.  This is checked just at the end of functions
      (assert()), it does not actually need to be enforced,
      but using any of these functions with offset pointing
      past the end of iovec is wrong anyway.
      
      Note: the new code in iov.c uses arithmetic with
      void pointers.  I thought this is not supported
      everywhere and is a GCC extension (indeed, the C
      standard does not define void arithmetic).  However,
      the original code already use void arith in
      iov_from_buf() function:
        (memcpy(..., buf + buf_off,...)
      which apparently works well so far (it is this
      way in qemu 1.0).  So I left it this way and used
      it in other places.
      
      While at it, add a unit-test file test-iov.c,
      to check various corner cases with iov_from_buf(),
      iov_to_buf() and iov_memset().
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      2278a69e
  17. 07 6月, 2012 1 次提交
  18. 22 5月, 2012 1 次提交
  19. 19 5月, 2012 1 次提交
    • S
      tests: Fix linker failure for fdc-test · fd4567d9
      Stefan Weil 提交于
      When QEMU was built with the simple trace backend, linking failed:
      
        LINK  tests/fdc-test
      oslib-posix.o: In function `trace_qemu_memalign':
      qemu/bin/debug/x86/./trace.h:31: undefined reference to `trace3'
      oslib-posix.o: In function `trace_qemu_vmalloc':
      qemu/bin/debug/x86/./trace.h:35: undefined reference to `trace2'
      oslib-posix.o: In function `trace_qemu_vfree':
      qemu/bin/debug/x86/./trace.h:39: undefined reference to `trace1'
      collect2: error: ld returned 1 exit status
      make: *** [tests/fdc-test] Fehler 1
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      fd4567d9
  20. 10 5月, 2012 2 次提交
  21. 21 4月, 2012 1 次提交
  22. 15 4月, 2012 1 次提交
  23. 31 3月, 2012 1 次提交
  24. 30 3月, 2012 1 次提交