qmp: add block-job-pause and block-job-resume

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Paolo Bonzini 2012-09-28 17:22:51 +02:00 committed by Kevin Wolf
parent 8acc72a4d2
commit 6e37fb811a
7 changed files with 150 additions and 11 deletions

View file

@ -99,9 +99,10 @@ ETEXI
{
.name = "block_job_cancel",
.args_type = "device:B",
.params = "device",
.help = "stop an active background block operation",
.args_type = "force:-f,device:B",
.params = "[-f] device",
.help = "stop an active background block operation (use -f"
"\n\t\t\t if the operation is currently paused)",
.mhandler.cmd = hmp_block_job_cancel,
},
@ -109,6 +110,34 @@ STEXI
@item block_job_cancel
@findex block_job_cancel
Stop an active block streaming operation.
ETEXI
{
.name = "block_job_pause",
.args_type = "device:B",
.params = "device",
.help = "pause an active background block operation",
.mhandler.cmd = hmp_block_job_pause,
},
STEXI
@item block_job_pause
@findex block_job_pause
Pause an active block streaming operation.
ETEXI
{
.name = "block_job_resume",
.args_type = "device:B",
.params = "device",
.help = "resume a paused background block operation",
.mhandler.cmd = hmp_block_job_resume,
},
STEXI
@item block_job_resume
@findex block_job_resume
Resume a paused block streaming operation.
ETEXI
{