Am 24.07.2012 13:03, schrieb Paolo Bonzini:
> Add QMP commands matching the functionality.
>
> Paused jobs cannot be canceled without first resuming them. This
> ensures that I/O errors are never missed by management. However, an
> optional force argument can be specified to allow that. Right now,
> jobs do not see the difference between a forced and a normal resume.
> This can be changed in the future if needed.
>
> Signed-off-by: Paolo Bonzini <[email protected]>
> +##
> +# @block-job-pause:
> +#
> +# Pause an active background block operation.
> +#
> +# This command returns immediately after marking the active background block
> +# operation for pausing. It is an error to call this command if no
> +# operation is in progress.
> +#
> +# The operation will pause as soon as possible. No event is emitted when
> +# the operation is actually paused. Cancelling a paused job automatically
> +# resumes it.
> +#
> +# @device: the device name
> +#
> +# Returns: Nothing on success
> +# If no background operation is active on this device,
> DeviceNotActive
> +#
> +# Since: 1.2
> +##
> +{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
> +
> +##
> +# @block-job-resume:
> +#
> +# Resume an active background block operation.
> +#
> +# This command returns immediately after resuming a paused background block
> +# operation for cancellation. It is an error to call this command if no
> +# operation is in progress.
> +#
> +# @device: the device name
> +#
> +# Returns: Nothing on success
> +# If no background operation is active on this device,
> DeviceNotActive
> +# If cancellation already in progress, DeviceInUse
> +#
> +# Since: 1.2
> +##
> +{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
We should document what happens when you pause an already paused job, or
resume a running one. Currently, a second pause is completely ignored,
and a second resume is mostly ignored as well, but can shorten the
rate-limiting delay (the latter isn't worth to be documented, but if we
should be clear about whether it's allowed)
Kevin