From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLLLi-0000OX-Dt for qemu-devel@nongnu.org; Mon, 18 Jan 2016 20:44:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLLLf-0007ft-93 for qemu-devel@nongnu.org; Mon, 18 Jan 2016 20:44:46 -0500 Date: Tue, 19 Jan 2016 12:23:41 +1100 From: David Gibson Message-ID: <20160119012341.GX9301@voom.fritz.box> References: <1453091083-13931-1-git-send-email-david@gibson.dropbear.id.au> <1453091083-13931-9-git-send-email-david@gibson.dropbear.id.au> <569CB0FE.3090207@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YG0IFkGWIt6MbjRk" Content-Disposition: inline In-Reply-To: <569CB0FE.3090207@redhat.com> Subject: Re: [Qemu-devel] [PATCHv3 8/9] pseries: Clean up error reporting in ppc_spapr_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: lvivier@redhat.com, aik@ozlabs.ru, armbru@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org --YG0IFkGWIt6MbjRk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 18, 2016 at 10:31:42AM +0100, Thomas Huth wrote: > On 18.01.2016 05:24, David Gibson wrote: > > This function includes a number of explicit fprintf()s for errors. > > Change these to use error_report() instead. > >=20 > > Also replace the single exit(EXIT_FAILURE) with an explicit exit(1), si= nce > > the latter is the more usual idiom in qemu by a large margin. > >=20 > > Signed-off-by: David Gibson > > --- > > hw/ppc/spapr.c | 25 +++++++++++++------------ > > 1 file changed, 13 insertions(+), 12 deletions(-) > >=20 > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > index 148ca5a..58f26cd 100644 > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > > @@ -1789,8 +1789,8 @@ static void ppc_spapr_init(MachineState *machine) > > } > > =20 > > if (spapr->rma_size > node0_size) { > > - fprintf(stderr, "Error: Numa node 0 has to span the RMA (%#08"= HWADDR_PRIx")\n", > > - spapr->rma_size); > > + error_report("Numa node 0 has to span the RMA (%#08"HWADDR_PRI= x")", > > + spapr->rma_size); > > exit(1); > > } > > =20 > > @@ -1856,10 +1856,10 @@ static void ppc_spapr_init(MachineState *machin= e) > > ram_addr_t hotplug_mem_size =3D machine->maxram_size - machine= ->ram_size; > > =20 > > if (machine->ram_slots > SPAPR_MAX_RAM_SLOTS) { > > - error_report("Specified number of memory slots %" PRIu64 > > - " exceeds max supported %d", > > - machine->ram_slots, SPAPR_MAX_RAM_SLOTS); > > - exit(EXIT_FAILURE); > > + error_report("Specified number of memory slots %" > > + PRIu64" exceeds max supported %d", > > + machine->ram_slots, SPAPR_MAX_RAM_SLOTS); >=20 > Why did you change the indentation of the "machine->ram_slots, ..." line > here? The original looked better to me. I don't know. Probably just a mistake on my part, I'll fix it. > > + exit(1); >=20 > EXIT_FAILURE still seems to be used quite often in the QEMU sources... > All in all, this hunk does not really change anything from a functional > point of view, so I'd like to suggest to omit this hunk completely > instead to avoid code churn here. This I'll keep, as Markus says for local consistency. --=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 --YG0IFkGWIt6MbjRk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWnZAdAAoJEGw4ysog2bOSVfgP/1RSdRGDClpHPConOEb9cZG7 eDkmcdHxzUpWQpciYDc0ZQMmHEIg3ZCCT55FnuibgOWq9kMk1LwEkONEUYcug8VH 6PGPbFnLT31Iny0E/nfOyI+KvKTth7ou0ONzRmgyS23KNrctnkxEd1Oj6JmXY6NF hU+TBA2XGKuAarFIzINRMAsvCiV98Du6a74SKDAaJpRXsk231TIN2MRnfRgc0kIb 7x5Qs0sxoN4HESiQDBuEVtmiQgq+FakcHFRJlpRWjWIhAdTRhpjKel3g+QQUlrvS EHa7RE/+j1PN2jqSQ/j7k9/DZ1h5NoupHVsd4hELsVYwt1DP1tMb9cfq+1Zvf2ZW GAefoESb1fxUhUJd8+BQp+87D/+xYQ22ONSuxGPpx9GD5WwRN92X+jni+yhrH4jo kY9vLGcUmycfwH3x1I/7kqOyCPGS7AUi2OpB3MbSNcncj/508pbe5MII+ofA3aD7 7Q3nnC990DarA2qhzoRegia93TtcgJ/Y0FkhOmcmaSJf2DAWwT52lciyE3BmgvMp Adwl0n77kTwhRXUGZtgzRUq0MI1WkE/a2pAtf5uSTjstrkw9LCk8KLbwEqlZATV6 ZEIjSUVbeKRByFUu7vTOIqYI8pzUbYJYHdMcFRVwAAYC5zLDWFQnBP75YlnEsS+a HreBvKyb7ehMqsnFQf/Y =7tHm -----END PGP SIGNATURE----- --YG0IFkGWIt6MbjRk--