1. 19 3月, 2018 27 次提交
    • 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
    • K
      luks: Catch integer overflow for huge sizes · 3d7ed9c4
      Kevin Wolf 提交于
      When you request an image size close to UINT64_MAX, the addition of the
      crypto header may cause an integer overflow. Catch it instead of
      silently truncating the image size.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      3d7ed9c4
    • K
      luks: Turn invalid assertion into check · e39e959e
      Kevin Wolf 提交于
      The .bdrv_getlength implementation of the crypto block driver asserted
      that the payload offset isn't after EOF. This is an invalid assertion to
      make as the image file could be corrupted. Instead, check it and return
      -EIO if the file is too small for the payload offset.
      
      Zero length images are fine, so trigger -EIO only on offset > len, not
      on offset >= len as the assertion did before.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      e39e959e
    • K
      luks: Support .bdrv_co_create · 1bedcaf1
      Kevin Wolf 提交于
      This adds the .bdrv_co_create driver callback to luks, which enables
      image creation over QMP.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      1bedcaf1
    • K
      luks: Create block_crypto_co_create_generic() · 1ec4f416
      Kevin Wolf 提交于
      Everything that refers to the protocol layer or QemuOpts is moved out of
      block_crypto_create_generic(), so that the remaining function is
      suitable to be called by a .bdrv_co_create implementation.
      
      LUKS is the only driver that actually implements the old interface, and
      we don't intend to use it in any new drivers, so put the moved out code
      directly into a LUKS function rather than creating a generic
      intermediate one.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      1ec4f416
    • K
      luks: Separate image file creation from formatting · 3b5a1f6a
      Kevin Wolf 提交于
      The crypto driver used to create the image file in a callback from the
      crypto subsystem. If we want to implement .bdrv_co_create, this needs to
      go away because that callback will get a reference to an already
      existing block node.
      
      Move the image file creation to block_crypto_create_generic().
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      3b5a1f6a
    • 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-finalize · 11b61fbc
      John Snow 提交于
      Instead of automatically transitioning from PENDING to CONCLUDED, gate
      the .prepare() and .commit() phases behind an explicit acknowledgement
      provided by the QMP monitor if auto_finalize = false has been requested.
      
      This allows us to perform graph changes in prepare and/or commit so that
      graph changes do not occur autonomously without knowledge of the
      controlling management layer.
      
      Transactions that have reached the "PENDING" state together can all be
      moved to invoke their finalization methods by issuing block_job_finalize
      to any one job in the transaction.
      
      Jobs in a transaction with mixed job->auto_finalize settings will all
      remain stuck in the "PENDING" state, as if the entire transaction was
      specified with auto_finalize = false. Jobs that specified
      auto_finalize = true, however, will still not emit the PENDING event.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      11b61fbc
    • J
      blockjobs: add PENDING status and event · 5f241594
      John Snow 提交于
      For jobs utilizing the new manual workflow, we intend to prohibit
      them from modifying the block graph until the management layer provides
      an explicit ACK via block-job-finalize to move the process forward.
      
      To distinguish this runstate from "ready" or "waiting," we add a new
      "pending" event and status.
      
      For now, the transition from PENDING to CONCLUDED/ABORTING is automatic,
      but a future commit will add the explicit block-job-finalize step.
      
      Transitions:
      Waiting -> Pending:   Normal transition.
      Pending -> Concluded: Normal transition.
      Pending -> Aborting:  Late transactional failures and cancellations.
      
      Removed Transitions:
      Waiting -> Concluded: Jobs must go to PENDING first.
      
      Verbs:
      Cancel: Can be applied to a pending job.
      
                   +---------+
                   |UNDEFINED|
                   +--+------+
                      |
                   +--v----+
         +---------+CREATED+-----------------+
         |         +--+----+                 |
         |            |                      |
         |         +--+----+     +------+    |
         +---------+RUNNING<----->PAUSED|    |
         |         +--+-+--+     +------+    |
         |            | |                    |
         |            | +------------------+ |
         |            |                    | |
         |         +--v--+       +-------+ | |
         +---------+READY<------->STANDBY| | |
         |         +--+--+       +-------+ | |
         |            |                    | |
         |         +--v----+               | |
         +---------+WAITING<---------------+ |
         |         +--+----+                 |
         |            |                      |
         |         +--v----+                 |
         +---------+PENDING|                 |
         |         +--+----+                 |
         |            |                      |
      +--v-----+   +--v------+               |
      |ABORTING+--->CONCLUDED|               |
      +--------+   +--+------+               |
                      |                      |
                   +--v-+                    |
                   |NULL<--------------------+
                   +----+
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5f241594
    • J
      blockjobs: add waiting status · e8af5686
      John Snow 提交于
      For jobs that are stuck waiting on others in a transaction, it would
      be nice to know that they are no longer "running" in that sense, but
      instead are waiting on other jobs in the transaction.
      
      Jobs that are "waiting" in this sense cannot be meaningfully altered
      any longer as they have left their running loop. The only meaningful
      user verb for jobs in this state is "cancel," which will cancel the
      whole transaction, too.
      
      Transitions:
      Running -> Waiting:   Normal transition.
      Ready   -> Waiting:   Normal transition.
      Waiting -> Aborting:  Transactional cancellation.
      Waiting -> Concluded: Normal transition.
      
      Removed Transitions:
      Running -> Concluded: Jobs must go to WAITING first.
      Ready   -> Concluded: Jobs must go to WAITING first.
      
      Verbs:
      Cancel: Can be applied to WAITING jobs.
      
                   +---------+
                   |UNDEFINED|
                   +--+------+
                      |
                   +--v----+
         +---------+CREATED+-----------------+
         |         +--+----+                 |
         |            |                      |
         |         +--v----+     +------+    |
         +---------+RUNNING<----->PAUSED|    |
         |         +--+-+--+     +------+    |
         |            | |                    |
         |            | +------------------+ |
         |            |                    | |
         |         +--v--+       +-------+ | |
         +---------+READY<------->STANDBY| | |
         |         +--+--+       +-------+ | |
         |            |                    | |
         |         +--v----+               | |
         +---------+WAITING<---------------+ |
         |         +--+----+                 |
         |            |                      |
      +--v-----+   +--v------+               |
      |ABORTING+--->CONCLUDED|               |
      +--------+   +--+------+               |
                      |                      |
                   +--v-+                    |
                   |NULL<--------------------+
                   +----+
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e8af5686
    • J
      blockjobs: add prepare callback · 2da4617a
      John Snow 提交于
      Some jobs upon finalization may need to perform some work that can
      still fail. If these jobs are part of a transaction, it's important
      that these callbacks fail the entire transaction.
      
      We allow for a new callback in addition to commit/abort/clean that
      allows us the opportunity to have fairly late-breaking failures
      in the transactional process.
      
      The expected flow is:
      
      - All jobs in a transaction converge to the PENDING state,
        added in a forthcoming commit.
      - Upon being finalized, either automatically or explicitly
        by the user, jobs prepare to complete.
      - If any job fails preparation, all jobs call .abort.
      - Otherwise, they succeed and call .commit.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2da4617a
    • J
      blockjobs: add block_job_txn_apply function · efe4d4b7
      John Snow 提交于
      Simply apply a function transaction-wide.
      A few more uses of this in forthcoming patches.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      efe4d4b7
    • J
      blockjobs: add commit, abort, clean helpers · 43628d93
      John Snow 提交于
      The completed_single function is getting a little mucked up with
      checking to see which callbacks exist, so let's factor them out.
      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>
      43628d93
    • J
      blockjobs: ensure abort is called for cancelled jobs · 35d6b368
      John Snow 提交于
      Presently, even if a job is canceled post-completion as a result of
      a failing peer in a transaction, it will still call .commit because
      nothing has updated or changed its return code.
      
      The reason why this does not cause problems currently is because
      backup's implementation of .commit checks for cancellation itself.
      
      I'd like to simplify this contract:
      
      (1) Abort is called if the job/transaction fails
      (2) Commit is called if the job/transaction succeeds
      
      To this end: A job's return code, if 0, will be forcibly set as
      -ECANCELED if that job has already concluded. Remove the now
      redundant check in the backup job implementation.
      
      We need to check for cancellation in both block_job_completed
      AND block_job_completed_single, because jobs may be cancelled between
      those two calls; for instance in transactions. This also necessitates
      an ABORTING -> ABORTING transition to be allowed.
      
      The check in block_job_completed could be removed, but there's no
      point in starting to attempt to succeed a transaction that we know
      in advance will fail.
      
      This does NOT affect mirror jobs that are "canceled" during their
      synchronous phase. The mirror job itself forcibly sets the canceled
      property to false prior to ceding control, so such cases will invoke
      the "commit" callback.
      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>
      35d6b368
    • J
      blockjobs: add block_job_dismiss · 75f71059
      John Snow 提交于
      For jobs that have reached their CONCLUDED state, prior to having their
      last reference put down (meaning jobs that have completed successfully,
      unsuccessfully, or have been canceled), allow the user to dismiss the
      job's lingering status report via block-job-dismiss.
      
      This gives management APIs the chance to conclusively determine if a job
      failed or succeeded, even if the event broadcast was missed.
      
      Note: block_job_do_dismiss and block_job_decommission happen to do
      exactly the same thing, but they're called from different semantic
      contexts, so both aliases are kept to improve readability.
      
      Note 2: Don't worry about the 0x04 flag definition for AUTO_DISMISS, she
      has a friend coming in a future patch to fill the hole where 0x02 is.
      
      Verbs:
      Dismiss: operates on CONCLUDED jobs only.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      75f71059
    • J
      blockjobs: add NULL state · 3925cd3b
      John Snow 提交于
      Add a new state that specifically demarcates when we begin to permanently
      demolish a job after it has performed all work. This makes the transition
      explicit in the STM table and highlights conditions under which a job may
      be demolished.
      
      Alongside this state, add a new helper command "block_job_decommission",
      which transitions to the NULL state and puts down our implicit reference.
      This separates instances in the code for "block_job_unref" which merely
      undo a matching "block_job_ref" with instances intended to initiate the
      full destruction of the object.
      
      This decommission action also sets a number of fields to make sure that
      block internals or external users that are holding a reference to a job
      to see when it "finishes" are convinced that the job object is "done."
      This is necessary, for instance, to do a block_job_cancel_sync on a
      created object which will not make any progress.
      
      Now, all jobs must go through block_job_decommission prior to being
      freed, giving us start-to-finish state machine coverage for jobs.
      
      Transitions:
      Created   -> Null: Early failure event before the job is started
      Concluded -> Null: Standard transition.
      
      Verbs:
      None. This should not ever be visible to the monitor.
      
                   +---------+
                   |UNDEFINED|
                   +--+------+
                      |
                   +--v----+
         +---------+CREATED+------------------+
         |         +--+----+                  |
         |            |                       |
         |         +--v----+     +------+     |
         +---------+RUNNING<----->PAUSED|     |
         |         +--+-+--+     +------+     |
         |            | |                     |
         |            | +------------------+  |
         |            |                    |  |
         |         +--v--+       +-------+ |  |
         +---------+READY<------->STANDBY| |  |
         |         +--+--+       +-------+ |  |
         |            |                    |  |
      +--v-----+   +--v------+             |  |
      |ABORTING+--->CONCLUDED<-------------+  |
      +--------+   +--+------+                |
                      |                       |
                   +--v-+                     |
                   |NULL<---------------------+
                   +----+
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      3925cd3b
    • J
      blockjobs: add CONCLUDED state · e0cf0364
      John Snow 提交于
      add a new state "CONCLUDED" that identifies a job that has ceased all
      operations. The wording was chosen to avoid any phrasing that might
      imply success, error, or cancellation. The task has simply ceased all
      operation and can never again perform any work.
      
      ("finished", "done", and "completed" might all imply success.)
      
      Transitions:
      Running  -> Concluded: normal completion
      Ready    -> Concluded: normal completion
      Aborting -> Concluded: error and cancellations
      
      Verbs:
      None as of this commit. (a future commit adds 'dismiss')
      
                   +---------+
                   |UNDEFINED|
                   +--+------+
                      |
                   +--v----+
         +---------+CREATED|
         |         +--+----+
         |            |
         |         +--v----+     +------+
         +---------+RUNNING<----->PAUSED|
         |         +--+-+--+     +------+
         |            | |
         |            | +------------------+
         |            |                    |
         |         +--v--+       +-------+ |
         +---------+READY<------->STANDBY| |
         |         +--+--+       +-------+ |
         |            |                    |
      +--v-----+   +--v------+             |
      |ABORTING+--->CONCLUDED<-------------+
      +--------+   +---------+
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e0cf0364
    • J
      blockjobs: add ABORTING state · 10a3fbb0
      John Snow 提交于
      Add a new state ABORTING.
      
      This makes transitions from normative states to error states explicit
      in the STM, and serves as a disambiguation for which states may complete
      normally when normal end-states (CONCLUDED) are added in future commits.
      
      Notably, Paused/Standby jobs do not transition directly to aborting,
      as they must wake up first and cooperate in their cancellation.
      
      Transitions:
      Created -> Aborting: can be cancelled (by the system)
      Running -> Aborting: can be cancelled or encounter an error
      Ready   -> Aborting: can be cancelled or encounter an error
      
      Verbs:
      None. The job must finish cleaning itself up and report its final status.
      
                   +---------+
                   |UNDEFINED|
                   +--+------+
                      |
                   +--v----+
         +---------+CREATED|
         |         +--+----+
         |            |
         |         +--v----+     +------+
         +---------+RUNNING<----->PAUSED|
         |         +--+----+     +------+
         |            |
         |         +--v--+       +-------+
         +---------+READY<------->STANDBY|
         |         +-----+       +-------+
         |
      +--v-----+
      |ABORTING|
      +--------+
      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>
      10a3fbb0
    • 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 state transition table · c9de4050
      John Snow 提交于
      The state transition table has mostly been implied. We're about to make
      it a bit more complex, so let's make the STM explicit instead.
      
      Perform state transitions with a function that for now just asserts the
      transition is appropriate.
      
      Transitions:
      Undefined -> Created: During job initialization.
      Created   -> Running: Once the job is started.
                            Jobs cannot transition from "Created" to "Paused"
                            directly, but will instead synchronously transition
                            to running to paused immediately.
      Running   -> Paused:  Normal workflow for pauses.
      Running   -> Ready:   Normal workflow for jobs reaching their sync point.
                            (e.g. mirror)
      Ready     -> Standby: Normal workflow for pausing ready jobs.
      Paused    -> Running: Normal resume.
      Standby   -> Ready:   Resume of a Standby job.
      
      +---------+
      |UNDEFINED|
      +--+------+
         |
      +--v----+
      |CREATED|
      +--+----+
         |
      +--v----+     +------+
      |RUNNING<----->PAUSED|
      +--+----+     +------+
         |
      +--v--+       +-------+
      |READY<------->STANDBY|
      +-----+       +-------+
      
      Notably, there is no state presently defined as of this commit that
      deals with a job after the "running" or "ready" states, so this table
      will be adjusted alongside the commits that introduce those states.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c9de4050
    • 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: documentation touchup · 62bfdf0c
      John Snow 提交于
      Trivial; Document what the job creation flags do,
      and some general tidying.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      62bfdf0c
    • 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
    • J
      blockjobs: fix set-speed kick · d4fce188
      John Snow 提交于
      If speed is '0' it's not actually "less than" the previous speed.
      Kick the job in this case too.
      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>
      d4fce188
  2. 17 3月, 2018 7 次提交
  3. 16 3月, 2018 6 次提交
    • P
      Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging · 9cc7d0cf
      Peter Maydell 提交于
      # gpg: Signature made Tue 13 Mar 2018 21:11:43 GMT
      # gpg:                using RSA key 7DEF8106AAFC390E
      # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
      # Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
      #      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E
      
      * remotes/jnsnow/tags/bitmaps-pull-request:
        iotests: add dirty bitmap postcopy test
        iotests: add dirty bitmap migration test
        migration: add postcopy migration of dirty bitmaps
        migration: allow qmp command migrate-start-postcopy for any postcopy
        migration: add is_active_iterate handler
        migration/qemu-file: add qemu_put_counted_string()
        migration: include migrate_dirty_bitmaps in migrate_postcopy
        qapi: add dirty-bitmaps migration capability
        migration: introduce postcopy-only pending
        dirty-bitmap: add locked state
        block/dirty-bitmap: add _locked version of bdrv_reclaim_dirty_bitmap
        block/dirty-bitmap: fix locking in bdrv_reclaim_dirty_bitmap
        block/dirty-bitmap: add bdrv_dirty_bitmap_enable_successor()
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9cc7d0cf
    • P
      Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-03-13-v2' into staging · 475fe457
      Peter Maydell 提交于
      nbd patches for 2018-03-13
      
      - Eric Blake: iotests: Fix stuck NBD process on 33
      - Vladimir Sementsov-Ogievskiy: 0/5 nbd server fixing and refactoring before BLOCK_STATUS
      - Eric Blake: nbd/server: Honor FUA request on NBD_CMD_TRIM
      - Stefan Hajnoczi: 0/2 block: fix nbd-server-stop crash after blockdev-snapshot-sync
      - Vladimir Sementsov-Ogievskiy: nbd block status base:allocation
      
      # gpg: Signature made Tue 13 Mar 2018 20:48:37 GMT
      # gpg:                using RSA key A7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>"
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
      # gpg:                 aka "[jpeg image of size 6874]"
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-nbd-2018-03-13-v2:
        iotests: new test 209 for NBD BLOCK_STATUS
        iotests: add file_path helper
        iotests.py: tiny refactor: move system imports up
        nbd: BLOCK_STATUS for standard get_block_status function: client part
        block/nbd-client: save first fatal error in nbd_iter_error
        nbd: BLOCK_STATUS for standard get_block_status function: server part
        nbd/server: add nbd_read_opt_name helper
        nbd/server: add nbd_opt_invalid helper
        iotests: add 208 nbd-server + blockdev-snapshot-sync test case
        block: let blk_add/remove_aio_context_notifier() tolerate BDS changes
        nbd/server: Honor FUA request on NBD_CMD_TRIM
        nbd/server: refactor nbd_trip: split out nbd_handle_request
        nbd/server: refactor nbd_trip: cmd_read and generic reply
        nbd/server: fix: check client->closing before sending reply
        nbd/server: fix sparse read
        nbd/server: move nbd_co_send_structured_error up
        iotests: Fix stuck NBD process on 33
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      475fe457
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 3788c7b6
      Peter Maydell 提交于
      * Record-replay lockstep execution, log dumper and fixes (Alex, Pavel)
      * SCSI fix to pass maximum transfer size (Daniel Barboza)
      * chardev fixes and improved iothread support (Daniel Berrangé, Peter)
      * checkpatch tweak (Eric)
      * make help tweak (Marc-André)
      * make more PCI NICs available with -net or -nic (myself)
      * change default q35 NIC to e1000e (myself)
      * SCSI support for NDOB bit (myself)
      * membarrier system call support (myself)
      * SuperIO refactoring (Philippe)
      * miscellaneous cleanups and fixes (Thomas)
      
      # gpg: Signature made Mon 12 Mar 2018 16:10:52 GMT
      # gpg:                using RSA key BFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream: (69 commits)
        tcg: fix cpu_io_recompile
        replay: update documentation
        replay: save vmstate of the asynchronous events
        replay: don't process async events when warping the clock
        scripts/replay-dump.py: replay log dumper
        replay: avoid recursive call of checkpoints
        replay: check return values of fwrite
        replay: push replay_mutex_lock up the call tree
        replay: don't destroy mutex at exit
        replay: make locking visible outside replay code
        replay/replay-internal.c: track holding of replay_lock
        replay/replay.c: bump REPLAY_VERSION again
        replay: save prior value of the host clock
        replay: added replay log format description
        replay: fix save/load vm for non-empty queue
        replay: fixed replay_enable_events
        replay: fix processing async events
        cpu-exec: fix exception_index handling
        hw/i386/pc: Factor out the superio code
        hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      
      # Conflicts:
      #	default-configs/i386-softmmu.mak
      #	default-configs/x86_64-softmmu.mak
      3788c7b6
    • P
      Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20180313.0' into staging · a57946ff
      Peter Maydell 提交于
      VFIO updates 2018-03-13
      
       - Display support for vGPUs (Gerd Hoffmann)
      
       - Enable new kernel support for mmaps overlapping MSI-X vector table,
         disable MSI-X emulation on POWER (Alexey Kardashevskiy)
      
      # gpg: Signature made Tue 13 Mar 2018 19:48:49 GMT
      # gpg:                using RSA key 239B9B6E3BB08B22
      # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex@shazbot.org>"
      # gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"
      # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22
      
      * remotes/awilliam/tags/vfio-update-20180313.0:
        ppc/spapr, vfio: Turn off MSIX emulation for VFIO devices
        vfio-pci: Allow mmap of MSIX BAR
        vfio/pci: Relax DMA map errors for MMIO regions
        vfio/display: adding dmabuf support
        vfio/display: adding region support
        vfio/display: core & wireup
        vfio/common: cleanup in vfio_region_finalize
        secondary-vga: properly close QemuConsole on unplug
        console: minimal hotplug suport
        ui/pixman: add qemu_drm_format_to_pixman()
        standard-headers: add drm/drm_fourcc.h
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a57946ff
    • P
      Merge remote-tracking branch 'remotes/berrange/tags/socket-next-pull-request' into staging · 58888f8c
      Peter Maydell 提交于
      # gpg: Signature made Tue 13 Mar 2018 18:12:14 GMT
      # gpg:                using RSA key BE86EBB415104FDF
      # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>"
      # gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>"
      # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF
      
      * remotes/berrange/tags/socket-next-pull-request:
        char: allow passing pre-opened socket file descriptor at startup
        char: refactor parsing of socket address information
        sockets: allow SocketAddress 'fd' to reference numeric file descriptors
        sockets: check that the named file descriptor is a socket
        sockets: move fd_is_socket() into common sockets code
        sockets: strengthen test suite IP protocol availability checks
        sockets: pull code for testing IP availability out of specific test
        cutils: add qemu_strtoi & qemu_strtoui parsers for int/unsigned int types
        char: don't silently skip tn3270 protocol init when TLS is enabled
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      58888f8c
    • P
      Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging · 55901900
      Peter Maydell 提交于
      # gpg: Signature made Tue 13 Mar 2018 17:33:03 GMT
      # gpg:                using RSA key F30C38BD3F2FBE3C
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/vivier2/tags/linux-user-for-2.12-pull-request:
        linux-user: init_guest_space: Add a comment about search strategy
        linux-user: init_guest_space: Don't try to align if we'll reject it
        linux-user: init_guest_space: Clean up control flow a bit
        linux-user: init_guest_commpage: Add a comment about size check
        linux-user: init_guest_space: Clarify page alignment logic
        linux-user: init_guest_space: Correctly handle guest_start in commpage initialization
        linux-user: init_guest_space: Clean up if we can't initialize the commpage
        linux-user: Rename validate_guest_space => init_guest_commpage
        linux-user: Use #if to only call validate_guest_space for 32-bit ARM target
        qemu-binfmt-conf.sh: add qemu-xtensa
        linux-user: drop unused target_msync function
        linux-user: fix target_mprotect/target_munmap error return values
        linux-user: fix assertion in shmdt
        linux-user: fix mmap/munmap/mprotect/mremap/shmat
        linux-user: Support f_flags in statfs when available.
        linux-user: allows to use "--systemd ALL" with qemu-binfmt-conf.sh
        linux-user: Remove the unused "not implemented" signal handling stubs
        linux-user: Drop unicore32 code
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      55901900