[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 23/47] block: add target info to QMP query-blockjobs
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 23/47] block: add target info to QMP query-blockjobs command |
Date: |
Tue, 24 Jul 2012 13:04:01 +0200 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
blockjob.c | 3 +++
blockjob.h | 6 ++++++
qapi-schema.json | 21 ++++++++++++++++++++-
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/blockjob.c b/blockjob.c
index 562e0b5..651ee8d 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -197,6 +197,9 @@ BlockJobInfo *block_job_query(BlockJob *job)
info->offset = job->offset;
info->speed = job->speed;
info->io_status = job->iostatus;
+ if (job->job_type->query) {
+ job->job_type->query(job, info);
+ }
return info;
}
diff --git a/blockjob.h b/blockjob.h
index b17ee2e..5e03b5d 100644
--- a/blockjob.h
+++ b/blockjob.h
@@ -41,6 +41,12 @@ typedef struct BlockJobType {
/** Optional callback for job types that support setting a speed limit */
void (*set_speed)(BlockJob *job, int64_t speed, Error **errp);
+
+ /**
+ * Optional callback for job types that can fill the target member
+ * of BlockJobInfo.
+ */
+ void (*query)(BlockJob *job, BlockJobInfo *info);
} BlockJobType;
/**
diff --git a/qapi-schema.json b/qapi-schema.json
index b00d8c6..2697220 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -926,6 +926,21 @@
'data': ['report', 'ignore', 'enospc', 'stop'] }
##
+# @BlockJobTargetInfo:
+#
+# Information about the target device for a long-running block device
+# operation.
+#
+# @info: information on the target device
+#
+# @stats: statistics about a target device
+#
+# Since: 1.2
+##
+{ 'type': 'BlockJobTargetInfo',
+ 'data': {'info': 'BlockInfo', 'stats': 'BlockStats'} }
+
+##
# @BlockJobInfo:
#
# Information about a long-running block device operation.
@@ -944,12 +959,16 @@
#
# @io-status: the status of the job (since 1.2)
#
+# @target: the target device, if applicable to this particular type of
+# job.
+#
# Since: 1.1
##
{ 'type': 'BlockJobInfo',
'data': {'type': 'str', 'device': 'str', 'len': 'int',
'offset': 'int', 'paused': 'bool', 'speed': 'int',
- 'io-status': 'BlockDeviceIoStatus'} }
+ 'io-status': 'BlockDeviceIoStatus',
+ '*target': 'BlockJobTargetInfo'} }
##
# @query-block-jobs:
--
1.7.10.4
- Re: [Qemu-devel] [PATCH 37/47] add hierarchical bitmap data type and test cases, (continued)
[Qemu-devel] [PATCH 39/47] block: make round_to_clusters public, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 40/47] mirror: perform COW if the cluster size is bigger than the granularity, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 46/47] mirror: support more than one in-flight AIO operation, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 47/47] mirror: support arbitrarily-sized iterations, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 41/47] block: return count of dirty sectors, not chunks, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 36/47] host-utils: add ffsl and flsl, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 23/47] block: add target info to QMP query-blockjobs command,
Paolo Bonzini <=
[Qemu-devel] [PATCH 42/47] block: allow customizing the granularity of the dirty bitmap, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 17/47] qemu-iotests: add tests for streaming error handling, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 18/47] block: live snapshot documentation tweaks, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 22/47] block: make device optional in BlockInfo, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 30/47] mirror: implement completion, Paolo Bonzini, 2012/07/24
[Qemu-devel] [PATCH 28/47] qmp: add drive-mirror command, Paolo Bonzini, 2012/07/24