qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alberto Garcia <berto@igalia.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Eric Blake <eblake@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
	Jeff Cody <jcody@redhat.com>, Alberto Garcia <berto@igalia.com>
Subject: [Qemu-devel] [PATCH v2 00/15] Add an 'id' field to block jobs
Date: Wed, 22 Jun 2016 15:24:57 +0300	[thread overview]
Message-ID: <cover.1466598035.git.berto@igalia.com> (raw)

Hello all,

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

This series adds a new 'id' field that is specific to the block job
and guaranteed to be unique and always present.

The patches can be summarized as follows:

- 1: Fix the prototype of stream_start(), that is going to be touched
     by a later patch in the series.
- 2-5: Split BlockJob's 'id' field into 'id' and 'device' and adjust
       the internal APIs to allow using the job ID.
- 6-9: Add parameters to allow setting the job ID to all QMP commands
       that create block jobs (block-stream, block-commit, ...)
- 10-14: Add parameters to allow using the job ID to all QMP command
         that manipulate block jobs (cancel, pause, complete, ...).
- 15: Expose the ID field in BlockJobInfo and all BLOCK_JOB_* events.

Things to do:

- Add new tests specific to job IDs.
- Add job ID support to HMP commands.

Berto

v2:
- 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 v1:

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/15:[----] [--] 'stream: Fix prototype of stream_start()'
002/15:[0009] [FC] 'blockjob: Decouple the ID from the device name in the BlockJob struct'
003/15:[----] [-C] 'blockjob: Add block_job_get()'
004/15:[0031] [FC] 'block: Simplify find_block_job() and make it accept a job ID'
005/15:[----] [-C] 'blockjob: Add 'job_id' parameter to block_job_create()'
006/15:[0003] [FC] 'mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror''
007/15:[----] [-C] 'backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup''
008/15:[----] [--] 'stream: Add 'job-id' parameter to 'block-stream''
009/15:[down] 'commit: Add 'job-id' parameter to 'block-commit''
010/15:[----] [--] 'blockjob: Add 'id' parameter to 'block-job-set-speed''
011/15:[----] [--] 'blockjob: Add 'id' parameter to 'block-job-cancel''
012/15:[----] [--] 'blockjob: Add 'id' parameter to 'block-job-pause''
013/15:[----] [--] 'blockjob: Add 'id' parameter to 'block-job-resume''
014/15:[----] [--] 'blockjob: Add 'id' parameter to 'block-job-complete''
015/15:[0095] [FC] 'blockjob: Add 'id' field to 'BlockJobInfo' and all BLOCK_JOB_* events'

Alberto Garcia (15):
  stream: Fix prototype of stream_start()
  blockjob: Decouple the ID from the device name in the BlockJob struct
  blockjob: Add block_job_get()
  block: Simplify find_block_job() and make it accept a job ID
  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'
  blockjob: Add 'id' parameter to 'block-job-set-speed'
  blockjob: Add 'id' parameter to 'block-job-cancel'
  blockjob: Add 'id' parameter to 'block-job-pause'
  blockjob: Add 'id' parameter to 'block-job-resume'
  blockjob: Add 'id' parameter to 'block-job-complete'
  blockjob: Add 'id' field to 'BlockJobInfo' and all BLOCK_JOB_* events

 block/backup.c             |   9 +--
 block/commit.c             |   7 +-
 block/mirror.c             |  22 +++---
 block/stream.c             |  12 ++--
 blockdev.c                 | 175 +++++++++++++++++++++++++++------------------
 blockjob.c                 |  46 ++++++++++--
 docs/qmp-events.txt        |   4 ++
 hmp.c                      |  16 ++---
 include/block/block_int.h  |  47 +++++++-----
 include/block/blockjob.h   |  30 ++++++--
 include/qapi/qmp/qerror.h  |   3 -
 include/qemu/id.h          |   1 +
 qapi/block-core.json       |  91 ++++++++++++++++++-----
 qemu-img.c                 |   2 +-
 qmp-commands.hx            |  32 +++++----
 tests/qemu-iotests/095     |   2 +-
 tests/qemu-iotests/095.out |   2 +-
 tests/qemu-iotests/109     |   2 +-
 tests/qemu-iotests/109.out |  88 +++++++++++------------
 tests/qemu-iotests/124     |   3 +-
 tests/qemu-iotests/141     |   6 +-
 tests/qemu-iotests/141.out |  14 ++--
 tests/qemu-iotests/144     |   1 +
 tests/qemu-iotests/144.out |   4 +-
 tests/qemu-iotests/156     |   1 +
 tests/qemu-iotests/156.out |   4 +-
 tests/test-blockjob-txn.c  |   2 +-
 util/id.c                  |   1 +
 28 files changed, 396 insertions(+), 231 deletions(-)

-- 
2.8.1

             reply	other threads:[~2016-06-22 12:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 12:24 Alberto Garcia [this message]
2016-06-22 12:24 ` [Qemu-devel] [PATCH v2 01/15] stream: Fix prototype of stream_start() Alberto Garcia
2016-06-22 12:45   ` Kevin Wolf
2016-06-22 12:24 ` [Qemu-devel] [PATCH v2 02/15] blockjob: Decouple the ID from the device name in the BlockJob struct Alberto Garcia
2016-06-22 12:42   ` Kevin Wolf
2016-06-22 14:42     ` Alberto Garcia
2016-06-22 15:49       ` Kevin Wolf
2016-06-23 12:47         ` Alberto Garcia
2016-06-29 17:20           ` Max Reitz
2016-06-30 13:03             ` Alberto Garcia
2016-07-01 18:48               ` John Snow
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 03/15] blockjob: Add block_job_get() Alberto Garcia
2016-06-22 12:45   ` Kevin Wolf
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 04/15] block: Simplify find_block_job() and make it accept a job ID Alberto Garcia
2016-06-22 12:50   ` Kevin Wolf
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 05/15] blockjob: Add 'job_id' parameter to block_job_create() Alberto Garcia
2016-06-22 13:10   ` Kevin Wolf
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 06/15] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 07/15] backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 08/15] stream: Add 'job-id' parameter to 'block-stream' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 09/15] commit: Add 'job-id' parameter to 'block-commit' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 10/15] blockjob: Add 'id' parameter to 'block-job-set-speed' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 11/15] blockjob: Add 'id' parameter to 'block-job-cancel' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 12/15] blockjob: Add 'id' parameter to 'block-job-pause' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 13/15] blockjob: Add 'id' parameter to 'block-job-resume' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 14/15] blockjob: Add 'id' parameter to 'block-job-complete' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 15/15] blockjob: Add 'id' field to 'BlockJobInfo' and all BLOCK_JOB_* events Alberto Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1466598035.git.berto@igalia.com \
    --to=berto@igalia.com \
    --cc=eblake@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).