From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDk1K-0005pZ-Mf for qemu-devel@nongnu.org; Wed, 12 Feb 2014 19:19:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDk1G-0001Kg-9H for qemu-devel@nongnu.org; Wed, 12 Feb 2014 19:19:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDk1F-0001Kc-Vr for qemu-devel@nongnu.org; Wed, 12 Feb 2014 19:19:10 -0500 Message-ID: <52FC0F7A.3000901@redhat.com> Date: Wed, 12 Feb 2014 17:19:06 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392186806-10418-1-git-send-email-cyliu@suse.com> <1392186806-10418-8-git-send-email-cyliu@suse.com> In-Reply-To: <1392186806-10418-8-git-send-email-cyliu@suse.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Pt8v7EnPhJcL54xsUOGGujSEJjnEH32TD" Subject: Re: [Qemu-devel] [PATCH v20 07/26] cow.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) --Pt8v7EnPhJcL54xsUOGGujSEJjnEH32TD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/11/2014 11:33 PM, Chunyan Liu wrote: > cow.c: replace QEMUOptionParameter with QemuOpts >=20 > Signed-off-by: Dong Xu Wang > Signed-off-by: Chunyan Liu > --- > block/cow.c | 46 ++++++++++++++++++++++------------------------ > 1 files changed, 22 insertions(+), 24 deletions(-) >=20 > +static QemuOptsList cow_create_opts =3D { > + .name =3D "cow-create-opts", > + .head =3D QTAILQ_HEAD_INITIALIZER(cow_create_opts.head), > + .desc =3D { > + { > + .name =3D BLOCK_OPT_SIZE, > + .type =3D QEMU_OPT_SIZE, > + .help =3D "Virtual disk size" Oh, these QemuOpts really ARE constant strings in the general case, and passing these strings to free() could be a disaster. I hope we're okay in what we do; in fact, maybe it's worth a patch to QemuOptsList that adds a bool record of whether the list is dynamically allocated (false by default for all static initialization, and true when malloc'ing a list) and then asserting that attempts to free (parts of) a list are only done on a dynamically allocated list. > @@ -414,14 +412,14 @@ static BlockDriver bdrv_cow =3D { > .bdrv_probe =3D cow_probe, > .bdrv_open =3D cow_open, > .bdrv_close =3D cow_close, > - .bdrv_create =3D cow_create, > + .bdrv_create2 =3D cow_create, Might as well keep alignment looking nice. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Pt8v7EnPhJcL54xsUOGGujSEJjnEH32TD 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/ iQEcBAEBCAAGBQJS/A96AAoJEKeha0olJ0Nq5c0IAJalC7UMbvNvuRWgejX/N5Fa otXcgca40RTrwyzqaxo9jl0MpPq7308c6RxJGIa+bTnwUtdX3acDiJXDSHzULYtG 5FiOzYLvvleZcIuQ1DVtvNRkcgyhKajAi5NqqBAX7SsMFlwKjM9gYqjF3C57uCMW 3M3Hs3QUmtO5vkrmj6LcXuLSeldMHGebqisPynkV2vK6GvWXFFiJekf1067IKwpZ /GP+AKu7A5qx6+gYyepC+Gy9ogL/JLOO2AH8Lrz2FpXeIqhaRSSg+q0zNu2eikCV wWRAS1xzgmme9ovSC40wkfUxuiNtN7j0P5dZ+vmJKDvW7kz0rg9GBk2VO2qgxQ0= =CUW0 -----END PGP SIGNATURE----- --Pt8v7EnPhJcL54xsUOGGujSEJjnEH32TD--