From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XH8QE-0001K3-77 for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:31:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XH8Q8-0007fB-3E for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:31:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XH8Q7-0007f3-Qn for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:31:08 -0400 Date: Tue, 12 Aug 2014 10:31:04 +0100 From: Stefan Hajnoczi Message-ID: <20140812093104.GF20490@stefanha-thinkpad.redhat.com> References: <1407809575-24576-1-git-send-email-famz@redhat.com> <1407809575-24576-3-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="w3uUfsyyY1Pqa/ej" Content-Disposition: inline In-Reply-To: <1407809575-24576-3-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 2/2] scsi-bus: Convert DeviceClass init to realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, afaerber@suse.de, armbru@redhat.com --w3uUfsyyY1Pqa/ej Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 12, 2014 at 10:12:55AM +0800, Fam Zheng wrote: > Replace "init/destroy" with "realize/unrealize" in SCSIDeviceClass, > which has errp as a parameter. So all the implementations now use > error_setg instead of error_report for reporting error. >=20 > Also in scsi_bus_legacy_handle_cmdline, report the error when > initializing the if=3Dscsi devices, before returning it, because in the > callee, error_report is changed to error_setg. And the callers don't > have the right locations (e.g. "-drive if=3Dscsi"). >=20 > Signed-off-by: Fam Zheng > --- > hw/scsi/lsi53c895a.c | 1 + > hw/scsi/scsi-bus.c | 70 ++++++++++++++++++++--------------------- > hw/scsi/scsi-disk.c | 78 ++++++++++++++++++++++++----------------= ------ > hw/scsi/scsi-generic.c | 37 +++++++++++----------- > include/hw/scsi/scsi.h | 7 +++-- > tests/qemu-iotests/051.out | 2 -- > 6 files changed, 98 insertions(+), 97 deletions(-) If other places in QEMU have the same problem we might want to add an error_prepend() function instead. But this is fine for now: Reviewed-by: Stefan Hajnoczi --w3uUfsyyY1Pqa/ej Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT6d7YAAoJEJykq7OBq3PIMD0IAMJS1SnyCp36hn6RHtOtlCae gc72kUhatbAlXfANegzHjzWoWmUw4yE/GY1KfY6KU0qYE8p6iKs4SrH6rJqwa6/P bqtaA1ibX9/x659Pd53crjMxsu0lyDeSbrkSRTxN5IS9WNyZaJwgkSoY/Rp8ZfFz XqXh86ZM4ikTDk1CgZC4n9N5mthA487ikwygmae4EqYNuIqai4gwv35BjJH2fOzg aV6MDvPvZoNYKP9fa82RCFOU2zxw5LzjTxBR2bzdagJtCOaTJAr5YkEF5Y56fkJ6 h7DtEMqe7GPLxtqu34Ox3b5xfvudCEsTAnhiABK8todaUSHoisYoAXKIjJvtNPk= =1IF1 -----END PGP SIGNATURE----- --w3uUfsyyY1Pqa/ej--