1. 03 4月, 2018 4 次提交
  2. 27 3月, 2018 1 次提交
  3. 26 3月, 2018 7 次提交
    • K
      qemu-iotests: Test vhdx image creation with QMP · 0b7e7f66
      Kevin Wolf 提交于
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0b7e7f66
    • K
      qemu-iotests: Test parallels image creation with QMP · e8f6ea6f
      Kevin Wolf 提交于
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e8f6ea6f
    • K
      qemu-iotests: Test invalid resize on luks · 50880f25
      Kevin Wolf 提交于
      This tests that the .bdrv_truncate implementation for luks doesn't crash
      for invalid image sizes.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      50880f25
    • K
      qemu-iotests: Enable 025 for luks · 633c175f
      Kevin Wolf 提交于
      We want to test resizing even for luks. The only change that is needed
      is to explicitly zero out new space for luks because it's undefined.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      633c175f
    • K
      qemu-iotests: Test vdi image creation with QMP · b7de0777
      Kevin Wolf 提交于
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      b7de0777
    • A
      qcow2: Reset free_cluster_index when allocating a new refcount block · abf754fe
      Alberto Garcia 提交于
      When we try to allocate new clusters we first look for available ones
      starting from s->free_cluster_index and once we find them we increase
      their reference counts. Before we get to call update_refcount() to do
      this last step s->free_cluster_index is already pointing to the next
      cluster after the ones we are trying to allocate.
      
      During update_refcount() it may happen however that we also need to
      allocate a new refcount block in order to store the refcounts of these
      new clusters (and to complicate things further that may also require
      us to grow the refcount table). After all this we don't know if the
      clusters that we originally tried to allocate are still available, so
      we return -EAGAIN to ask the caller to restart the search for free
      clusters.
      
      This is what can happen in a common scenario:
      
        1) We want to allocate a new cluster and we see that cluster N is
           free.
      
        2) We try to increase N's refcount but all refcount blocks are full,
           so we allocate a new one at N+1 (where s->free_cluster_index was
           pointing at).
      
        3) Once we're done we return -EAGAIN to look again for a free
           cluster, but now s->free_cluster_index points at N+2, so that's
           the one we allocate. Cluster N remains unallocated and we have a
           hole in the qcow2 file.
      
      This can be reproduced easily:
      
           qemu-img create -f qcow2 -o cluster_size=512 hd.qcow2 1M
           qemu-io -c 'write 0 124k' hd.qcow2
      
      After this the image has 132608 bytes (256 clusters), and the refcount
      block is full. If we write 512 more bytes it should allocate two new
      clusters: the data cluster itself and a new refcount block.
      
           qemu-io -c 'write 124k 512' hd.qcow2
      
      However the image has now three new clusters (259 in total), and the
      first one of them is empty (and unallocated):
      
           dd if=hd.qcow2 bs=512c skip=256 count=1 | hexdump -C
      
      If we write larger amounts of data in the last step instead of the 512
      bytes used in this example we can create larger holes in the qcow2
      file.
      
      What this patch does is reset s->free_cluster_index to its previous
      value when alloc_refcount_block() returns -EAGAIN. This way the caller
      will try to allocate again the original clusters if they are still
      free.
      
      The output of iotest 026 also needs to be updated because now that
      images have no holes some tests fail at a different point and the
      number of leaked clusters is different.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      abf754fe
    • E
      iotests: 163 is not quick · 71b74b25
      Eric Blake 提交于
      Testing on ext4, most 'quick' qcow2 tests took less than 5 seconds,
      but 163 took more than 20.  Let's remove it from the quick set.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      71b74b25
  4. 20 3月, 2018 1 次提交
  5. 19 3月, 2018 9 次提交
    • E
      iotests: Avoid realpath, for CentOS 6 · 63ca8406
      Eric Blake 提交于
      CentOS 6 lacks a realpath binary on the base install, which makes
      all iotests runs fail since the 2.11 release:
      
      001         - output mismatch (see 001.out.bad)
      ./check: line 815: realpath: command not found
      diff: missing operand after `/home/dummy/qemu/tests/qemu-iotests/001.out'
      diff: Try `diff --help' for more information.
      
      Many of the uses of 'realpath' in the check script were being
      used on the output of 'type -p' - but that is already an
      absolute file name.  While a canonical name can often be
      shorter (realpath gets rid of /../), it can also be longer (due
      to symlink expansion); and we really don't care if the name is
      canonical, merely that it was an executable file with an
      absolute path.  These were broken in commit cceaf1db.
      
      The remaining use of realpath was to convert a possibly relative
      filename into an absolute one before calling diff to make it
      easier to copy-and-paste the filename for moving the .bad file
      into place as the new reference file even when running iotests
      out-of-tree (see commit 93e53fb6), but $PWD can achieve the same
      purpose.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      63ca8406
    • J
      block: fix iotest 146 output expectations · 181bb882
      Jeff Cody 提交于
      Commit bff55548 added "force_size" into the common.filter for
      _filter_img_create(), but test 146 still expects it in the output.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      181bb882
    • K
      qemu-iotests: Enable write tests for parallels · e1473133
      Kevin Wolf 提交于
      Originally we added parallels as a read-only format to qemu-iotests
      where we did just some tests with a binary image. Since then, write and
      image creation support has been added to the driver, so we can now
      enable it in _supported_fmt generic.
      
      The driver doesn't support migration yet, though, so we need to add it
      to the list of exceptions in 181.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      e1473133
    • F
      iotests: Add regression test for commit base locking · de963500
      Fam Zheng 提交于
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      de963500
    • K
      qemu-iotests: Test luks QMP image creation · d06195e6
      Kevin Wolf 提交于
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      d06195e6
    • J
      iotests: test manual job dismissal · 6d8be967
      John Snow 提交于
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6d8be967
    • J
      blockjobs: Expose manual property · b40dacdc
      John Snow 提交于
      Expose the "manual" property via QAPI for the backup-related jobs.
      As of this commit, this allows the management API to request the
      "concluded" and "dismiss" semantics for backup jobs.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b40dacdc
    • J
      iotests: add pause_wait · f03d9d24
      John Snow 提交于
      Split out the pause command into the actual pause and the wait.
      Not every usage presently needs to resubmit a pause request.
      
      The intent with the next commit will be to explicitly disallow
      redundant or meaningless pause/resume requests, so the tests
      need to become more judicious to reflect that.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f03d9d24
    • J
      blockjobs: add status enum · 58b295ba
      John Snow 提交于
      We're about to add several new states, and booleans are becoming
      unwieldly and difficult to reason about. It would help to have a
      more explicit bookkeeping of the state of blockjobs. To this end,
      add a new "status" field and add our existing states in a redundant
      manner alongside the bools they are replacing:
      
      UNDEFINED: Placeholder, default state. Not currently visible to QMP
                 unless changes occur in the future to allow creating jobs
                 without starting them via QMP.
      CREATED:   replaces !!job->co && paused && !busy
      RUNNING:   replaces effectively (!paused && busy)
      PAUSED:    Nearly redundant with info->paused, which shows pause_count.
                 This reports the actual status of the job, which almost always
                 matches the paused request status. It differs in that it is
                 strictly only true when the job has actually gone dormant.
      READY:     replaces job->ready.
      STANDBY:   Paused, but job->ready is true.
      
      New state additions in coming commits will not be quite so redundant:
      
      WAITING:   Waiting on transaction. This job has finished all the work
                 it can until the transaction converges, fails, or is canceled.
      PENDING:   Pending authorization from user. This job has finished all the
                 work it can until the job or transaction is finalized via
                 block_job_finalize. This implies the transaction has converged
                 and left the WAITING phase.
      ABORTING:  Job has encountered an error condition and is in the process
                 of aborting.
      CONCLUDED: Job has ceased all operations and has a return code available
                 for query and may be dismissed via block_job_dismiss.
      NULL:      Job has been dismissed and (should) be destroyed. Should never
                 be visible to QMP.
      
      Some of these states appear somewhat superfluous, but it helps define the
      expected flow of a job; so some of the states wind up being synchronous
      empty transitions. Importantly, jobs can be in only one of these states
      at any given time, which helps code and external users alike reason about
      the current condition of a job unambiguously.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      58b295ba
  6. 14 3月, 2018 7 次提交
  7. 09 3月, 2018 11 次提交