From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR3WQ-0002RK-RG for qemu-devel@nongnu.org; Tue, 01 Oct 2013 13:14:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR3WL-0007Du-0x for qemu-devel@nongnu.org; Tue, 01 Oct 2013 13:14:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR3WK-0007Dm-OO for qemu-devel@nongnu.org; Tue, 01 Oct 2013 13:14:00 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r91HDxmO010366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Oct 2013 13:14:00 -0400 Message-ID: <524B02D7.1040304@redhat.com> Date: Tue, 01 Oct 2013 11:13:59 -0600 From: Eric Blake MIME-Version: 1.0 References: <1380542578-2387-1-git-send-email-famz@redhat.com> <1380542578-2387-5-git-send-email-famz@redhat.com> In-Reply-To: <1380542578-2387-5-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nRQJlw4r5vxpL83unRWiWheqjkHaTMqUg" Subject: Re: [Qemu-devel] [PATCH v4 4/7] mirror: Add commit_job_type to perform commit with mirror code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, pbonzini@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nRQJlw4r5vxpL83unRWiWheqjkHaTMqUg Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/30/2013 06:02 AM, Fam Zheng wrote: > Commit active layer will be implemented in block/mirror.c, prepare a ne= w > job type to let it have a right type name for the user. >=20 > Signed-off-by: Fam Zheng > --- > block/mirror.c | 12 +++++++++++- > blockdev.c | 2 +- > include/block/block_int.h | 2 ++ > 3 files changed, 14 insertions(+), 2 deletions(-) >=20 > diff --git a/block/mirror.c b/block/mirror.c > index af6851f..20dcfb6 100644 > --- a/block/mirror.c > +++ b/block/mirror.c > @@ -532,10 +532,19 @@ static const BlockJobType mirror_job_type =3D { > .complete =3D mirror_complete, > }; > =20 > +static const BlockJobType commit_job_type =3D { > + .instance_size =3D sizeof(MirrorBlockJob), > + .job_type =3D "commit", I still wonder if we should complete the conversion over to a QAPI enum type for all valid job types prior to hard-coding open strings through yet more of the code base. As long as we don't have introspection done yet, we can still make the switch, and in the long run, having an enum of valid job types seems like it will be better for maintenance, all with no change to what is sent over the wire in QMP. > @@ -390,6 +391,7 @@ void mirror_start(BlockDriverState *bs, BlockDriver= State *target, > int64_t speed, int64_t granularity, int64_t buf_size= , > MirrorSyncMode mode, BlockdevOnError on_source_error= , > BlockdevOnError on_target_error, > + bool commit_job, If we DO create a QAPI enum for job type, then this parameter would be the enum type, rather than a bool. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --nRQJlw4r5vxpL83unRWiWheqjkHaTMqUg 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.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSSwLXAAoJEKeha0olJ0NqFQYIAJXoA6vAbIiWHt2vnWb9tY+Y 39vurIkalbGVmlBF8QbNNsEfvadVV26hMLAXpAu1j8gxhjfsIUdeT2DPgZMDl+Go F+q1zb0I6Ep4eUBjpKMnCcDb2k4HAGP9ekRWMw67/P2L6Rx3n+3fTBu4c+vcFY5i 5gX1v5dYA1ZTgH/I7qGOL95TtE2BvFTp3MmikN29Ihs3DeAIgvZROfSdTCPF2VPk QqjK5pqf0AzJ2erwTW/HT5sa3p5kG2d7toT+0syskZWMAFPEG9z4olHLr+LoCuQ+ k+cVPCA8Aaj1tjiDGdbxJTfxJrB72fUW/BJ41C5MUr7tNptZxD872jFx94e8lkA= =RDQz -----END PGP SIGNATURE----- --nRQJlw4r5vxpL83unRWiWheqjkHaTMqUg--