From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNVe5-0000Rj-Dy for qemu-devel@nongnu.org; Wed, 13 Jul 2016 21:40:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNVe3-0000tN-5x for qemu-devel@nongnu.org; Wed, 13 Jul 2016 21:40:56 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:46113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNVe2-0000sZ-P6 for qemu-devel@nongnu.org; Wed, 13 Jul 2016 21:40:55 -0400 Date: Thu, 14 Jul 2016 11:42:40 +1000 From: David Gibson Message-ID: <20160714014240.GK14615@voom.fritz.box> References: <146843310345.22044.7846135644864365198.stgit@bahia.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="j+MD90OnwjQyWNYt" Content-Disposition: inline In-Reply-To: <146843310345.22044.7846135644864365198.stgit@bahia.lan> Subject: Re: [Qemu-devel] [PATCH] vl: exit if a bad property value is passed to -global List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: Paolo Bonzini , qemu-devel@nongnu.org, Bharata B Rao --j+MD90OnwjQyWNYt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 13, 2016 at 08:05:03PM +0200, Greg Kurz wrote: > When passing '-global driver=3Dhost-powerpc64-cpu,property=3Dcompat,value= =3Dfoo' > on the command line, without this patch, we get the following warning per > device (which means many lines if the guests has many cpus): >=20 > qemu-system-ppc64: Warning: can't apply global host-powerpc64-cpu.compat= =3Dfoo: > Invalid compatibility mode "foo" >=20 > ... and QEMU continues execution, ignoring the property. >=20 > With this patch, we get a single line: >=20 > qemu-system-ppc64: can't apply global host-powerpc64-cpu.compat=3Dfoo: > Invalid compatibility mode "foo" >=20 > ... and QEMU exits. >=20 > Signed-off-by: Greg Kurz Reviewed-by: David Gibson Not really up to me to decide if this is the right approach for global option handling, but it seems like the way to go to me. > --- > vl.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/vl.c b/vl.c > index 356713ea075c..a7cc92781687 100644 > --- a/vl.c > +++ b/vl.c > @@ -2922,6 +2922,7 @@ static int global_init_func(void *opaque, QemuOpts = *opts, Error **errp) > g->property =3D qemu_opt_get(opts, "property"); > g->value =3D qemu_opt_get(opts, "value"); > g->user_provided =3D true; > + g->errp =3D errp; > qdev_prop_register_global(g); > return 0; > } > @@ -4451,7 +4452,7 @@ int main(int argc, char **argv, char **envp) > machine_register_compat_props(current_machine); > =20 > qemu_opts_foreach(qemu_find_opts("global"), > - global_init_func, NULL, NULL); > + global_init_func, NULL, &error_fatal); > =20 > /* This checkpoint is required by replay to separate prior clock > reading from the other reads, because timer polling functions que= ry >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --j+MD90OnwjQyWNYt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXhu4QAAoJEGw4ysog2bOSYyAP/0poxE0GZmsLGqVBhng0tryX 7+q9Q3bbVll6IaVzOD2rdaGL6lM58eUE3xR/GBH7eJU7SwxL9zFgYHnZi3oungJJ Xgj6vlCJveygecsCIEE0gg0ernbg7jjcja8C4i+3bBhgfz8itaztN5j4oyuce30S yz1IjEDo/f1tKU/iGHP20DhewT5T052CfxBQ5WrGzzAMRFFfZR7E6wiUKkmZ2ENq uTIBURAYDOFud/S1AUxRd63rGIWP/7ZJQimMUDcAO8szefjXcrJuCpIK3oQp/f6d kmBvhTZROSJeP3FWUisPByfP7lETLWHTwg6smqg8nfMTPXChSXzJbwcYSw7C1blO GtXLuHleYCrHh4bGTufyWjM50hKm34e+NdiR810DkjQIbC6kTFk/s+CI2px4UboE PFGmB2HPbdyM+OIybWelxMfpDIdPJ7svzgfp7ooKPbx4ztl9oAEAvKvuluY1fRR7 6ZY74wpWj9wVivhumCGmex9y2maoWVsvbhwG2P0/AHaB4uh7EfaTTkRXcJ8eNad1 r958Y7+CEiAgI7SkEiS6kSg6/SZmgMr97ydLbWSyJ72wCUpkUetQRkd9sNb0GXup ZDaG4pr4DikmImrjZCxv/rCWpA1/mPXDq4XrLabiu0lHQmQY+UXlivb1xhbafzM1 R2bprUrojPlw2R9hjFXR =Cyt6 -----END PGP SIGNATURE----- --j+MD90OnwjQyWNYt--