From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YanOf-0002E7-UL for qemu-devel@nongnu.org; Wed, 25 Mar 2015 11:39:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YanOe-00088I-DW for qemu-devel@nongnu.org; Wed, 25 Mar 2015 11:39:09 -0400 Message-ID: <5512D68F.5080504@redhat.com> Date: Wed, 25 Mar 2015 09:38:55 -0600 From: Eric Blake MIME-Version: 1.0 References: <1427276174-9130-1-git-send-email-wency@cn.fujitsu.com> <1427276174-9130-2-git-send-email-wency@cn.fujitsu.com> In-Reply-To: <1427276174-9130-2-git-send-email-wency@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DOC1oWt56tPf9D3lUgKxdOrN0wkn1WsRT" Subject: Re: [Qemu-devel] [Qemu-block] [RFC PATCH COLO v2 01/13] docs: block replication's description List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang , qemu devel , Fam Zheng , Max Reitz , Paolo Bonzini Cc: Lai Jiangshan , qemu block , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , Gonglei , Stefan Hajnoczi , Yang Hongyang , zhanghailiang This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DOC1oWt56tPf9D3lUgKxdOrN0wkn1WsRT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/25/2015 03:36 AM, Wen Congyang wrote: > Signed-off-by: Wen Congyang > Signed-off-by: Paolo Bonzini > Signed-off-by: Yang Hongyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > --- > docs/block-replication.txt | 147 +++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 147 insertions(+) > create mode 100644 docs/block-replication.txt >=20 Grammar review only (I'll leave the technical review to others) > diff --git a/docs/block-replication.txt b/docs/block-replication.txt > new file mode 100644 > index 0000000..874ed8e > --- /dev/null > +++ b/docs/block-replication.txt > @@ -0,0 +1,147 @@ > +Block replication > +---------------------------------------- > +Copyright Fujitsu, Corp. 2015 > +Copyright (c) 2015 Intel Corporation > +Copyright (c) 2015 HUAWEI TECHNOLOGIES CO.,LTD. Space after comma in English writing. > + > +This work is licensed under the terms of the GNU GPL, version 2 or lat= er. > +See the COPYING file in the top-level directory. > + > +The block replication is used for continuous checkpoints. It is design= ed Sounds better as either of: The block replication feature is... Block replication is... > +for COLO that Secondary VM is running. It can also be applied for FT/H= A Please define COLO and FT/HA on first use (okay to abbreviate elsewhere in the document, but the first use should not assume the acronym is well-known) s/for COLO that/for COLO (COurse-grain LOck-stepping), where the/ > +scene that Secondary VM is not running. s/for FT/HA scene that/for the FT/HA (Fault-tolerance/High Assurance) scenario, where the/ > + > +This document gives an overview of block replication's design. > + > +=3D=3D Background =3D=3D > +High availability solutions such as micro checkpoint and COLO will do > +consecutive checkpoint. The VM state of Primary VM and Secondary VM is= s/checkpoint/checkpoints/ > +identical right after a VM checkpoint, but becomes different as the VM= =2E.. > + > +4) The hidden-disk is created automatically. It buffers the original c= ontent > +that is modified by the primary VM. It should also be an empty disk, a= nd > +the dirver supports bdrv_make_empty(). s/dirver/driver/ > + > +=3D=3D New block driver interface =3D=3D > +We add three block driver interfaces to control block replication: > +a. bdrv_start_replication() > + Start block replication, called in migration/checkpoint thread. > + We must call bdrv_start_replication() in secondary QEMU before > + calling bdrv_start_replication() in primary QEMU. > +b. bdrv_do_checkpoint() > + This interface is called after all VM state is transfered to s/transfered/transferred/ > + Secondary QEMU. The Disk buffer will be dropped in this interface. > + The caller must hold the I/O mutex lock if it is in migration/check= point > + thread. > +c. bdrv_stop_replication() > + It is called when failover. We will flush the Disk buffer into s/when/on/ > + Secondary Disk and stop block replication. The vm should be stopped= > + before calling it. The caller must hold the I/O mutex lock if it is= > + in migration/checkpoint thread. > + > +=3D=3D Usage =3D=3D > +Primary: > + -drive if=3Dxxx,driver=3Dquorum,read-pattern=3Dfifo,\ > + children.0.file.filename=3D1.raw,\ > + children.0.driver=3Draw,\ > + children.1.file.driver=3Dnbd+colo,\ > + children.1.file.host=3Dxxx,\ > + children.1.file.port=3Dxxx,\ > + children.1.file.export=3Dxxx,\ > + children.1.driver=3Draw,\ > + children.1.ignore-errors=3Don This command line looks like multiple arguments because of the leading whitespace on succeeding lines. I don't know if there is any better way to format it, though, to make it obvious that it is all a single argument to -drive. > + 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. Maybe a note 5 to call out the formatting aspect of the command line? > + > +Secondary: > + -drive if=3Dnone,driver=3Draw,file=3D1.raw,id=3Dnbd_target1 \ > + -drive if=3Dxxx,driver=3Dqcow2+colo,file=3Dactive_disk.qcow2,export=3D= xxx,\ > + backing_reference.drive_id=3Dnbd_target1,\ > + backing_reference.hidden-disk.file.filename=3Dhidden_disk.qco= w2,\ > + backing_reference.hidden-disk.driver=3Dqcow2,\ > + backing_reference.hidden-disk.allow-write-backing-file=3Don > + 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 > + 4. Active disk, hidden disk and nbd target's length should be the > + same. > + 5. It is better to put active disk and hidden disk in ramdisk. >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --DOC1oWt56tPf9D3lUgKxdOrN0wkn1WsRT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEbBAEBCAAGBQJVEtaPAAoJEKeha0olJ0NqPY8H+Na0N6GGurAl2qaH5oAanqqR 2Gw8Q3Dthp8mm7WIrpD+gIejJCmxydRjmhmDQViatfSXXPkeeeTyS/HR7XORk9DD DemrzFKxt26qx7V6juAnmjQi9DmXVEPP41LejXyZ1XTTHy/h9/Lp/hokG/KCBFqY q3v3ET9QysymbNFGn9FRjDhpGOmJQhbtQBO+SBx3WZN+rbyCYyZwLbOftHUA5RCT F27L/UT44Jn90yMjFC3qIIAPCXAzPKeknQV9OgdiiXkwukaz7NlBZcG8wRg8VSqU UjxJEhgp6DWT/wR7W9C5eXVB6eHlgtcdukK8saljj3Vs/lxAWAdLIG62b/Glcw== =MTsX -----END PGP SIGNATURE----- --DOC1oWt56tPf9D3lUgKxdOrN0wkn1WsRT--