qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/11] Allow creating block jobs with a user-defined ID
@ 2016-07-01 15:51 Alberto Garcia
  2016-07-01 15:51 ` [Qemu-devel] [PATCH v3 01/11] stream: Fix prototype of stream_start() Alberto Garcia
                   ` (11 more replies)
  0 siblings, 12 replies; 23+ messages in thread
From: Alberto Garcia @ 2016-07-01 15:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, Max Reitz, Kevin Wolf, Eric Blake, Jeff Cody,
	John Snow, Alberto Garcia

Hi all,

block jobs are currently identified by the name of the block backend
of the BDS where the job was started.

The problem with this is that you cannot have block jobs on nodes
where there is no such name.

This series turns the 'id' field of the BlockJob structure into an
actual ID, it guarantees that is unique and always present and allows
the user to set it.

Berto

v3:
- Instead of having separate 'id' and 'device' fields, use only the
  former. If the ID is not specified by the user it defaults to the
  device name to ensure backward compatibility.
- Patch 2:
  - Don't create a new field, simply update the description and the
    error messages. 
- Patch 4:
  - Now find_block_job() is simply a wrapper around block_job_get()
    that acquires the AioContext.
- Patch 5:
  - Allow setting the job ID but fall back to the device name if the
    user doesn't provide one. Fix the tests where the default ID was
    empty.
- Patches 10-14 [v2]:
  - These are no longer necessary, there's no need to add a new 'id'
    parameter to the 'block-job-*' QMP commands.
- Patch 10 [v3]:
  - Make img_commit() set a job ID
- Patch 11 [v3]:
  - Update the documentation of the QMP API to explain that the
   'device' field is now an actual ID.

v2: https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg06397.html
- Rebased on top of the current master
- Patch 2
  - Now that job->id no longer holds the device name, replace
    "The active block job for device '%s' cannot be completed"
    with "The active block job '%s' cannot be completed"
    in mirror_complete() and block_job_complete().
- Patch 4
  - Keep using ERROR_CLASS_DEVICE_NOT_ACTIVE in find_block_job() and
    change error path. [Max]
- Patch 6
  - Fix merge conflicts after 274fcce.
- Patch 9
  - Fix subject in commit message [Max]
- Patch 15
  - Update iotests 109 and 156 [Max]

v1: https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg02438.html
- Initial release

git backport-diff against v2:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/11:[----] [--] 'stream: Fix prototype of stream_start()'
002/11:[down] 'blockjob: Update description of the 'id' field'
003/11:[----] [--] 'blockjob: Add block_job_get()'
004/11:[down] 'block: Use block_job_get() in find_block_job()'
005/11:[0037] [FC] 'blockjob: Add 'job_id' parameter to block_job_create()'
006/11:[----] [--] 'mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror''
007/11:[----] [--] 'backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup''
008/11:[----] [--] 'stream: Add 'job-id' parameter to 'block-stream''
009/11:[----] [--] 'commit: Add 'job-id' parameter to 'block-commit''
010/11:[down] 'qemu-img: Set the ID of the block job in img_commit()'
011/11:[down] 'blockjob: Update description of the 'device' field in the QMP API'

Alberto Garcia (11):
  stream: Fix prototype of stream_start()
  blockjob: Update description of the 'id' field
  blockjob: Add block_job_get()
  block: Use block_job_get() in find_block_job()
  blockjob: Add 'job_id' parameter to block_job_create()
  mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror'
  backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup'
  stream: Add 'job-id' parameter to 'block-stream'
  commit: Add 'job-id' parameter to 'block-commit'
  qemu-img: Set the ID of the block job in img_commit()
  blockjob: Update description of the 'device' field in the QMP API

 block/backup.c            |   9 ++--
 block/commit.c            |   7 +--
 block/mirror.c            |  22 +++++----
 block/stream.c            |  12 ++---
 blockdev.c                | 116 ++++++++++++++++++++++------------------------
 blockjob.c                |  39 ++++++++++++++--
 docs/qmp-events.txt       |  12 +++--
 hmp.c                     |   6 +--
 include/block/block_int.h |  47 ++++++++++++-------
 include/block/blockjob.h  |  23 ++++++---
 include/qapi/qmp/qerror.h |   3 --
 qapi/block-core.json      |  66 ++++++++++++++++++--------
 qemu-img.c                |   2 +-
 qmp-commands.hx           |  22 +++++----
 tests/test-blockjob-txn.c |   7 ++-
 15 files changed, 240 insertions(+), 153 deletions(-)

-- 
2.8.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-07-04 15:49 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-01 15:51 [Qemu-devel] [PATCH v3 00/11] Allow creating block jobs with a user-defined ID Alberto Garcia
2016-07-01 15:51 ` [Qemu-devel] [PATCH v3 01/11] stream: Fix prototype of stream_start() Alberto Garcia
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 02/11] blockjob: Update description of the 'id' field Alberto Garcia
2016-07-02 13:47   ` Max Reitz
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 03/11] blockjob: Add block_job_get() Alberto Garcia
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 04/11] block: Use block_job_get() in find_block_job() Alberto Garcia
2016-07-02 14:02   ` Max Reitz
2016-07-04 13:23     ` Kevin Wolf
2016-07-04 14:05       ` Daniel P. Berrange
2016-07-04 13:35     ` Alberto Garcia
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 05/11] blockjob: Add 'job_id' parameter to block_job_create() Alberto Garcia
2016-07-02 14:09   ` Max Reitz
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 06/11] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror' Alberto Garcia
2016-07-02 14:30   ` Max Reitz
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 07/11] backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup' Alberto Garcia
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 08/11] stream: Add 'job-id' parameter to 'block-stream' Alberto Garcia
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 09/11] commit: Add 'job-id' parameter to 'block-commit' Alberto Garcia
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 10/11] qemu-img: Set the ID of the block job in img_commit() Alberto Garcia
2016-07-02 14:21   ` Max Reitz
2016-07-04 12:43     ` Alberto Garcia
2016-07-01 15:52 ` [Qemu-devel] [PATCH v3 11/11] blockjob: Update description of the 'device' field in the QMP API Alberto Garcia
2016-07-02 14:37   ` Max Reitz
2016-07-04 15:49 ` [Qemu-devel] [PATCH v3 00/11] Allow creating block jobs with a user-defined ID Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).