|
|
357786 |
From 5ca59831fc7c51ec7f0c002bced4a41d088a0fb2 Mon Sep 17 00:00:00 2001
|
|
|
357786 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
357786 |
Date: Tue, 26 Jun 2018 09:48:00 +0200
|
|
|
357786 |
Subject: [PATCH 31/89] job: Rename BlockJobType into JobType
|
|
|
357786 |
|
|
|
357786 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
357786 |
Message-id: <20180626094856.6924-18-kwolf@redhat.com>
|
|
|
357786 |
Patchwork-id: 81112
|
|
|
357786 |
O-Subject: [RHV-7.6 qemu-kvm-rhev PATCH v2 17/73] job: Rename BlockJobType into JobType
|
|
|
357786 |
Bugzilla: 1513543
|
|
|
357786 |
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
|
|
|
357786 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
357786 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
357786 |
|
|
|
357786 |
QAPI types aren't externally visible, so we can rename them without
|
|
|
357786 |
causing problems. Before we add a job type to Job, rename the enum
|
|
|
357786 |
so it can be used for more than just block jobs.
|
|
|
357786 |
|
|
|
357786 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
357786 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
357786 |
Reviewed-by: Max Reitz <mreitz@redhat.com>
|
|
|
357786 |
Reviewed-by: John Snow <jsnow@redhat.com>
|
|
|
357786 |
(cherry picked from commit 8e4c87000fc515f8f65f7c8f18afb1e9270b11d6)
|
|
|
357786 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
357786 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
357786 |
---
|
|
|
357786 |
block/backup.c | 2 +-
|
|
|
357786 |
block/commit.c | 2 +-
|
|
|
357786 |
block/mirror.c | 4 ++--
|
|
|
357786 |
block/stream.c | 2 +-
|
|
|
357786 |
blockjob.c | 6 +++---
|
|
|
357786 |
include/block/blockjob_int.h | 2 +-
|
|
|
357786 |
qapi/block-core.json | 14 +++++++-------
|
|
|
357786 |
7 files changed, 16 insertions(+), 16 deletions(-)
|
|
|
357786 |
|
|
|
357786 |
diff --git a/block/backup.c b/block/backup.c
|
|
|
357786 |
index 9e672bb..c49ea92 100644
|
|
|
357786 |
--- a/block/backup.c
|
|
|
357786 |
+++ b/block/backup.c
|
|
|
357786 |
@@ -526,7 +526,7 @@ static const BlockJobDriver backup_job_driver = {
|
|
|
357786 |
.job_driver = {
|
|
|
357786 |
.instance_size = sizeof(BackupBlockJob),
|
|
|
357786 |
},
|
|
|
357786 |
- .job_type = BLOCK_JOB_TYPE_BACKUP,
|
|
|
357786 |
+ .job_type = JOB_TYPE_BACKUP,
|
|
|
357786 |
.start = backup_run,
|
|
|
357786 |
.commit = backup_commit,
|
|
|
357786 |
.abort = backup_abort,
|
|
|
357786 |
diff --git a/block/commit.c b/block/commit.c
|
|
|
357786 |
index 18cbb2f..afa2b2b 100644
|
|
|
357786 |
--- a/block/commit.c
|
|
|
357786 |
+++ b/block/commit.c
|
|
|
357786 |
@@ -218,7 +218,7 @@ static const BlockJobDriver commit_job_driver = {
|
|
|
357786 |
.job_driver = {
|
|
|
357786 |
.instance_size = sizeof(CommitBlockJob),
|
|
|
357786 |
},
|
|
|
357786 |
- .job_type = BLOCK_JOB_TYPE_COMMIT,
|
|
|
357786 |
+ .job_type = JOB_TYPE_COMMIT,
|
|
|
357786 |
.start = commit_run,
|
|
|
357786 |
};
|
|
|
357786 |
|
|
|
357786 |
diff --git a/block/mirror.c b/block/mirror.c
|
|
|
357786 |
index aa1d6b7..ed72656 100644
|
|
|
357786 |
--- a/block/mirror.c
|
|
|
357786 |
+++ b/block/mirror.c
|
|
|
357786 |
@@ -989,7 +989,7 @@ static const BlockJobDriver mirror_job_driver = {
|
|
|
357786 |
.job_driver = {
|
|
|
357786 |
.instance_size = sizeof(MirrorBlockJob),
|
|
|
357786 |
},
|
|
|
357786 |
- .job_type = BLOCK_JOB_TYPE_MIRROR,
|
|
|
357786 |
+ .job_type = JOB_TYPE_MIRROR,
|
|
|
357786 |
.start = mirror_run,
|
|
|
357786 |
.complete = mirror_complete,
|
|
|
357786 |
.pause = mirror_pause,
|
|
|
357786 |
@@ -1001,7 +1001,7 @@ static const BlockJobDriver commit_active_job_driver = {
|
|
|
357786 |
.job_driver = {
|
|
|
357786 |
.instance_size = sizeof(MirrorBlockJob),
|
|
|
357786 |
},
|
|
|
357786 |
- .job_type = BLOCK_JOB_TYPE_COMMIT,
|
|
|
357786 |
+ .job_type = JOB_TYPE_COMMIT,
|
|
|
357786 |
.start = mirror_run,
|
|
|
357786 |
.complete = mirror_complete,
|
|
|
357786 |
.pause = mirror_pause,
|
|
|
357786 |
diff --git a/block/stream.c b/block/stream.c
|
|
|
357786 |
index f88fc75..048bceb 100644
|
|
|
357786 |
--- a/block/stream.c
|
|
|
357786 |
+++ b/block/stream.c
|
|
|
357786 |
@@ -212,7 +212,7 @@ static const BlockJobDriver stream_job_driver = {
|
|
|
357786 |
.job_driver = {
|
|
|
357786 |
.instance_size = sizeof(StreamBlockJob),
|
|
|
357786 |
},
|
|
|
357786 |
- .job_type = BLOCK_JOB_TYPE_STREAM,
|
|
|
357786 |
+ .job_type = JOB_TYPE_STREAM,
|
|
|
357786 |
.start = stream_run,
|
|
|
357786 |
};
|
|
|
357786 |
|
|
|
357786 |
diff --git a/blockjob.c b/blockjob.c
|
|
|
357786 |
index 1464856..2a38447 100644
|
|
|
357786 |
--- a/blockjob.c
|
|
|
357786 |
+++ b/blockjob.c
|
|
|
357786 |
@@ -310,7 +310,7 @@ static char *child_job_get_parent_desc(BdrvChild *c)
|
|
|
357786 |
{
|
|
|
357786 |
BlockJob *job = c->opaque;
|
|
|
357786 |
return g_strdup_printf("%s job '%s'",
|
|
|
357786 |
- BlockJobType_str(job->driver->job_type),
|
|
|
357786 |
+ JobType_str(job->driver->job_type),
|
|
|
357786 |
job->job.id);
|
|
|
357786 |
}
|
|
|
357786 |
|
|
|
357786 |
@@ -847,7 +847,7 @@ BlockJobInfo *block_job_query(BlockJob *job, Error **errp)
|
|
|
357786 |
return NULL;
|
|
|
357786 |
}
|
|
|
357786 |
info = g_new0(BlockJobInfo, 1);
|
|
|
357786 |
- info->type = g_strdup(BlockJobType_str(job->driver->job_type));
|
|
|
357786 |
+ info->type = g_strdup(JobType_str(job->driver->job_type));
|
|
|
357786 |
info->device = g_strdup(job->job.id);
|
|
|
357786 |
info->len = job->len;
|
|
|
357786 |
info->busy = atomic_read(&job->busy);
|
|
|
357786 |
@@ -980,7 +980,7 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
|
|
|
357786 |
block_job_sleep_timer_cb, job);
|
|
|
357786 |
|
|
|
357786 |
error_setg(&job->blocker, "block device is in use by block job: %s",
|
|
|
357786 |
- BlockJobType_str(driver->job_type));
|
|
|
357786 |
+ JobType_str(driver->job_type));
|
|
|
357786 |
block_job_add_bdrv(job, "main node", bs, 0, BLK_PERM_ALL, &error_abort);
|
|
|
357786 |
bs->job = job;
|
|
|
357786 |
|
|
|
357786 |
diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
|
|
|
357786 |
index e8eca44..8e7e0a2 100644
|
|
|
357786 |
--- a/include/block/blockjob_int.h
|
|
|
357786 |
+++ b/include/block/blockjob_int.h
|
|
|
357786 |
@@ -39,7 +39,7 @@ struct BlockJobDriver {
|
|
|
357786 |
JobDriver job_driver;
|
|
|
357786 |
|
|
|
357786 |
/** String describing the operation, part of query-block-jobs QMP API */
|
|
|
357786 |
- BlockJobType job_type;
|
|
|
357786 |
+ JobType job_type;
|
|
|
357786 |
|
|
|
357786 |
/** Mandatory: Entrypoint for the Coroutine. */
|
|
|
357786 |
CoroutineEntry *start;
|
|
|
357786 |
diff --git a/qapi/block-core.json b/qapi/block-core.json
|
|
|
357786 |
index 1f6d4bb..607e5c5 100644
|
|
|
357786 |
--- a/qapi/block-core.json
|
|
|
357786 |
+++ b/qapi/block-core.json
|
|
|
357786 |
@@ -1050,9 +1050,9 @@
|
|
|
357786 |
'data': ['top', 'full', 'none', 'incremental'] }
|
|
|
357786 |
|
|
|
357786 |
##
|
|
|
357786 |
-# @BlockJobType:
|
|
|
357786 |
+# @JobType:
|
|
|
357786 |
#
|
|
|
357786 |
-# Type of a block job.
|
|
|
357786 |
+# Type of a background job.
|
|
|
357786 |
#
|
|
|
357786 |
# @commit: block commit job type, see "block-commit"
|
|
|
357786 |
#
|
|
|
357786 |
@@ -1064,7 +1064,7 @@
|
|
|
357786 |
#
|
|
|
357786 |
# Since: 1.7
|
|
|
357786 |
##
|
|
|
357786 |
-{ 'enum': 'BlockJobType',
|
|
|
357786 |
+{ 'enum': 'JobType',
|
|
|
357786 |
'data': ['commit', 'stream', 'mirror', 'backup'] }
|
|
|
357786 |
|
|
|
357786 |
##
|
|
|
357786 |
@@ -4529,7 +4529,7 @@
|
|
|
357786 |
#
|
|
|
357786 |
##
|
|
|
357786 |
{ 'event': 'BLOCK_JOB_COMPLETED',
|
|
|
357786 |
- 'data': { 'type' : 'BlockJobType',
|
|
|
357786 |
+ 'data': { 'type' : 'JobType',
|
|
|
357786 |
'device': 'str',
|
|
|
357786 |
'len' : 'int',
|
|
|
357786 |
'offset': 'int',
|
|
|
357786 |
@@ -4565,7 +4565,7 @@
|
|
|
357786 |
#
|
|
|
357786 |
##
|
|
|
357786 |
{ 'event': 'BLOCK_JOB_CANCELLED',
|
|
|
357786 |
- 'data': { 'type' : 'BlockJobType',
|
|
|
357786 |
+ 'data': { 'type' : 'JobType',
|
|
|
357786 |
'device': 'str',
|
|
|
357786 |
'len' : 'int',
|
|
|
357786 |
'offset': 'int',
|
|
|
357786 |
@@ -4630,7 +4630,7 @@
|
|
|
357786 |
#
|
|
|
357786 |
##
|
|
|
357786 |
{ 'event': 'BLOCK_JOB_READY',
|
|
|
357786 |
- 'data': { 'type' : 'BlockJobType',
|
|
|
357786 |
+ 'data': { 'type' : 'JobType',
|
|
|
357786 |
'device': 'str',
|
|
|
357786 |
'len' : 'int',
|
|
|
357786 |
'offset': 'int',
|
|
|
357786 |
@@ -4657,7 +4657,7 @@
|
|
|
357786 |
#
|
|
|
357786 |
##
|
|
|
357786 |
{ 'event': 'BLOCK_JOB_PENDING',
|
|
|
357786 |
- 'data': { 'type' : 'BlockJobType',
|
|
|
357786 |
+ 'data': { 'type' : 'JobType',
|
|
|
357786 |
'id' : 'str' } }
|
|
|
357786 |
|
|
|
357786 |
##
|
|
|
357786 |
--
|
|
|
357786 |
1.8.3.1
|
|
|
357786 |
|