monitor/hmp: move hmp_block_job* to block-hmp-cmds.c
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20200308092440.23564-7-mlevitsk@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
0932e3f23d
commit
6b7fbf61fb
@ -247,3 +247,55 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict)
|
||||
qmp_drive_backup(&backup, &err);
|
||||
hmp_handle_error(mon, err);
|
||||
}
|
||||
|
||||
void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
Error *error = NULL;
|
||||
const char *device = qdict_get_str(qdict, "device");
|
||||
int64_t value = qdict_get_int(qdict, "speed");
|
||||
|
||||
qmp_block_job_set_speed(device, value, &error);
|
||||
|
||||
hmp_handle_error(mon, error);
|
||||
}
|
||||
|
||||
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", false);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void hmp_block_job_complete(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
Error *error = NULL;
|
||||
const char *device = qdict_get_str(qdict, "device");
|
||||
|
||||
qmp_block_job_complete(device, &error);
|
||||
|
||||
hmp_handle_error(mon, error);
|
||||
}
|
||||
|
@ -23,4 +23,10 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict);
|
||||
void hmp_drive_mirror(Monitor *mon, const QDict *qdict);
|
||||
void hmp_drive_backup(Monitor *mon, const QDict *qdict);
|
||||
|
||||
void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_cancel(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_pause(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_resume(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_complete(Monitor *mon, const QDict *qdict);
|
||||
|
||||
#endif
|
||||
|
@ -87,11 +87,6 @@ void hmp_eject(Monitor *mon, const QDict *qdict);
|
||||
void hmp_change(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_stream(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_cancel(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_pause(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_resume(Monitor *mon, const QDict *qdict);
|
||||
void hmp_block_job_complete(Monitor *mon, const QDict *qdict);
|
||||
void hmp_migrate(Monitor *mon, const QDict *qdict);
|
||||
void hmp_device_add(Monitor *mon, const QDict *qdict);
|
||||
void hmp_device_del(Monitor *mon, const QDict *qdict);
|
||||
|
@ -1997,58 +1997,6 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
|
||||
hmp_handle_error(mon, error);
|
||||
}
|
||||
|
||||
void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
Error *error = NULL;
|
||||
const char *device = qdict_get_str(qdict, "device");
|
||||
int64_t value = qdict_get_int(qdict, "speed");
|
||||
|
||||
qmp_block_job_set_speed(device, value, &error);
|
||||
|
||||
hmp_handle_error(mon, error);
|
||||
}
|
||||
|
||||
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", false);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void hmp_block_job_complete(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
Error *error = NULL;
|
||||
const char *device = qdict_get_str(qdict, "device");
|
||||
|
||||
qmp_block_job_complete(device, &error);
|
||||
|
||||
hmp_handle_error(mon, error);
|
||||
}
|
||||
|
||||
typedef struct HMPMigrationStatus
|
||||
{
|
||||
QEMUTimer *timer;
|
||||
|
Loading…
Reference in New Issue
Block a user