Blame SOURCES/kvm-job-Rename-BlockJobType-into-JobType.patch

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