bdrv_set_in_use(bs, 0);
}
-void block_job_set_speed(BlockJob *job, int64_t value, Error **errp)
+void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp)
{
Error *local_err = NULL;
error_set(errp, QERR_NOT_SUPPORTED);
return;
}
- job->job_type->set_speed(job, value, &local_err);
+ job->job_type->set_speed(job, speed, &local_err);
if (error_is_set(&local_err)) {
error_propagate(errp, local_err);
return;
}
- job->speed = value;
+ job->speed = speed;
}
void block_job_cancel(BlockJob *job)
block_job_complete(&s->common, ret);
}
-static void stream_set_speed(BlockJob *job, int64_t value, Error **errp)
+static void stream_set_speed(BlockJob *job, int64_t speed, Error **errp)
{
StreamBlockJob *s = container_of(job, StreamBlockJob, common);
- if (value < 0) {
- error_set(errp, QERR_INVALID_PARAMETER, "value");
+ if (speed < 0) {
+ error_set(errp, QERR_INVALID_PARAMETER, "speed");
return;
}
- ratelimit_set_speed(&s->limit, value / BDRV_SECTOR_SIZE);
+ ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE);
}
static BlockJobType stream_job_type = {
const char *job_type;
/** Optional callback for job types that support setting a speed limit */
- void (*set_speed)(BlockJob *job, int64_t value, Error **errp);
+ void (*set_speed)(BlockJob *job, int64_t speed, Error **errp);
} BlockJobType;
/**
* Set a rate-limiting parameter for the job; the actual meaning may
* vary depending on the job type.
*/
-void block_job_set_speed(BlockJob *job, int64_t value, Error **errp);
+void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp);
/**
* block_job_cancel:
return bs->job;
}
-void qmp_block_job_set_speed(const char *device, int64_t value, Error **errp)
+void qmp_block_job_set_speed(const char *device, int64_t speed, Error **errp)
{
BlockJob *job = find_block_job(device);
return;
}
- block_job_set_speed(job, value, errp);
+ block_job_set_speed(job, speed, errp);
}
void qmp_block_job_cancel(const char *device, Error **errp)
{
.name = "block_job_set_speed",
- .args_type = "device:B,value:o",
- .params = "device value",
+ .args_type = "device:B,speed:o",
+ .params = "device speed",
.help = "set maximum speed for a background block operation",
.mhandler.cmd = hmp_block_job_set_speed,
},
#
# @device: the device name
#
-# @value: the maximum speed, in bytes per second
+# @speed: the maximum speed, in bytes per second
#
# Returns: Nothing on success
# If the job type does not support throttling, NotSupported
# Since: 1.1
##
{ 'command': 'block-job-set-speed',
- 'data': { 'device': 'str', 'value': 'int' } }
+ 'data': { 'device': 'str', 'speed': 'int' } }
##
# @block-job-cancel:
{
.name = "block-job-set-speed",
- .args_type = "device:B,value:o",
+ .args_type = "device:B,speed:o",
.mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
},