From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNUY6-0006bz-EM for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:53:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNUY3-0008Qh-6n for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:53:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNUY2-0008QZ-Vk for qemu-devel@nongnu.org; Mon, 16 Feb 2015 17:53:51 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1GMrn5W005813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 16 Feb 2015 17:53:49 -0500 Message-ID: <54E274FC.9080908@redhat.com> Date: Mon, 16 Feb 2015 15:53:48 -0700 From: Eric Blake MIME-Version: 1.0 References: <1424097865-3973-1-git-send-email-armbru@redhat.com> <1424097865-3973-7-git-send-email-armbru@redhat.com> In-Reply-To: <1424097865-3973-7-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="REcWTOiDaGgREukH9cgJoghOFpE0THdkB" Subject: Re: [Qemu-devel] [PATCH 06/13] QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, kraxel@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --REcWTOiDaGgREukH9cgJoghOFpE0THdkB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/16/2015 07:44 AM, Markus Armbruster wrote: > qemu_opt_set() is a wrapper around qemu_opt_set() that reports the > error with qerror_report_err(). >=20 > Most of its users assume the function can't fail. Make them use > qemu_opt_set_err() with &error_abort, so that should the assumption > ever break, it'll break noisily. >=20 > Just two users remain, in util/qemu-config.c. Switch them to > qemu_opt_set_err() as well, then rename qemu_opt_set_err() to > qemu_opt_set(). Might be better to split this into fixing the two users in one patch, then doing the rename in another (since the rename touches more than two callers). On the other hand, it would represent more churn with changing existing qemu_opt_set() to qemu_opt_set_err(,&error_abort) just to change back to qemu_opt_set later. >=20 > Signed-off-by: Markus Armbruster > --- > block.c | 5 ++-- > block/qcow2.c | 3 +- > block/vvfat.c | 2 +- > blockdev.c | 17 +++++------ > hw/pci/pci-hotplug-old.c | 2 +- > hw/usb/dev-network.c | 4 +-- > hw/usb/dev-storage.c | 6 ++-- > hw/watchdog/watchdog.c | 2 +- > include/qemu/option.h | 5 ++-- > net/net.c | 2 +- > qdev-monitor.c | 6 ++-- > qemu-char.c | 58 +++++++++++++++++++------------------- > qemu-img.c | 6 ++-- > tests/test-qemu-opts.c | 6 ++-- > util/qemu-config.c | 9 ++++-- > util/qemu-option.c | 22 +++------------ > util/qemu-sockets.c | 34 +++++++++++----------- > vl.c | 73 ++++++++++++++++++++++++++--------------= -------- > 18 files changed, 131 insertions(+), 131 deletions(-) Also, the patch is fairly obvious that it is mechanical, so even if you don't split, I could live with: Reviewed-by: Eric Blake > +++ b/util/qemu-config.c > @@ -219,6 +219,7 @@ void qemu_add_opts(QemuOptsList *list) > =20 > int qemu_set_option(const char *str) > { > + Error *local_err =3D NULL; > char group[64], id[64], arg[64]; > QemuOptsList *list; > QemuOpts *opts; > @@ -242,7 +243,9 @@ int qemu_set_option(const char *str) > return -1; > } > =20 > - if (qemu_opt_set(opts, arg, str+offset+1) =3D=3D -1) { > + qemu_opt_set(opts, arg, str+offset+1, &local_err); Worth adding whitespace around the 2 '+' operators while touching this? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --REcWTOiDaGgREukH9cgJoghOFpE0THdkB 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/ iQEcBAEBCAAGBQJU4nT8AAoJEKeha0olJ0NqRboIAIZZPF0QHB8CuRC9yHoyrAuC SAsptgDOwFi0rLwlzsY+gc+XHVdI3qxeh6Ps4TAYWWknF4bxzLJUW+DDaQw1JErn 2dMOcOf7XJZfYZVm9nxFzQbPxPRzo4u5CszFKn2mlq4yHS8CV96FWGfUiNbWN2vv iuZymWiJxVhjEcOMDCGZcCcPtzVweTPu/8NXqf7mOby6X+cq3NiRtF4ftunuuKUD 91oPesIRgifGrTnBBqdRzTE+9rFJHxFGl1vBx8AFt++U00jASEmMsQpQFg4y7kxt Qqrm3FGlGlmM/ZLwwr19cDyxlzKPBOMA2TvFazlbpQ/HPhymt3ui02kd3+lIf3E= =NUl7 -----END PGP SIGNATURE----- --REcWTOiDaGgREukH9cgJoghOFpE0THdkB--