[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/32] blockjob: Update description of the 'id' field
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 02/32] blockjob: Update description of the 'id' field |
Date: |
Fri, 8 Jul 2016 19:21:14 +0200 |
From: Alberto Garcia <address@hidden>
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 <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/mirror.c | 3 ++-
blockjob.c | 3 ++-
include/block/blockjob.h | 5 +----
include/qapi/qmp/qerror.h | 3 ---
4 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
index 8d96049..6e3dbd2 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -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;
}
diff --git a/blockjob.c b/blockjob.c
index 205da9d..ce0e27c 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -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;
}
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index 7dc720c..5181514 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -106,10 +106,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;
diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index d08652a..6586c9f 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -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"
--
1.8.3.1
- [Qemu-devel] [PULL 00/32] Block layer patches, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 01/32] stream: Fix prototype of stream_start(), Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 12/32] osdep: Introduce qemu_dup, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 04/32] block: Use block_job_get() in find_block_job(), Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 03/32] blockjob: Add block_job_get(), Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 14/32] coroutine: use QSIMPLEQ instead of QTAILQ, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 06/32] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror', Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 15/32] test-coroutine: prepare for the next patch, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 02/32] blockjob: Update description of the 'id' field,
Kevin Wolf <=
- [Qemu-devel] [PULL 13/32] raw-posix: Use qemu_dup, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 05/32] blockjob: Add 'job_id' parameter to block_job_create(), Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 07/32] backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup', Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 17/32] block/qdev: Allow node name for drive properties, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 19/32] commit: Fix use of error handling policy, Kevin Wolf, 2016/07/08