]> git.proxmox.com Git - mirror_qemu.git/commitdiff
job: Rename BlockJobType into JobType
authorKevin Wolf <kwolf@redhat.com>
Thu, 12 Apr 2018 16:01:07 +0000 (18:01 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 23 May 2018 12:30:49 +0000 (14:30 +0200)
QAPI types aren't externally visible, so we can rename them without
causing problems. Before we add a job type to Job, rename the enum
so it can be used for more than just block jobs.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
block/backup.c
block/commit.c
block/mirror.c
block/stream.c
blockjob.c
include/block/blockjob_int.h
qapi/block-core.json

index 9e672bbd5e51fd9001975b16ae9d7940233fca37..c49ea92dcad52c69c7b16c9a36b0e3aabfcf1b10 100644 (file)
@@ -526,7 +526,7 @@ static const BlockJobDriver backup_job_driver = {
     .job_driver = {
         .instance_size          = sizeof(BackupBlockJob),
     },
-    .job_type               = BLOCK_JOB_TYPE_BACKUP,
+    .job_type               = JOB_TYPE_BACKUP,
     .start                  = backup_run,
     .commit                 = backup_commit,
     .abort                  = backup_abort,
index 18cbb2f9c4127317cd3668ae689405bb46014e25..afa2b2bacf623efcf0da991b648a75a8993a9d06 100644 (file)
@@ -218,7 +218,7 @@ static const BlockJobDriver commit_job_driver = {
     .job_driver = {
         .instance_size = sizeof(CommitBlockJob),
     },
-    .job_type      = BLOCK_JOB_TYPE_COMMIT,
+    .job_type      = JOB_TYPE_COMMIT,
     .start         = commit_run,
 };
 
index aa1d6b742e5284e0e31fa73549f8a3dab7a69696..ed72656a2348ab60b7e3ba6708aaddd55045e8f1 100644 (file)
@@ -989,7 +989,7 @@ static const BlockJobDriver mirror_job_driver = {
     .job_driver = {
         .instance_size          = sizeof(MirrorBlockJob),
     },
-    .job_type               = BLOCK_JOB_TYPE_MIRROR,
+    .job_type               = JOB_TYPE_MIRROR,
     .start                  = mirror_run,
     .complete               = mirror_complete,
     .pause                  = mirror_pause,
@@ -1001,7 +1001,7 @@ static const BlockJobDriver commit_active_job_driver = {
     .job_driver = {
         .instance_size          = sizeof(MirrorBlockJob),
     },
-    .job_type               = BLOCK_JOB_TYPE_COMMIT,
+    .job_type               = JOB_TYPE_COMMIT,
     .start                  = mirror_run,
     .complete               = mirror_complete,
     .pause                  = mirror_pause,
index f88fc7514127d9a45d89ce2830eb45b5892ef4b7..048bceb5d028229b897211ffb7d55a564a34694a 100644 (file)
@@ -212,7 +212,7 @@ static const BlockJobDriver stream_job_driver = {
     .job_driver = {
         .instance_size = sizeof(StreamBlockJob),
     },
-    .job_type      = BLOCK_JOB_TYPE_STREAM,
+    .job_type      = JOB_TYPE_STREAM,
     .start         = stream_run,
 };
 
index 1464856eb56d9dc7c04f8da967fd049b9e35d3dd..2a3844721e4a623af3e01aa784c7b53640a2ab8b 100644 (file)
@@ -310,7 +310,7 @@ static char *child_job_get_parent_desc(BdrvChild *c)
 {
     BlockJob *job = c->opaque;
     return g_strdup_printf("%s job '%s'",
-                           BlockJobType_str(job->driver->job_type),
+                           JobType_str(job->driver->job_type),
                            job->job.id);
 }
 
@@ -847,7 +847,7 @@ BlockJobInfo *block_job_query(BlockJob *job, Error **errp)
         return NULL;
     }
     info = g_new0(BlockJobInfo, 1);
-    info->type      = g_strdup(BlockJobType_str(job->driver->job_type));
+    info->type      = g_strdup(JobType_str(job->driver->job_type));
     info->device    = g_strdup(job->job.id);
     info->len       = job->len;
     info->busy      = atomic_read(&job->busy);
@@ -980,7 +980,7 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
                    block_job_sleep_timer_cb, job);
 
     error_setg(&job->blocker, "block device is in use by block job: %s",
-               BlockJobType_str(driver->job_type));
+               JobType_str(driver->job_type));
     block_job_add_bdrv(job, "main node", bs, 0, BLK_PERM_ALL, &error_abort);
     bs->job = job;
 
index e8eca44747e388c396bbd78a736297e9e50f7400..8e7e0a2f57a5429e35d895eaae92191964498744 100644 (file)
@@ -39,7 +39,7 @@ struct BlockJobDriver {
     JobDriver job_driver;
 
     /** String describing the operation, part of query-block-jobs QMP API */
-    BlockJobType job_type;
+    JobType job_type;
 
     /** Mandatory: Entrypoint for the Coroutine. */
     CoroutineEntry *start;
index 0e29abf0993d0710c16e9fbb6e1a00e2cb743204..63c6011411b3f6499113a3d35981427ebe07e1e2 100644 (file)
   'data': ['top', 'full', 'none', 'incremental'] }
 
 ##
-# @BlockJobType:
+# @JobType:
 #
-# Type of a block job.
+# Type of a background job.
 #
 # @commit: block commit job type, see "block-commit"
 #
 #
 # Since: 1.7
 ##
-{ 'enum': 'BlockJobType',
+{ 'enum': 'JobType',
   'data': ['commit', 'stream', 'mirror', 'backup'] }
 
 ##
 #
 ##
 { 'event': 'BLOCK_JOB_COMPLETED',
-  'data': { 'type'  : 'BlockJobType',
+  'data': { 'type'  : 'JobType',
             'device': 'str',
             'len'   : 'int',
             'offset': 'int',
 #
 ##
 { 'event': 'BLOCK_JOB_CANCELLED',
-  'data': { 'type'  : 'BlockJobType',
+  'data': { 'type'  : 'JobType',
             'device': 'str',
             'len'   : 'int',
             'offset': 'int',
 #
 ##
 { 'event': 'BLOCK_JOB_READY',
-  'data': { 'type'  : 'BlockJobType',
+  'data': { 'type'  : 'JobType',
             'device': 'str',
             'len'   : 'int',
             'offset': 'int',
 #
 ##
 { 'event': 'BLOCK_JOB_PENDING',
-  'data': { 'type'  : 'BlockJobType',
+  'data': { 'type'  : 'JobType',
             'id'    : 'str' } }
 
 ##