[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v16 2/8] Backup: clear all bitmap when doing block c
From: |
Changlong Xie |
Subject: |
[Qemu-devel] [PATCH v16 2/8] Backup: clear all bitmap when doing block checkpoint |
Date: |
Fri, 11 Mar 2016 18:34:09 +0800 |
From: Wen Congyang <address@hidden>
Signed-off-by: Wen Congyang <address@hidden>
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Gonglei <address@hidden>
Signed-off-by: Changlong Xie <address@hidden>
---
block/backup.c | 15 +++++++++++++++
include/block/block_int.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/block/backup.c b/block/backup.c
index 0f1b1bc..b2ba939 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -256,6 +256,21 @@ static void backup_abort(BlockJob *job)
}
}
+void backup_do_checkpoint(BlockJob *job, Error **errp)
+{
+ BackupBlockJob *backup_job = container_of(job, BackupBlockJob, common);
+
+ assert(job->driver->job_type == BLOCK_JOB_TYPE_BACKUP);
+
+ if (backup_job->sync_mode != MIRROR_SYNC_MODE_NONE) {
+ error_setg(errp, "The backup job only supports block checkpoint in"
+ " sync=none mode");
+ return;
+ }
+
+ hbitmap_reset_all(backup_job->bitmap);
+}
+
static const BlockJobDriver backup_job_driver = {
.instance_size = sizeof(BackupBlockJob),
.job_type = BLOCK_JOB_TYPE_BACKUP,
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 704efe5..48f0f1f 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -699,6 +699,8 @@ void backup_start(BlockDriverState *bs, BlockDriverState
*target,
BlockCompletionFunc *cb, void *opaque,
BlockJobTxn *txn, Error **errp);
+void backup_do_checkpoint(BlockJob *job, Error **errp);
+
void blk_set_bs(BlockBackend *blk, BlockDriverState *bs);
void blk_dev_change_media_cb(BlockBackend *blk, bool load);
--
1.9.3
- [Qemu-devel] [PATCH v16 0/8] Block replication for continuous checkpoints, Changlong Xie, 2016/03/11
- [Qemu-devel] [PATCH v16 2/8] Backup: clear all bitmap when doing block checkpoint,
Changlong Xie <=
- [Qemu-devel] [PATCH v16 1/8] unblock backup operations in backing file, Changlong Xie, 2016/03/11
- [Qemu-devel] [PATCH v16 5/8] auto complete active commit, Changlong Xie, 2016/03/11
- [Qemu-devel] [PATCH v16 3/8] Link backup into block core, Changlong Xie, 2016/03/11
- [Qemu-devel] [PATCH v16 8/8] support replication driver in blockdev-add, Changlong Xie, 2016/03/11
- [Qemu-devel] [PATCH v16 4/8] docs: block replication's description, Changlong Xie, 2016/03/11
- [Qemu-devel] [PATCH v16 6/8] Introduce new APIs to do replication operation, Changlong Xie, 2016/03/11
- [Qemu-devel] [PATCH v16 7/8] Implement new driver for block replication, Changlong Xie, 2016/03/11