From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFTRG-0007Md-J1 for qemu-devel@nongnu.org; Mon, 17 Feb 2014 14:01:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFTRC-0001PP-5g for qemu-devel@nongnu.org; Mon, 17 Feb 2014 14:01:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFTRB-0001PF-UJ for qemu-devel@nongnu.org; Mon, 17 Feb 2014 14:01:06 -0500 Message-ID: <53025C6C.30901@redhat.com> Date: Mon, 17 Feb 2014 12:01:00 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392186806-10418-1-git-send-email-cyliu@suse.com> <1392186806-10418-19-git-send-email-cyliu@suse.com> In-Reply-To: <1392186806-10418-19-git-send-email-cyliu@suse.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3e9J1wktCgmSSiejj76TFj3VoJDJvEkRL" Subject: Re: [Qemu-devel] [PATCH v20 18/26] sheepdog.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) --3e9J1wktCgmSSiejj76TFj3VoJDJvEkRL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/11/2014 11:33 PM, Chunyan Liu wrote: > sheepdog.c: replace QEMUOptionParameter with QemuOpts >=20 > Signed-off-by: Dong Xu Wang > Signed-off-by: Chunyan Liu > --- > block/sheepdog.c | 101 +++++++++++++++++++++++++---------------------= -------- > 1 files changed, 47 insertions(+), 54 deletions(-) >=20 > + > + buf =3D NULL; > + buf =3D qemu_opt_get_del(opts, BLOCK_OPT_REDUNDANCY); Dead NULL assignment. > + if (buf) { > + ret =3D parse_redundancy(s, buf); > + if (ret < 0) { > + goto out; > } Do you need to store into ret here, or is it sufficient to use 'if (parse_redundancy(s, buf) < 0) {' > - { > - .name =3D BLOCK_OPT_REDUNDANCY, > - .type =3D OPT_STRING, > - .help =3D "Redundancy of the image" > - }, > - { NULL } > +static QemuOptsList sd_create_opts =3D { > + .name =3D "sheepdog-create-opts", > + .head =3D QTAILQ_HEAD_INITIALIZER(sd_create_opts.head), > + .desc =3D { > + { > + .name =3D BLOCK_OPT_PREALLOC, > + .type =3D QEMU_OPT_STRING, > + .help =3D "Preallocation mode (allowed values: off, full)"= > + }, > + { /* end of list */ } Missing redundancy in the new list. > @@ -2538,7 +2533,7 @@ static BlockDriver bdrv_sheepdog =3D { > .bdrv_save_vmstate =3D sd_save_vmstate, > .bdrv_load_vmstate =3D sd_load_vmstate, > =20 > - .create_options =3D sd_create_options, > + .create_opts =3D &sd_create_opts, Another example of the inconsistent use of &. > }; > =20 > static BlockDriver bdrv_sheepdog_tcp =3D { > @@ -2548,7 +2543,7 @@ static BlockDriver bdrv_sheepdog_tcp =3D { > .bdrv_needs_filename =3D true, > .bdrv_file_open =3D sd_open, > .bdrv_close =3D sd_close, > - .bdrv_create =3D sd_create, > + .bdrv_create2 =3D sd_create, > .bdrv_has_zero_init =3D bdrv_has_zero_init_1, > .bdrv_getlength =3D sd_getlength, > .bdrv_get_allocated_file_size =3D sd_get_allocated_file_size, > @@ -2568,7 +2563,6 @@ static BlockDriver bdrv_sheepdog_tcp =3D { > .bdrv_save_vmstate =3D sd_save_vmstate, > .bdrv_load_vmstate =3D sd_load_vmstate, > =20 > - .create_options =3D sd_create_options, > }; Why no .create_opts replacement? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3e9J1wktCgmSSiejj76TFj3VoJDJvEkRL 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/ iQEcBAEBCAAGBQJTAlxsAAoJEKeha0olJ0NqJvEH/2UbByeySJb/wYXM10iwxui9 w2fKU93jILcVURlbvaFRELSr03zxKYJ7fvhhoONFuK5xqIpxRsQMdHMe88tSvUPk Atjh2tzWlP0OOBhLX0NS4AthoG2YRdT3iHTDjsfec+qAXy4V1fLWYvngvmvDz6sm 6WI+a2vQDhR2PhhEb31dIxMEg9zJYsU/sPRiU623U1ZNOiUrle8jpqw9yb2DELzz bNYWAuqh3ndiawCEwjTHpu0XnALY0U/AlgqT2FjKT2KTbVes4DLKr1Eyg0U0W8E6 BN+9w3IgOPEqn8tsT293HupfdQRLS0Ej3kbXk/JDlumglu8OgDVxwOhyzN6GfGo= =/8S4 -----END PGP SIGNATURE----- --3e9J1wktCgmSSiejj76TFj3VoJDJvEkRL--