]> git.proxmox.com Git - mirror_qemu.git/commitdiff
blockjob: Update description of the 'id' field
authorAlberto Garcia <berto@igalia.com>
Tue, 5 Jul 2016 14:28:53 +0000 (17:28 +0300)
committerKevin Wolf <kwolf@redhat.com>
Wed, 13 Jul 2016 11:26:02 +0000 (13:26 +0200)
The 'id' field of the BlockJob structure will be able to hold any ID,
not only a device name. This patch updates the description of that
field and the error messages where it is being used.

Soon we'll add the ability to set an arbitrary ID when creating a
block job.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c
blockjob.c
include/block/blockjob.h
include/qapi/qmp/qerror.h

index 8d96049555fc2d927a005bb398d006cfdc76013a..6e3dbd257bc4e1d357d557c825e5793c78078641 100644 (file)
@@ -761,7 +761,8 @@ static void mirror_complete(BlockJob *job, Error **errp)
     target = blk_bs(s->target);
 
     if (!s->synced) {
-        error_setg(errp, QERR_BLOCK_JOB_NOT_READY, job->id);
+        error_setg(errp, "The active block job '%s' cannot be completed",
+                   job->id);
         return;
     }
 
index 205da9df4e03d0341312bbb77d73f447e8076b50..ce0e27c124b5d70cd5a5de8f6e7cc1a230c70202 100644 (file)
@@ -290,7 +290,8 @@ void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp)
 void block_job_complete(BlockJob *job, Error **errp)
 {
     if (job->pause_count || job->cancelled || !job->driver->complete) {
-        error_setg(errp, QERR_BLOCK_JOB_NOT_READY, job->id);
+        error_setg(errp, "The active block job '%s' cannot be completed",
+                   job->id);
         return;
     }
 
index f7f5687cf404a2673946c2b1317c99f7b9a7544c..97b86f109f3a777df6f1a68060a5ff01a5258968 100644 (file)
@@ -107,10 +107,7 @@ struct BlockJob {
     BlockBackend *blk;
 
     /**
-     * The ID of the block job. Currently the BlockBackend name of the BDS
-     * owning the job at the time when the job is started.
-     *
-     * TODO Decouple block job IDs from BlockBackend names
+     * The ID of the block job.
      */
     char *id;
 
index d08652aaa5cb0e0551290dc36226bdbe6a6512b3..6586c9fa62ff887594dd5c87de4fed19152b5aa6 100644 (file)
@@ -19,9 +19,6 @@
 #define QERR_BASE_NOT_FOUND \
     "Base '%s' not found"
 
-#define QERR_BLOCK_JOB_NOT_READY \
-    "The active block job for device '%s' cannot be completed"
-
 #define QERR_BUS_NO_HOTPLUG \
     "Bus '%s' does not support hotplugging"