From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu6o2-0007KL-HV for qemu-devel@nongnu.org; Mon, 09 Jun 2014 17:08:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wu6ny-0001Ak-21 for qemu-devel@nongnu.org; Mon, 09 Jun 2014 17:08:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu6nx-0001Ad-Oe for qemu-devel@nongnu.org; Mon, 09 Jun 2014 17:08:33 -0400 Message-ID: <5396224D.9070504@redhat.com> Date: Mon, 09 Jun 2014 15:08:29 -0600 From: Eric Blake MIME-Version: 1.0 References: <1402346762-21333-1-git-send-email-benoit.canet@irqsave.net> <1402346762-21333-3-git-send-email-benoit.canet@irqsave.net> In-Reply-To: <1402346762-21333-3-git-send-email-benoit.canet@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L9GFoMj60C8RLG7jLaKjsNn5jFAfJgj1K" Subject: Re: [Qemu-devel] [PATCH v7 2/3] block: Add node-name and to-replace-node-name arguments to drive-mirror List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , qemu-devel@nongnu.org Cc: kwolf@redhat.com, Benoit Canet , stefanha@redhat.com, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --L9GFoMj60C8RLG7jLaKjsNn5jFAfJgj1K Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/09/2014 02:46 PM, Beno=C3=AEt Canet wrote: > node-name gives a name to the created BDS and registers it in the node = graph. >=20 > to-replace-node-name can be used when drive-mirror is called with sync=3D= full. Why can't it work with other modes? That is, if I have: base1 <- snap1 \ base2 <- snap2 > quorum base3 <- snap3 / and want to replace the 'base3 <- snap3' arm of the quorum with 'base4 <- snap4', where base3 and base4 are identical, the fact that you are forcing sync=3Dfull will not let me do so. There's a lot of things where= if management does something stupid, then the guest will see data instantly corrupted; but that doesn't mean that we necessarily have to cripple the power of the command. >=20 > The purpose of these fields is to be able to reconstruct and replace a = broken > quorum file. >=20 > drive-mirror will bdrv_swap the new BDS named node-name with the one > pointed by to-replace-node-name when the mirroring is finished. >=20 > Signed-off-by: Benoit Canet > --- > + > + if (size < bdrv_getlength(to_replace_bs)) { > + error_setg(errp, "cannot replace to-replace-node-name imag= e with a " > + "mirror image that would be smaller in si= ze"); Should this be enforcing equality in size, rather than just prohibiting shrinking? Doesn't the quorum code already require that all quorum members have equal size? > =20 > + /* if we are planning to replace a graph node name the code should= do a full > + * mirror of the source image > + */ > + if (has_to_replace_node_name && sync !=3D MIRROR_SYNC_MODE_FULL) {= > + error_setg(errp, > + "to-replace-node-name can only be used with sync=3D= full"); > + return; > + } Again, I'm not sure if this restriction makes sense. > +++ b/qapi/block-core.json > @@ -769,6 +769,14 @@ > # @format: #optional the format of the new destination, default is to > # probe if @mode is 'existing', else the format of the source= > # > +# @new-node-name: #optional the new block driver state node name in th= e graph > +# (Since 2.1) Is it worth splitting this patch into two? The ability to name the new node of a drive-mirror makes sense as an independent patch, which might be applied sooner even while worrying about the semantics of how replacement will work. > +# > +# @to-replace-node-name: #optional with sync=3Dfull graph node name to= be > +# replaced by the new image when a whole image = copy is > +# done. This can be used to repair broken Quoru= m files. > +# (Since 2.1) So if I understand correctly, the point of this command is that if I have a quorum with three backing named nodes, and want to hotswap out one of those modes, then I create a drive-mirror that names which of the three nodes is the victim, and on completion, the quorum now has the remaining two nodes and my new mirror as its new three node setup. Am I correct that to-replace-node-name can only be used on a node that is already composed of other nodes, and that the replacement must be one of those nodes? What if I have a 3/5 quorum - can I replace 2 nodes at once? > +# > # @mode: #optional whether and how QEMU should create a new image, def= ault is > # 'absolute-paths'. > # > @@ -801,6 +809,7 @@ > ## > { 'command': 'drive-mirror', > 'data': { 'device': 'str', 'target': 'str', '*format': 'str', > + '*new-node-name': 'str', '*to-replace-node-name': 'str', Bikeshedding: those are some long names. Is it sufficient to go with something shorter, '*node-name' for what to name the new mirror (again, might be worth splitting that into its own patch), and '*replaces' for the name of a node to be replaced? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --L9GFoMj60C8RLG7jLaKjsNn5jFAfJgj1K 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/ iQEcBAEBCAAGBQJTliJNAAoJEKeha0olJ0NqhagH/3qZMq7PmsMVv0OapDPmS0Ax ykdHo5q2h2yaCiVMuSA8tJDG4qaNs0J7jfzAOdzOM5Ns4FMW/kHEH1Y5TtvFAAMA gRgSeBsEYTJJ1b0aOtI0p5mywkij5GsiNTkIwl+gdkLmV7aplGLKEuA4VHwmqkBG VN3AQULgfxO3dJXlb1G1I0JHCf1sAgvlxXeQrIbK8sJSwPqnAElIPAE+gsjOGnRS wWfQ1+x73FsWn5UP9l6I4VY+HKk/ELYdCDHRJc+fkOrSkP+Z45UNezcttNdaAyLJ MoMK4k0iLfFuNzySNoA9DxbI+5rsuCEuabKFtOBF1CWnOsVL1RP+7yYMfIjl0sE= =tmza -----END PGP SIGNATURE----- --L9GFoMj60C8RLG7jLaKjsNn5jFAfJgj1K--