diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2012-09-28 17:22:51 +0200 |
|---|---|---|
| committer | Kevin Wolf <kwolf@redhat.com> | 2012-09-28 19:14:32 +0200 |
| commit | 6e37fb811ac86739e5ed30dba3a8e4848bd21b56 (patch) | |
| tree | 61bfc784684f6fc22ad910a6e8809395c499b63f /hmp.c | |
| parent | 8acc72a4d20910d522516dab31272fe66da8da28 (diff) | |
| download | focaccia-qemu-6e37fb811ac86739e5ed30dba3a8e4848bd21b56.tar.gz focaccia-qemu-6e37fb811ac86739e5ed30dba3a8e4848bd21b56.zip | |
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>
Diffstat (limited to 'hmp.c')
| -rw-r--r-- | hmp.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/hmp.c b/hmp.c index ba6fbd3dcf..55601f7dad 100644 --- a/hmp.c +++ b/hmp.c @@ -950,8 +950,29 @@ void hmp_block_job_cancel(Monitor *mon, const QDict *qdict) { Error *error = NULL; const char *device = qdict_get_str(qdict, "device"); + bool force = qdict_get_try_bool(qdict, "force", 0); - qmp_block_job_cancel(device, &error); + qmp_block_job_cancel(device, true, force, &error); + + hmp_handle_error(mon, &error); +} + +void hmp_block_job_pause(Monitor *mon, const QDict *qdict) +{ + Error *error = NULL; + const char *device = qdict_get_str(qdict, "device"); + + qmp_block_job_pause(device, &error); + + hmp_handle_error(mon, &error); +} + +void hmp_block_job_resume(Monitor *mon, const QDict *qdict) +{ + Error *error = NULL; + const char *device = qdict_get_str(qdict, "device"); + + qmp_block_job_resume(device, &error); hmp_handle_error(mon, &error); } |