1. 19 12月, 2017 3 次提交
  2. 18 12月, 2017 4 次提交
  3. 14 12月, 2017 1 次提交
    • V
      tests: test-hmp: print command execution result · 0eaf3b82
      Vadim Galitsyn 提交于
      Provide HMP monitor command execution result as it would be seen
      by user who established an HMP monitor session.
      
      Currently many commands may silently fail without any sign of that.
      This patch let this info to be printed once test is running in
      verbose mode.
      
      For the future it might be useful to fail the test if command has
      failed, however it would require a bit of rework inside test
      engine itself.
      
      A simple example of silent failure without reporting it would to
      add some non-existent HMP command into 'hmp_cmds' list. In this case
      test will report it successfully passed without error.
      Signed-off-by: NVadim Galitsyn <vadim.galitsyn@profitbricks.com>
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Cc: qemu-devel@nongnu.org
      Message-Id: <20171023151310.6462-5-vadim.galitsyn@profitbricks.com>
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      0eaf3b82
  4. 29 11月, 2017 1 次提交
  5. 27 11月, 2017 1 次提交
  6. 22 11月, 2017 2 次提交
  7. 21 11月, 2017 2 次提交
    • E
      iotests: Fix 176 on 32-bit host · 2807746f
      Eric Blake 提交于
      The contents of a qcow2 bitmap are rounded up to a size that
      matches the number of bits available for the granularity, but
      that granularity differs for 32-bit hosts (our default 64k
      cluster allows for 2M bitmap coverage per 'long') and 64-bit
      hosts (4M bitmap per 'long').  If the image is a multiple of
      2M but not 4M, then the number of bytes occupied by the array
      of longs in memory differs between architecture, thus
      resulting in different SHA256 hashes.
      
      Furthermore (but untested by me), if our computation of the
      SHA256 hash is at all endian-dependent because of how we store
      data in memory, that's another variable we'd have to account
      for (ideally, we specified the bitmap stored in qcow2 as
      fixed-endian on disk, because the same qcow2 file must be
      usable across any architecture; but that says nothing about
      how we represent things in memory).  But we already have test
      165 to validate that bitmaps are stored correctly on disk,
      while this test is merely testing that the bitmap exists.
      
      So for this test, the easiest solution is to filter out the
      actual hash value.  Broken in commit 4096974e.
      Reported-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20171117190422.23626-1-eblake@redhat.com
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      2807746f
    • A
      block: Close a BlockDriverState completely even when bs->drv is NULL · 50a3efb0
      Alberto Garcia 提交于
      bdrv_close() skips much of its logic when bs->drv is NULL. This is
      fine when we're closing a BlockDriverState that has just been created
      (because e.g the initialization process failed), but it's not enough
      in other cases.
      
      For example, when a valid qcow2 image is found to be corrupted then
      QEMU marks it as such in the file header and then sets bs->drv to
      NULL in order to make the BlockDriverState unusable. When that BDS is
      later closed then many of its data structures are not freed (leaking
      their memory) and none of its children are detached. This results in
      bdrv_close_all() failing to close all BDSs and making this assertion
      fail when QEMU is being shut down:
      
         bdrv_close_all: Assertion `QTAILQ_EMPTY(&all_bdrv_states)' failed.
      
      This patch makes bdrv_close() do the full uninitialization process
      in all cases. This fixes the problem with corrupted images and still
      works fine with freshly created BDSs.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Message-id: 20171106145345.12038-1-berto@igalia.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      50a3efb0
  8. 18 11月, 2017 12 次提交
  9. 17 11月, 2017 3 次提交
  10. 16 11月, 2017 1 次提交
  11. 15 11月, 2017 10 次提交
    • J
      qemu-iotests: update unsupported image formats in 194 · 8b2d7c36
      Jeff Cody 提交于
      Test 194 checks for 'luks' to exclude as an unsupported format,
      However, most formats are unsupported, due to migration blockers.
      
      Rather than specifying a blacklist of unsupported formats, whitelist
      supported formats (specifically, qcow2, qed, raw, dmg).
      Tested-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Message-id: 23ca18c7f843c86a28b1529ca9ac6db4b35ca0e4.1510059970.git.jcody@redhat.com
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NDenis V. Lunev <den@openvz.org>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      8b2d7c36
    • F
      iotests: 077: Filter out 'resume' lines · d04c1555
      Fam Zheng 提交于
      In the "Overlapping multiple requests" cases, the 3rd reqs (the break
      point B) doesn't wait for the 2nd, and once resumed the I/O will just
      continue.  This is because the 2nd is already waiting for the 1st, and
      in wait_serialising_requests() there is:
      
          /* If the request is already (indirectly) waiting for us, or
           * will wait for us as soon as it wakes up, then just go on
           * (instead of producing a deadlock in the former case). */
          if (!req->waiting_for) {
              /* actually break */
              ...
          }
      
      Consequently, the following "sleep 100; resume A" command races with the
      completion of that request, and sometimes results in an unexpected
      order of output:
      
      > @@ -56,9 +56,9 @@
      >  wrote XXX/XXX bytes at offset XXX
      >  XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
      >  blkdebug: Resuming request 'B'
      > +blkdebug: Resuming request 'A'
      >  wrote XXX/XXX bytes at offset XXX
      >  XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
      > -blkdebug: Resuming request 'A'
      >  wrote XXX/XXX bytes at offset XXX
      >  XXX bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
      >  wrote XXX/XXX bytes at offset XXX
      
      Filter out the "Resuming request" lines to make the output
      deterministic.
      Reported-by: NPatchew <no-reply@patchew.org>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 20171113150026.4743-1-famz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      d04c1555
    • A
      qcow2: Check that corrupted images can be repaired in iotest 060 · bcb5270c
      Alberto Garcia 提交于
      We just fixed a few bugs that caused QEMU to crash when trying to
      write to corrupted qcow2 images, and iotest 060 was expanded to test
      all those scenarios.
      
      In almost all cases the corrupted images can be repaired using
      qemu-img, so this patch verifies that.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Message-id: 0b1b95340ecdfbc6927e36adf2fd42ae6198747a.1510143008.git.berto@igalia.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      bcb5270c
    • E
      iotests: Use new-style NBD connections · 147b44be
      Eric Blake 提交于
      Old-style NBD is deprecated upstream (it is documented, but no
      longer implemented in the reference implementation), and it is
      severely limited (it cannot support structured replies, which
      means it cannot support efficient handling of zeroes), when
      compared to new-style NBD.  We are better off having our iotests
      favor new-style everywhere (although some explicit tests,
      particularly 83, still cover old-style for back-compat reasons);
      this is as simple as supplying the empty string as the default
      export name, as it does not change the URI needed to connect a
      client to the server.  This also gives us more coverage of the
      just-added structured reply code, when not overriding $QEMU_NBD
      to intentionally point to an older server.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20171109221216.10248-1-eblake@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      147b44be
    • M
      iotests: Make 136 less flaky · 19026817
      Max Reitz 提交于
      136 executes some AIO requests without a final aio_flush; then it
      advances the virtual clock and thus expects the last access time of the
      device to be less than the current time when queried (i.e. idle_time_ns
      to be greater than 0).  However, without the aio_flush, some requests
      may be settled after the clock_step invocation.  In that case,
      idle_time_ns would be 0 and the test fails.
      
      Fix this by adding an aio_flush if any AIO request other than some other
      aio_flush has been executed.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20171109203025.27493-6-mreitz@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      19026817
    • M
      iotests: Make 083 less flaky · ddc7093e
      Max Reitz 提交于
      083 has (at least) two issues:
      
      1. By launching the nbd-fault-injector in background, it may not be
         scheduled until the first grep on its output file is executed.
         However, until then, that file may not have been created yet -- so it
         either does not exist yet (thus making the grep emit an error), or it
         does exist but contains stale data (thus making the rest of the test
         case work connect to a wrong address).
         Fix this by explicitly overwriting the output file before executing
         nbd-fault-injector.
      
      2. The nbd-fault-injector prints things other than "Listening on...".
         It also prints a "Closing connection" message from time to time.  We
         currently invoke sed on the whole file in the hope of it only
         containing the "Listening on..." line yet.  That hope is sometimes
         shattered by the brutal reality of race conditions, so make the sed
         script more robust.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20171109203025.27493-5-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      ddc7093e
    • M
      iotests: Make 055 less flaky · bc11aee2
      Max Reitz 提交于
      First of all, test 055 does a valiant job of invoking pause_drive()
      sometimes, but that is worth nothing without blkdebug.  So the first
      thing to do is to sprinkle a couple of "blkdebug::" in there -- with the
      exception of the transaction tests, because the blkdebug break points
      make the transaction QMP command hang (which is bad).  In that case, we
      can get away with throttling the block job that it effectively is
      paused.
      
      Then, 055 usually does not pause the drive before starting a block job
      that should be cancelled.  This means that the backup job might be
      completed already before block-job-cancel is invoked; thus making the
      test either fail (currently) or moot if cancel_and_wait() ignored this
      condition.  Fix this by pausing the drive before starting the job.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20171109203025.27493-4-mreitz@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      bc11aee2
    • M
      iotests: Add missing 'blkdebug::' in 040 · 51c493c5
      Max Reitz 提交于
      040 tries to invoke pause_drive() on a drive that does not use blkdebug.
      Good idea, but let's use blkdebug to make it actually work.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20171109203025.27493-3-mreitz@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      51c493c5
    • M
      iotests: Make 030 less flaky · dca9b6a2
      Max Reitz 提交于
      This patch fixes two race conditions in 030:
      
      1. The first is in TestENOSPC.test_enospc().  After resuming the job,
         querying it to confirm it is no longer paused may fail because in the
         meantime it might have completed already.  The same was fixed in
         TestEIO.test_ignore() already (in commit
         2c3b44da).
      
      2. The second is in TestSetSpeed.test_set_speed_invalid(): Here, a
         stream job is started on a drive without any break points, with a
         block-job-set-speed invoked subsequently.  However, without any break
         points, the job might have completed in the meantime (on tmpfs at
         least); or it might complete before cancel_and_wait() which expects
         the job to still exist.  This can be fixed like everywhere else by
         pausing the drive (installing break points) before starting the job
         and letting cancel_and_wait() resume it.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20171109203025.27493-2-mreitz@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      dca9b6a2
    • A
      qcow2: Add iotest for an empty refcount table · ef083f61
      Alberto Garcia 提交于
      This patch adds a simple iotest in which we try to write to an image
      with an empty refcount table (i.e. with all entries set to 0).
      
      This scenario was already handled by the existing consistency checks,
      but we add an explicit test case for completeness.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 7e48b0e2ae1a0a18e0ee303b3045f130feec0474.1509718618.git.berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      ef083f61