[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 24/36] mirror: support querying target file
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [RFC PATCH 24/36] mirror: support querying target file |
Date: |
Fri, 15 Jun 2012 17:05:47 +0200 |
This lets query-block-jobs retrieve information and statistics on the
mirroring target.
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/mirror.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/block/mirror.c b/block/mirror.c
index 1ed19a9..4c1582d 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -201,10 +201,21 @@ static void mirror_set_speed(BlockJob *job, int64_t
speed, Error **errp)
ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME);
}
+static void mirror_query(BlockJob *job, BlockJobInfo *info)
+{
+ MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);
+
+ info->has_target = true;
+ info->target = g_new0(BlockJobTargetInfo, 1);
+ info->target->info = bdrv_query_info(s->target);
+ info->target->stats = bdrv_query_stats(s->target);
+}
+
static BlockJobType mirror_job_type = {
.instance_size = sizeof(MirrorBlockJob),
.job_type = "mirror",
.set_speed = mirror_set_speed,
+ .query = mirror_query,
};
void mirror_start(BlockDriverState *bs, BlockDriverState *target,
--
1.7.10.2
- [Qemu-devel] [RFC PATCH 15/36] qemu-iotests: add tests for streaming error handling, (continued)
- [Qemu-devel] [RFC PATCH 15/36] qemu-iotests: add tests for streaming error handling, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 13/36] block: introduce block job error, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 20/36] block: forward bdrv_iostatus_reset to block job, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 21/36] block: introduce new dirty bitmap functionality, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 22/36] block: add mirror job, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 19/36] block: add target info to QMP query-blockjobs command, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 25/36] mirror: add support for on_source_error/on_target_error, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 24/36] mirror: support querying target file,
Paolo Bonzini <=
- [Qemu-devel] [RFC PATCH 29/36] mirror: implement completion, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 34/36] block: return count of dirty sectors, not chunks, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 33/36] mirror: perform COW if the cluster size is bigger than the granularity, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 26/36] block: live snapshot documentation tweaks, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 35/36] block: allow customizing the granularity of the dirty bitmap, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 36/36] mirror: allow customizing the granularity, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 17/36] block: add bdrv_query_stats, Paolo Bonzini, 2012/06/15
- [Qemu-devel] [RFC PATCH 30/36] add hierarchical bitmap data type and test cases, Paolo Bonzini, 2012/06/15