From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFTNr-0002zc-Gt for qemu-devel@nongnu.org; Mon, 17 Feb 2014 13:57:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFTNn-00085U-48 for qemu-devel@nongnu.org; Mon, 17 Feb 2014 13:57:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFTNm-00085I-SS for qemu-devel@nongnu.org; Mon, 17 Feb 2014 13:57:35 -0500 Message-ID: <53025B9B.5090405@redhat.com> Date: Mon, 17 Feb 2014 11:57:31 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392186806-10418-1-git-send-email-cyliu@suse.com> <1392186806-10418-18-git-send-email-cyliu@suse.com> In-Reply-To: <1392186806-10418-18-git-send-email-cyliu@suse.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="j2Quvfe9JMpTHLdreGM8WrlHrkX6IMACW" Subject: Re: [Qemu-devel] [PATCH v20 17/26] rbd.c: replace QEMUOptionParameter with QemuOpts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu , qemu-devel@nongnu.org Cc: kwolf@redhat.com, Dong Xu Wang , stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --j2Quvfe9JMpTHLdreGM8WrlHrkX6IMACW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/11/2014 11:33 PM, Chunyan Liu wrote: > rbd.c: replace QEMUOptionParameter with QemuOpts >=20 > Signed-off-by: Dong Xu Wang > Signed-off-by: Chunyan Liu > --- > block/rbd.c | 63 +++++++++++++++++++++++++++++----------------------= -------- > 1 files changed, 31 insertions(+), 32 deletions(-) >=20 > + objsize =3D qemu_opt_get_size_del(opts, BLOCK_OPT_CLUSTER_SIZE, 0)= ; > + if (objsize) { > + if ((objsize - 1) & objsize) { /* not a power of 2? */ > + error_report("obj size needs to be power of 2"); > + return -EINVAL; > + } > + if (objsize < 4096) { > + error_report("obj size too small"); > + return -EINVAL; > } > + { > + .name =3D BLOCK_OPT_CLUSTER_SIZE, > + .type =3D QEMU_OPT_SIZE, > + .help =3D "RBD object size", > + .def_value_str =3D stringify(0), Do we really want to list a default of 0, given that the code behaves the same as if 0 had been specified or if the argument had been omitted? Passing 0 doesn't really mean using a cluster size of 0, which makes listing it as an explicit default would look odd. > - .create_options =3D qemu_rbd_create_options, > + .create_opts =3D qemu_rbd_create_opts, Hmm, I've noticed that your series is inconsistent on whether it uses '=3D= foo_opts' or '=3D &foo_opts' in these initializers (for example, 15/26 used & even though nothing else did, 16/26 uses & but all other initializers were also using &, and in this 17/26 nothing is using &). Not that it matters to the compiler, but there's a lot to be said for consistency. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --j2Quvfe9JMpTHLdreGM8WrlHrkX6IMACW 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/ iQEcBAEBCAAGBQJTAlubAAoJEKeha0olJ0NqRCAIAILtwgZ/9261rfV1Onahc6PB qtp+qGQmIeaYG1w56QZIMnuNUiDsojIoJtILqbKezrpQ4q0Vj9+I0hiicPyVqFLF v8BT3t4ZI3tagWOewNsinon89v4dU0L2G9GVkTzfKfzIMemxAa7q4XOYEdmC9OMr rtkAiy3TLlCeQSfa0+lUAARLM4ihzI360C+4db8TnOXBC+Hd8uDVmPvKLA/s4gYm 5CA9vxBKy1K1TO3qsH8zxLosLTIDGlz6WDwyXJG3evUVO6qaIGOxcA9WFZBIWaRu Xk7G0VG/FgvuKC7CJctqM5t8aRMeliJPoxHlfzSR3b7e6AzUn2ALINSgfbRDEEs= =4Eq9 -----END PGP SIGNATURE----- --j2Quvfe9JMpTHLdreGM8WrlHrkX6IMACW--