1. 20 3月, 2018 1 次提交
  2. 19 3月, 2018 13 次提交
    • 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
    • L
      block/mirror: change the semantic of 'force' of block-job-cancel · b76e4458
      Liang Li 提交于
      When doing drive mirror to a low speed shared storage, if there was heavy
      BLK IO write workload in VM after the 'ready' event, drive mirror block job
      can't be canceled immediately, it would keep running until the heavy BLK IO
      workload stopped in the VM.
      
      Libvirt depends on the current block-job-cancel semantics, which is that
      when used without a flag after the 'ready' event, the command blocks
      until data is in sync.  However, these semantics are awkward in other
      situations, for example, people may use drive mirror for realtime
      backups while still wanting to use block live migration.  Libvirt cannot
      start a block live migration while another drive mirror is in progress,
      but the user would rather abandon the backup attempt as broken and
      proceed with the live migration than be stuck waiting for the current
      drive mirror backup to finish.
      
      The drive-mirror command already includes a 'force' flag, which libvirt
      does not use, although it documented the flag as only being useful to
      quit a job which is paused.  However, since quitting a paused job has
      the same effect as abandoning a backup in a non-paused job (namely, the
      destination file is not in sync, and the command completes immediately),
      we can just improve the documentation to make the force flag obviously
      useful.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Jeff Cody <jcody@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: Eric Blake <eblake@redhat.com>
      Cc: John Snow <jsnow@redhat.com>
      Reported-by: NHuaitong Han <huanhuaitong@didichuxing.com>
      Signed-off-by: NHuaitong Han <huanhuaitong@didichuxing.com>
      Signed-off-by: NLiang Li <liliangleo@didichuxing.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b76e4458
    • 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
      tests/test-blockjob: test cancellations · fb367e03
      John Snow 提交于
      Whatever the state a blockjob is in, it should be able to be canceled
      by the block layer.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      fb367e03
    • 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
      blockjobs: add block_job_verb permission table · 0ec4dfb8
      John Snow 提交于
      Which commands ("verbs") are appropriate for jobs in which state is
      also somewhat burdensome to keep track of.
      
      As of this commit, it looks rather useless, but begins to look more
      interesting the more states we add to the STM table.
      
      A recurring theme is that no verb will apply to an 'undefined' job.
      
      Further, it's not presently possible to restrict the "pause" or "resume"
      verbs any more than they are in this commit because of the asynchronous
      nature of how jobs enter the PAUSED state; justifications for some
      seemingly erroneous applications are given below.
      
      =====
      Verbs
      =====
      
      Cancel:    Any state except undefined.
      Pause:     Any state except undefined;
                 'created': Requests that the job pauses as it starts.
                 'running': Normal usage. (PAUSED)
                 'paused':  The job may be paused for internal reasons,
                            but the user may wish to force an indefinite
                            user-pause, so this is allowed.
                 'ready':   Normal usage. (STANDBY)
                 'standby': Same logic as above.
      Resume:    Any state except undefined;
                 'created': Will lift a user's pause-on-start request.
                 'running': Will lift a pause request before it takes effect.
                 'paused':  Normal usage.
                 'ready':   Will lift a pause request before it takes effect.
                 'standby': Normal usage.
      Set-speed: Any state except undefined, though ready may not be meaningful.
      Complete:  Only a 'ready' job may accept a complete request.
      
      =======
      Changes
      =======
      
      (1)
      
      To facilitate "nice" error checking, all five major block-job verb
      interfaces in blockjob.c now support an errp parameter:
      
      - block_job_user_cancel is added as a new interface.
      - block_job_user_pause gains an errp paramter
      - block_job_user_resume gains an errp parameter
      - block_job_set_speed already had an errp parameter.
      - block_job_complete already had an errp parameter.
      
      (2)
      
      block-job-pause and block-job-resume will no longer no-op when trying
      to pause an already paused job, or trying to resume a job that isn't
      paused. These functions will now report that they did not perform the
      action requested because it was not possible.
      
      iotests have been adjusted to address this new behavior.
      
      (3)
      
      block-job-complete doesn't worry about checking !block_job_started,
      because the permission table guards against this.
      
      (4)
      
      test-bdrv-drain's job implementation needs to announce that it is
      'ready' now, in order to be completed.
      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>
      0ec4dfb8
    • 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
    • J
      blockjobs: model single jobs as transactions · 75859b94
      John Snow 提交于
      model all independent jobs as single job transactions.
      
      It's one less case we have to worry about when we add more states to the
      transition machine. This way, we can just treat all job lifetimes exactly
      the same. This helps tighten assertions of the STM graph and removes some
      conditionals that would have been needed in the coming commits adding a
      more explicit job lifetime management API.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      75859b94
  3. 18 3月, 2018 1 次提交
  4. 14 3月, 2018 16 次提交
  5. 13 3月, 2018 2 次提交
  6. 12 3月, 2018 3 次提交
  7. 10 3月, 2018 1 次提交
  8. 09 3月, 2018 3 次提交
    • S
      qemu-iotests: fix 203 migration completion race · 21794244
      Stefan Hajnoczi 提交于
      There is a race between the test's 'query-migrate' QMP command after the
      QMP 'STOP' event and completing the migration:
      
      The test case invokes 'query-migrate' upon receiving 'STOP'.  At this
      point the migration thread may still be in the process of completing.
      Therefore 'query-migrate' can return 'status': 'active' for a brief
      window of time instead of 'status': 'completed'.  This results in
      qemu-iotests 203 hanging.
      
      Solve the race by enabling the 'events' migration capability, which
      causes QEMU to emit migration-specific QMP events that do not suffer
      from this race condition.  Wait for the QMP 'MIGRATION' event with
      'status': 'completed'.
      Reported-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20180305155926.25858-1-stefanha@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      21794244
    • A
      iotests: Tweak 030 in order to trigger a race condition with parallel jobs · 39eaefce
      Alberto Garcia 提交于
      This patch tweaks TestParallelOps in iotest 030 so it allocates data
      in smaller regions (256KB/512KB instead of 512KB/1MB) and the
      block-stream job in test_stream_commit() only needs to copy data that
      is at the very end of the image.
      
      This way when the block-stream job is awakened it will finish right
      away without any chance of being stopped by block_job_sleep_ns(). This
      triggers the bug that was fixed by 3d5d319e and
      1a63a907 and is therefore a more useful test
      case for parallel block jobs.
      
      After this patch the aforementiond bug can also be reproduced with the
      test_stream_parallel() test case.
      
      Since with this change the stream job in test_stream_commit() finishes
      early, this patch introduces a similar test case where both jobs are
      slowed down so they can actually run in parallel.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Cc: John Snow <jsnow@redhat.com>
      Message-id: 20180306130121.30243-1-berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      39eaefce
    • F
      iotests: Skip test for ENOMEM error · 0bfed484
      Fam Zheng 提交于
      The AFL image is to exercise the code validating image size, which
      doesn't work on 32 bit or when out of memory (there is a large
      allocation before the interesting point). So check that and skip the
      test, instead of faking the result.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 20180301011413.11531-1-famz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      0bfed484