1. 17 11月, 2017 1 次提交
  2. 16 11月, 2017 1 次提交
  3. 15 11月, 2017 15 次提交
    • 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
    • A
      qcow2: Add iotest for an image with header.refcount_table_offset == 0 · 5a45da5e
      Alberto Garcia 提交于
      This patch adds a simple iotest in which we try to write to an image
      with the refcount table offset 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>
      Message-id: feeceada92486bb8790b90f303fc9fe82a27391a.1509718618.git.berto@igalia.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      5a45da5e
    • A
      qcow2: Don't open images with header.refcount_table_clusters == 0 · 951053a9
      Alberto Garcia 提交于
      qcow2_do_open() is checking that header.refcount_table_clusters is not
      too large, but it doesn't check that it's greater than zero. Apart
      from the fact that an image like that is obviously corrupted, trying
      to use it crashes QEMU since we end up with a null s->refcount_table
      after qcow2_refcount_init().
      
      These images can however be repaired, so allow opening them if the
      BDRV_O_CHECK flag is set.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: f9750f50c80359babba11062e88f5075a47e8e16.1509718618.git.berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      951053a9
    • A
      qcow2: Prevent allocating compressed clusters at offset 0 · 8aa34834
      Alberto Garcia 提交于
      If the refcount data is corrupted then we can end up trying to
      allocate a new compressed cluster at offset 0 in the image, triggering
      an assertion in qcow2_alloc_bytes() that would crash QEMU:
      
        qcow2_alloc_bytes: Assertion `offset' failed.
      
      This patch adds an explicit check for this scenario and a new test
      case.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Message-id: fb53467cf48e95ff3330def1cf1003a5b862b7d9.1509718618.git.berto@igalia.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      8aa34834
    • A
      qcow2: Prevent allocating L2 tables at offset 0 · 98839750
      Alberto Garcia 提交于
      If the refcount data is corrupted then we can end up trying to
      allocate a new L2 table at offset 0 in the image, triggering an
      assertion in the qcow2 cache that would crash QEMU:
      
        qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed
      
      This patch adds an explicit check for this scenario and a new test
      case.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 92dac37191ae7844a2da22c122204eb493cc3133.1509718618.git.berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      98839750
    • A
      qcow2: Prevent allocating refcount blocks at offset 0 · 6bf45d59
      Alberto Garcia 提交于
      Each entry in the qcow2 cache contains an offset field indicating the
      location of the data in the qcow2 image. If the offset is 0 then it
      means that the entry contains no data and is available to be used when
      needed.
      
      Because of that it is not possible to store in the cache the first
      cluster of the qcow2 image (offset = 0). This is not a problem because
      that cluster always contains the qcow2 header and we're not using this
      cache for that.
      
      However, if the qcow2 image is corrupted it can happen that we try to
      allocate a new refcount block at offset 0, triggering this assertion
      and crashing QEMU:
      
        qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed
      
      This patch adds an explicit check for this scenario and a new test
      case.
      
      This problem was originally reported here:
      
         https://bugs.launchpad.net/qemu/+bug/1728615Reported-by: NR.Nageswara Sastry <nasastry@in.ibm.com>
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 92a2fadd10d58b423f269c1d1a309af161cdc73f.1509718618.git.berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      6bf45d59
  4. 13 11月, 2017 1 次提交
    • A
      qemu-iotests: Test I/O limits with removable media · 07615626
      Alberto Garcia 提交于
      This test hotplugs a CD drive to a VM and checks that I/O limits can
      be set only when the drive has media inserted and that they are kept
      when the media is replaced.
      
      This also tests the removal of a device with valid I/O limits set but
      no media inserted. This involves deleting and disabling the limits
      of a BlockBackend without BlockDriverState, a scenario that has been
      crashing until the fixes from the last couple of patches.
      
      [Python PEP8 fixup: "Don't use spaces are the = sign when used to
      indicate a keyword argument or a default parameter value"
      --Stefan]
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 071eb397118ed207c5a7f01d58766e415ee18d6a.1510339534.git.berto@igalia.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      07615626
  5. 10 11月, 2017 1 次提交
    • E
      nbd-client: Refuse read-only client with BDRV_O_RDWR · 1104d83c
      Eric Blake 提交于
      The NBD spec says that clients should not try to write/trim to
      an export advertised as read-only by the server.  But we failed
      to check that, and would allow the block layer to use NBD with
      BDRV_O_RDWR even when the server is read-only, which meant we
      were depending on the server sending a proper EPERM failure for
      various commands, and also exposes a leaky abstraction: using
      qemu-io in read-write mode would succeed on 'w -z 0 0' because
      of local short-circuiting logic, but 'w 0 0' would send a
      request over the wire (where it then depends on the server, and
      fails at least for qemu-nbd but might pass for other NBD
      implementations).
      
      With this patch, a client MUST request read-only mode to access
      a server that is doing a read-only export, or else it will get
      a message like:
      
      can't open device nbd://localhost:10809/foo: request for write access conflicts with read-only export
      
      It is no longer possible to even attempt writes over the wire
      (including the corner case of 0-length writes), because the block
      layer enforces the explicit read-only request; this matches the
      behavior of qcow2 when backed by a read-only POSIX file.
      
      Fix several iotests to comply with the new behavior (since
      qemu-nbd of an internal snapshot, as well as nbd-server-add over QMP,
      default to a read-only export, we must tell blockdev-add/qemu-io to
      set up a read-only client).
      
      CC: qemu-stable@nongnu.org
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20171108215703.9295-3-eblake@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      1104d83c
  6. 08 11月, 2017 4 次提交
    • T
      tests: Run the luks tests in test-crypto-block only if encryption is available · b417a762
      Thomas Huth 提交于
      The test-crypto-block currently fails if encryption has not been
      compiled into QEMU:
      
      TEST: tests/test-crypto-block... (pid=22231)
        /crypto/block/qcow:                                                  OK
        /crypto/block/luks/default:
        Unexpected error in qcrypto_pbkdf2() at qemu/crypto/pbkdf-stub.c:41:
      FAIL
      GTester: last random seed: R02Sbbb5b6f299c6727f41bb50ba4aa6ef5c
      (pid=22237)
        /crypto/block/luks/aes-256-cbc-plain64:
        Unexpected error in qcrypto_pbkdf2() at qemu/crypto/pbkdf-stub.c:41:
      FAIL
      GTester: last random seed: R02S3e27992a5ab4cc95e141c4ed3c7f0d2e
      (pid=22239)
        /crypto/block/luks/aes-256-cbc-essiv:
        Unexpected error in qcrypto_pbkdf2() at qemu/crypto/pbkdf-stub.c:41:
      FAIL
      GTester: last random seed: R02S51b52bb02a66c42d8b331fd305384f53
      (pid=22241)
      FAIL: tests/test-crypto-block
      
      So run the luks test only if the required encryption support is available.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b417a762
    • S
      tests-aio-multithread: fix /aio/multi/schedule race condition · fb0c43f3
      Stefan Hajnoczi 提交于
      test_multi_co_schedule_entry() set to_schedule[id] in the final loop
      iteration before terminating the coroutine.  There is a race condition
      where the main thread attempts to enter the terminating or terminated
      coroutine when signalling coroutines to stop:
      
        atomic_mb_set(&now_stopping, true);
        for (i = 0; i < NUM_CONTEXTS; i++) {
            ctx_run(i, finish_cb, NULL);  <--- enters dead coroutine!
            to_schedule[i] = NULL;
        }
      
      Make sure only to set to_schedule[id] if this coroutine really needs to
      be scheduled!
      Reported-by: N"R.Nageswara Sastry" <nasastry@in.ibm.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 20171106190233.1175-1-stefanha@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      fb0c43f3
    • P
      docker: correctly escape $BACKEND in the help output · 6423795e
      Philippe Mathieu-Daudé 提交于
      In Makefiles the $ must be escaped as $$ in shell uses.
      
      Since 8a2390a4:
      
       $ make docker
           [...]
           NETWORK=1            Enable virtual network interface with default backend.
           NETWORK=ACKEND     Enable virtual network interface with ACKEND.
      
      Once escaped:
      
       $ make docker
           [...]
           NETWORK=1            Enable virtual network interface with default backend.
           NETWORK=$BACKEND     Enable virtual network interface with $BACKEND.
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-Id: <20171108024719.8389-1-f4bug@amsat.org>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      6423795e
    • F
      docker: Improved image checksum · c1958e9d
      Fam Zheng 提交于
      When a base image locally defined by QEMU, such as in the debian images,
      is updated, the dockerfile checksum mechanism in docker.py still skips
      updating the derived image, because it only looks at the literal content
      of the dockerfile, without considering changes to the base image.
      
      For example we have a recent fix e58c1f9b that fixed
      debian-win64-cross by updating its base image, debian8-mxe, but due to
      above "feature" of docker.py the image in question is automatically NOT
      rebuilt unless you add NOCACHE=1. It is noticed on Shippable:
      
      https://app.shippable.com/github/qemu/qemu/runs/541/2/console
      
      because after the fix is merged, the error still occurs, and the log
      shows the container image is, as explained above, not updated.
      
      This is because at the time docker.py was written, there wasn't any
      dependencies between QEMU's docker images.
      
      Now improve this to preprocess any "FROM qemu:*" directives in the
      dockerfiles while doing checksum, and inline the base image's dockerfile
      content, recursively. This ensures any changes on the depended _QEMU_
      images are taken into account.
      
      This means for external images that we expect to retrieve from docker
      registries, we still do it as before. It is not perfect, because
      registry images can get updated too. Technically we could substitute the
      image name with its hex ID as obtained with $(docker images $IMAGE
      --format="{{.Id}}"), but --format is not supported by RHEL 7, so leave
      it for now.
      Reported-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-Id: <20171103131229.4737-1-famz@redhat.com>
      Tested-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      c1958e9d
  7. 02 11月, 2017 1 次提交
    • P
      docker: add python stdlib dependency (required by keycodemapdb) · e58c1f9b
      Philippe Mathieu-Daudé 提交于
      Since 92712822 QEMU depends of keycodemapdb, which uses the python 'csv'
      module from stdlib to parse keymaps.csv.
      
      Without this package the build fails:
      
          GEN     ui/input-keymap-linux-to-qcode.c
        Traceback (most recent call last):
          File "ui/keycodemapdb/tools/keymap-gen", line 15, in <module>
            import csv
        ImportError: No module named csv
          GEN     ui/input-keymap-qcode-to-qnum.c
        Traceback (most recent call last):
          File "ui/keycodemapdb/tools/keymap-gen", line 15, in <module>
            import csv
        ImportError: No module named csv
        [...]
          CC      ui/input-keymap.o
        ui/input-keymap.c:8:44: fatal error: ui/input-keymap-linux-to-qcode.c: No such file or directory
        make: *** [ui/input-keymap.o] Error 1
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      e58c1f9b
  8. 31 10月, 2017 1 次提交
  9. 29 10月, 2017 5 次提交
  10. 26 10月, 2017 7 次提交
  11. 25 10月, 2017 1 次提交
  12. 20 10月, 2017 2 次提交