From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUarI-0003Wb-5C for qemu-devel@nongnu.org; Thu, 18 Sep 2014 08:30:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUarD-0000f9-0x for qemu-devel@nongnu.org; Thu, 18 Sep 2014 08:30:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUarC-0000e3-Pv for qemu-devel@nongnu.org; Thu, 18 Sep 2014 08:30:42 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8ICUa7B011629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 18 Sep 2014 08:30:36 -0400 Message-ID: <541AD06B.1070804@redhat.com> Date: Thu, 18 Sep 2014 06:30:35 -0600 From: Eric Blake MIME-Version: 1.0 References: <1411034263-18132-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1411034263-18132-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="l27OlPt8CJluV0fHEsPJal8BXu5ve9S9s" Subject: Re: [Qemu-devel] [PATCH] block: Catch simultaneous usage of options and their aliases List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: armbru@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --l27OlPt8CJluV0fHEsPJal8BXu5ve9S9s Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/18/2014 03:57 AM, Kevin Wolf wrote: > While thinking about precedence of conflicting block device options fro= m > different sources, I noticed that you can specify both an option and it= s > legacy alias at the same time (e.g. readonly=3Don,read-only=3Doff). Rat= her > than specifying the order of precedence, we should simply forbid such > combinations. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 46 +++++++++++++++++++++++++++++++-------= -------- > tests/qemu-iotests/051 | 23 +++++++++++++++++++++++ > tests/qemu-iotests/051.out | 45 ++++++++++++++++++++++++++++++++++++++= +++++++ > 3 files changed, 99 insertions(+), 15 deletions(-) Reviewed-by: Eric Blake > =20 > -static void qemu_opt_rename(QemuOpts *opts, const char *from, const ch= ar *to) > +static void qemu_opt_rename(QemuOpts *opts, const char *from, const ch= ar *to, > + Error **errp) > { > const char *value; > =20 > + if (*errp) { > + return; > + } Not the most typical usage, so it might be worth a comment that this function can be called with errp already set. But since it's static, it's not too hard to figure out as-is. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --l27OlPt8CJluV0fHEsPJal8BXu5ve9S9s 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 iQEcBAEBCAAGBQJUGtBrAAoJEKeha0olJ0NqDrsH/ju2a8r7aN0HIMVI9vdV9ynf /SX4bG2hzIps/MSv57pNCHjqyHqHM0LP4n/jd/ArBAQ2qVCgLsj+lX9YN+CJIAgg 4GKOqqbQkKF9hajHfm2+uW8MpIcGHjBpK+M8SxnzKxgkBp4NldTc4EQ0uFvQqV+e uEDSjBvGzcYZndBO0HbTQhv5jinbbefWeXrTvaQwP/J1920ODHO5O98/7hM364Y6 4WWFxbUx1rSCRj/XqTm/MvUP/jFW4RApSmPWuv2BlsAPRjgYkN337qWF/KE6zrfj yC7DqfiRpC24aw5SmRhb9ZWGTNmkV7xTlDW/9ixDV5A33Sjk4y7VGsHSr9yEDSg= =uIlg -----END PGP SIGNATURE----- --l27OlPt8CJluV0fHEsPJal8BXu5ve9S9s--