Received: from eggs.gnu.org ([2001:4830:134:3::10]:60875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLk5f-00024S-VF for qemu-devel@nongnu.org; Wed, 11 Feb 2015 22:05:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLk5b-00016F-Vm for qemu-devel@nongnu.org; Wed, 11 Feb 2015 22:05:19 -0500 Received: from [59.151.112.132] (port=57794 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLk5b-00014D-L0 for qemu-devel@nongnu.org; Wed, 11 Feb 2015 22:05:15 -0500 From: Wen Congyang Date: Thu, 12 Feb 2015 11:07:04 +0800 Message-ID: <1423710438-14377-1-git-send-email-wency@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC PATCH 00/14] Block replication for continuous checkpoints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu devel , Kevin Wolf , Stefan Hajnoczi , Paolo Bonzini Cc: Lai Jiangshan , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , Yang Hongyang Block replication is a very important feature which is used for continuous checkpoints(for example: COLO). Usage: Primary: -drive if=xxx,driver=quorum,read-pattern=first,\ children.0.file.filename=1.raw,\ children.0.driver=raw,\ children.1.file.driver=nbd+colo,\ children.1.file.host=xxx,\ children.1.file.port=xxx,\ children.1.file.export=xxx,\ children.1.driver=raw Note: 1. NBD Client should not be the first child of quorum. 2. There should be only one NBD Client. 3. host is the secondary physical machine's hostname or IP 4. Each disk must have its own export name. Secondary: -drive if=xxx,driver=blkcolo,export=xxx,\ backing.file.filename=1.raw,\ backing.driver=raw Then run qmp command: nbd_server_start host:port Note: 1. The export name for the same disk must be the same in primary and secondary QEMU command line 2. The qmp command nbd_server_start must be run before running the qmp command migrate on primary QEMU 3. Don't use nbd_server_start's other options You can get the patch here: https://github.com/wencongyang/qemu-colo/commits/block-replication-v1 Wen Congyang (14): docs: block replication's description quorom: add a new read pattern quorum: ignore 0-length child Add new block driver interfaces to control disk replication quorom: implement block driver interfaces for block replication NBD client: connect to nbd server later NBD client: implement block driver interfaces for block replication block: add a new API to create a hidden BlockBackend block: give backing image its own BlockBackend allow the backing image access the origin BlockDriverState allow writing to the backing file Add disk buffer for block replication COW: move cow interfaces to a seperate file COLO: implement a new block driver Makefile.objs | 2 +- block.c | 53 +++++- block/Makefile.objs | 1 + block/backup.c | 52 +----- block/blkcolo-buffer.c | 324 ++++++++++++++++++++++++++++++++ block/blkcolo.c | 409 +++++++++++++++++++++++++++++++++++++++++ block/blkcolo.h | 35 ++++ block/block-backend.c | 29 ++- block/nbd.c | 155 ++++++++++++++-- block/quorum.c | 79 +++++++- blockcow.c | 52 ++++++ docs/block-replication.txt | 129 +++++++++++++ include/block/block.h | 27 +++ include/block/block_int.h | 14 ++ include/sysemu/block-backend.h | 2 + qapi/block-core.json | 4 +- 16 files changed, 1295 insertions(+), 72 deletions(-) create mode 100644 block/blkcolo-buffer.c create mode 100644 block/blkcolo.c create mode 100644 block/blkcolo.h create mode 100644 blockcow.c create mode 100644 docs/block-replication.txt -- 2.1.0