From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRVnB-0004s2-4u for qemu-devel@nongnu.org; Sun, 24 Jul 2016 22:38:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRVn9-0004CV-1D for qemu-devel@nongnu.org; Sun, 24 Jul 2016 22:38:52 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:39211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRVn8-0004CF-LQ for qemu-devel@nongnu.org; Sun, 24 Jul 2016 22:38:50 -0400 Date: Mon, 25 Jul 2016 12:38:46 +1000 From: David Gibson Message-ID: <20160725023846.GI24621@voom.fritz.box> References: <146914207036.16527.6025809385836923910.stgit@bahia.lan> <146914207969.16527.15568547267031224728.stgit@bahia.lan> <20160722012848.GA15941@voom.fritz.box> <20160722135631.GQ3337@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/8E7gjuj425jZz9t" Content-Disposition: inline In-Reply-To: <20160722135631.GQ3337@thinpad.lan.raisama.net> Subject: Re: [Qemu-devel] [PATCH v3 1/2] qdev: ignore GlobalProperty.errp for hotplugged devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Greg Kurz , Paolo Bonzini , qemu-devel@nongnu.org, Bharata B Rao --/8E7gjuj425jZz9t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 22, 2016 at 10:56:31AM -0300, Eduardo Habkost wrote: > On Fri, Jul 22, 2016 at 11:28:48AM +1000, David Gibson wrote: > > On Fri, Jul 22, 2016 at 01:01:26AM +0200, Greg Kurz wrote: > > > This patch ensures QEMU won't terminate while hotplugging a device if= the > > > global property cannot be set and errp points to error_fatal or error= _abort. > > >=20 > > > While here, it also fixes indentation of the typename argument. > > >=20 > > > Suggested-by: Eduardo Habkost > > > Signed-off-by: Greg Kurz > >=20 > > This seems kind of bogus to me - we have this whole infrastructure for > > handling errors, and here we throw it away. >=20 > What is this patch throwing away? We have never been able to use > the error infrastructure properly while applying global > properties. "throwing away" was a bit too strong. But, it seems a shame that we have this error infrastructure which supposedly let's you report errors in a consistent way whether they be fatal or non-fatal, but here we're not able to use it to report a non-fatal error. > > It seems like the right solution would be to make the caller in the > > hotplug case *not* use error_abort or error_fatal, and instead get the > > error propagated back to the monitor which will display it. >=20 > GlobalProperty::errp is a workaround to the fact that > ObjectClass::instance_post_init() can't report errors at all (and > that's because object_new() and object_initialize_with_type() > can't report errors. Do you have any suggestions to fix it? Is there an inherent reason object_initialize() and object_new() can't report errors? Or just that it hasn't been implemented yet? > I have suggested saving global property errors in a DeviceState > field and reporting then later on device_realize(). Maybe I > should implement it and send as RFC. Maybe. In any case my initial objection was because I hadn't realized the difficulty of implementing this in the error API, so I withdraw it. --=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 --/8E7gjuj425jZz9t Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXlXu2AAoJEGw4ysog2bOSaq8QAL4c2ZsX9wucafhM79p/JAyw /9BEvhQz1VOojkYEokor02Q7vHwHM1AEjWaaHWR+beVfLItXRfosdJknlbcoGo0q cLa/E4RFHy70d8XDZSsiI1MsgV39Kmu+u3uc8R9vp6Ri3NEAeBgfKK6/sOtom1pZ lLRpkZevBsdQeGG4XcuGRXn40qKEzwZ4CENmcZQbDha5aT645Ds8FmCDBkR2QKXo LEqPFMLWZBKVQT4C94x1VQz0A1YVw434MD1i+1sp0bOaIQY3xMKQmgoZYElg1hqD lJQBFfHktsOJtUg88mSndQapn9LACG6vQq4MgaWQ7fJ5M9+UaKVBKXHVBqPoK/fX vOBw1fP5Og75oPUX8V+9dvisn9Euz06K72mrt7TpF5QRg/I6YSZBiKViTHFF/otj TBD24/MAUeonO6H8ZwzZyBm2HhijOBHeRvmNMgIn5q9rA5xWJ1BX5HYCDQxLtgT6 0HVtfZP2SR+/g92h2tRkVk3kh9dIZkZNCQNnViSnTVG4cqJ174CTcFyZrLzM+UsH Nk0mfs/T6gtvfoMozm2flM6cphdw1NdB/kkrDsMDSP6iwewyOADnwZAawXhrXW/Y r1uMyZufioJyud3ZfxilDwIex9Ya8B0gMH7BRYXpYWHRJiRzJW/a+2iB7kb1+a+T RZWQVingkoPQqlBP5ivR =5R9V -----END PGP SIGNATURE----- --/8E7gjuj425jZz9t--