diff mbox series

[v3,6/7] qapi/block-core: deprecate block-job-change

Message ID 20241002140616.561652-7-vsementsov@yandex-team.ru (mailing list archive)
State New, archived
Headers show
Series introduce job-change qmp command | expand

Commit Message

Vladimir Sementsov-Ogievskiy Oct. 2, 2024, 2:06 p.m. UTC
That's a first step to move on newer job-* APIs.

The difference between block-job-change and job-change is in
find_block_job_locked() vs find_job_locked() functions. What's
different?

1. find_block_job_locked() finds only block jobs, whereas
   find_job_locked() finds any kind of job.  job-change is a
   compatible extension of block-job-change.

2. find_block_job_locked() reports DeviceNotActive on failure, when
   find_job_locked() reports GenericError.  Since the kind of error
   reported isn't documented for either command, and clients
   shouldn't rely on undocumented error details, job-change is a
   compatible replacement for block-job-change.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
 docs/about/deprecated.rst | 5 +++++
 qapi/block-core.json      | 6 ++++++
 2 files changed, 11 insertions(+)

Comments

Markus Armbruster Nov. 7, 2024, 7:37 a.m. UTC | #1
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:

> That's a first step to move on newer job-* APIs.
>
> The difference between block-job-change and job-change is in
> find_block_job_locked() vs find_job_locked() functions. What's
> different?
>
> 1. find_block_job_locked() finds only block jobs, whereas
>    find_job_locked() finds any kind of job.  job-change is a
>    compatible extension of block-job-change.
>
> 2. find_block_job_locked() reports DeviceNotActive on failure, when
>    find_job_locked() reports GenericError.  Since the kind of error
>    reported isn't documented for either command, and clients
>    shouldn't rely on undocumented error details, job-change is a
>    compatible replacement for block-job-change.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

Acked-by: Markus Armbruster <armbru@redhat.com>
diff mbox series

Patch

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 1e21fbbf77..d2461924ff 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -147,6 +147,11 @@  options are removed in favor of using explicit ``blockdev-create`` and
 ``blockdev-add`` calls. See :doc:`/interop/live-block-operations` for
 details.
 
+``block-job-change`` (since 9.2)
+''''''''''''''''''''''''''''''''
+
+Use ``job-change`` instead.
+
 Incorrectly typed ``device_add`` arguments (since 6.2)
 ''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
diff --git a/qapi/block-core.json b/qapi/block-core.json
index e314734b53..ed87a9dc1e 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3100,9 +3100,15 @@ 
 #
 # Change the block job's options.
 #
+# Features:
+#
+# @deprecated: This command is deprecated.  Use @job-change
+#     instead.
+#
 # Since: 8.2
 ##
 { 'command': 'block-job-change',
+  'features': ['deprecated'],
   'data': 'JobChangeOptions', 'boxed': true }
 
 ##