From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7ODF-0007td-BG for qemu-devel@nongnu.org; Fri, 11 Dec 2015 08:58:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7ODB-0004q6-3i for qemu-devel@nongnu.org; Fri, 11 Dec 2015 08:58:21 -0500 References: <1449792685-17000-1-git-send-email-david@gibson.dropbear.id.au> <1449792685-17000-2-git-send-email-david@gibson.dropbear.id.au> From: Eric Blake Message-ID: <566AD674.1060806@redhat.com> Date: Fri, 11 Dec 2015 06:58:12 -0700 MIME-Version: 1.0 In-Reply-To: <1449792685-17000-2-git-send-email-david@gibson.dropbear.id.au> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XeME24R5LNkeTHPIL6qwqnBQqeJidcPIF" Subject: Re: [Qemu-devel] [PATCH 01/11] ppc: Cleanup error handling in ppc_set_compat() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , armbru@redhat.com, aik@ozlabs.ru, mdroth@linux.vnet.ibm.com Cc: lvivier@redhat.com, thuth@redhat.com, qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XeME24R5LNkeTHPIL6qwqnBQqeJidcPIF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/10/2015 05:11 PM, David Gibson wrote: > Current ppc_set_compat() returns -1 for errors, and also (unconditional= ly) > reports an error message. The caller in h_client_architecture_support(= ) > may then report it again using an outdated fprintf(). >=20 > Clean this up by using the modern error reporting mechanisms. >=20 > Signed-off-by: David Gibson > --- > @@ -9208,12 +9208,13 @@ int ppc_set_compat(PowerPCCPU *cpu, uint32_t cp= u_version) > break; > } > =20 > - if (kvm_enabled() && kvmppc_set_compat(cpu, cpu->cpu_version) < 0)= { > - error_report("Unable to set compatibility mode in KVM"); > - ret =3D -1; > + if (kvm_enabled()) { > + ret =3D kvmppc_set_compat(cpu, cpu->cpu_version); > + if (ret < 0) { > + error_setg(errp, "Unable to set CPU compatibility mode in = KVM: %s", > + strerror(-ret)); > + } Could use error_setg_errno() here instead of manually calling strerror().= --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --XeME24R5LNkeTHPIL6qwqnBQqeJidcPIF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWatZ0AAoJEKeha0olJ0NqbTIH/1oWmBPRLiweJ8SjbXyeGI+e MlQWFvgKclCyLCqLpfCJPuTeMxZlmzWPnlDa0ZdJbMP43nPIQTqFvnudTtjgaRj/ AAYF4JKvW2S4h/NKjru9d2f3pK0tcJyz01I9Qj9MF/h3HZcWNOWf3GOfQYhSNiX1 4DhqECEjU4koV7axwrqNNKcinQP3lhKE96cn8whOVlg+8qLM9+qgJPYdOHUL9MvB ko+ICrqCvpMZTVVEAhMS4F9zUbrpTeefexJ4PYrcBBDJC7d5083dTYPPoBfA78Ma FtTXyoU3BbW+7Zdp0HMBWAXK3Nw2jHvFUBwL4LbOrp5Nd1ukeMAIs8eWVu61k5c= =zmOW -----END PGP SIGNATURE----- --XeME24R5LNkeTHPIL6qwqnBQqeJidcPIF--