aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFiona Ebner <f.ebner@proxmox.com>2023-10-31 14:54:22 +0100
committerKevin Wolf <kwolf@redhat.com>2023-10-31 18:20:25 +0100
commit61a3a5a76a993b74c85f92585b10250d12323c38 (patch)
treeed7dc7d2c25fcf9bd75940d6db789f91fd491002 /include
parent073458da5619c8914a91440ef243d1e2b888c1b7 (diff)
downloadqemu-61a3a5a76a993b74c85f92585b10250d12323c38.zip
qemu-61a3a5a76a993b74c85f92585b10250d12323c38.tar.gz
qemu-61a3a5a76a993b74c85f92585b10250d12323c38.tar.bz2
blockjob: introduce block-job-change QMP command
which will allow changing job-type-specific options after job creation. In the JobVerbTable, the same allow bits as for set-speed are used, because set-speed can be considered an existing change command. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-ID: <20231031135431.393137-2-f.ebner@proxmox.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/blockjob.h11
-rw-r--r--include/block/blockjob_int.h7
2 files changed, 18 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index 058b0c8..95854f1 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -173,6 +173,17 @@ bool block_job_has_bdrv(BlockJob *job, BlockDriverState *bs);
bool block_job_set_speed_locked(BlockJob *job, int64_t speed, Error **errp);
/**
+ * block_job_change_locked:
+ * @job: The job to change.
+ * @opts: The new options.
+ * @errp: Error object.
+ *
+ * Change the job according to opts.
+ */
+void block_job_change_locked(BlockJob *job, BlockJobChangeOptions *opts,
+ Error **errp);
+
+/**
* block_job_query_locked:
* @job: The job to get information about.
*
diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
index 1048240..a4656d4 100644
--- a/include/block/blockjob_int.h
+++ b/include/block/blockjob_int.h
@@ -67,6 +67,13 @@ struct BlockJobDriver {
void (*attached_aio_context)(BlockJob *job, AioContext *new_context);
void (*set_speed)(BlockJob *job, int64_t speed);
+
+ /*
+ * Change the @job's options according to @opts.
+ *
+ * Note that this can already be called before the job coroutine is running.
+ */
+ void (*change)(BlockJob *job, BlockJobChangeOptions *opts, Error **errp);
};
/*