From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7PCd-0003uk-GJ for qemu-devel@nongnu.org; Fri, 11 Dec 2015 10:01:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7PCZ-0004aC-8p for qemu-devel@nongnu.org; Fri, 11 Dec 2015 10:01:47 -0500 References: <1449792685-17000-1-git-send-email-david@gibson.dropbear.id.au> <1449792685-17000-4-git-send-email-david@gibson.dropbear.id.au> From: Eric Blake Message-ID: <566AE553.10103@redhat.com> Date: Fri, 11 Dec 2015 08:01:39 -0700 MIME-Version: 1.0 In-Reply-To: <1449792685-17000-4-git-send-email-david@gibson.dropbear.id.au> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KVimn1Fk0FsEUsDXSBkiCr8s9hUTSDe1g" Subject: Re: [Qemu-devel] [PATCH 03/11] pseries: Clean up hash page table allocation error handling 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) --KVimn1Fk0FsEUsDXSBkiCr8s9hUTSDe1g Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/10/2015 05:11 PM, David Gibson wrote: > The spapr_alloc_htab() and spapr_reset_htab() functions currently handl= e > all errors with error_setg(&error_abort, ...). That's correct for > spapr_reset_htab() - if anything goes wrong there, there's really nothi= ng > we can do about it. For spapr_alloc_htab() &error_fatal would make mor= e > sense, since it occurs during initialization. >=20 > But in any case the callers are really better placed to decide on the e= rror > handling. So, instead make the functions use the error propagation > infrastructure. >=20 > While we're at it improve the messages themselves a bit, and clean up t= he > indentation a little. >=20 > Signed-off-by: David Gibson > --- > hw/ppc/spapr.c | 26 ++++++++++++++++++-------- > 1 file changed, 18 insertions(+), 8 deletions(-) > @@ -1030,7 +1030,9 @@ static void spapr_alloc_htab(sPAPRMachineState *s= papr) > * For HV KVM, host kernel will return -ENOMEM when requested > * HTAB size can't be allocated. > */ > - error_setg(&error_abort, "Failed to allocate HTAB of requested= size, try with smaller maxmem"); > + error_setg(errp, > + "Error allocating KVM hash page table, try smaller maxmem:= %s", > + strerror(-shift)); error_setg_errno() is nicer than calling strerror(). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KVimn1Fk0FsEUsDXSBkiCr8s9hUTSDe1g 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/ iQEcBAEBCAAGBQJWauVTAAoJEKeha0olJ0NqPTsH/1HdIsept2MRBxwzirgTCZbY 0KJzQSGkWOr7CFdL8UwXEmdupkQEitmCRHCOyS+UwYSMRdpV+3ZNtti1XLAofO4k /gaiAMzWDl5IjaPD1xryCfkmKtok2WoO4hJDxjP5uDVcgD2664R9UkRS35Vc9t39 FTZHPxpcE+6arK0IXmxMpI/7Ij50MmLJ1nzNkeC2XD7goOsrhWn7tcqwZVonWay6 zQPTMogMnatIxd6gWcjDALISmfdAnyLA0AEHv2958Mijqpc4uXiEtw4GkkFt5tCQ eFm+uSxowz4E6cF4lm9pIz1+43UizzMi/78yMyxro7tLZyR0xEQdYjucZqzTwis= =B3Rv -----END PGP SIGNATURE----- --KVimn1Fk0FsEUsDXSBkiCr8s9hUTSDe1g--