Received: from eggs.gnu.org ([2001:4830:134:3::10]:32871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XH7wA-0005W3-6E for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:00:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XH7w2-0006U6-SV for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:00:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XH7w2-0006TI-Ky for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:00:02 -0400 Date: Tue, 12 Aug 2014 09:59:58 +0100 From: Stefan Hajnoczi Message-ID: <20140812085958.GB20490@stefanha-thinkpad.redhat.com> References: <1407746718-16527-1-git-send-email-famz@redhat.com> <1407746718-16527-3-git-send-email-famz@redhat.com> <20140811143214.GC496@stefanha-thinkpad.redhat.com> <20140812020411.GD6226@T430.nay.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mxv5cy4qt+RJ9ypb" Content-Disposition: inline In-Reply-To: <20140812020411.GD6226@T430.nay.redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 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, Stefan Hajnoczi , qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com --mxv5cy4qt+RJ9ypb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 12, 2014 at 10:04:11AM +0800, Fam Zheng wrote: > On Mon, 08/11 15:32, Stefan Hajnoczi wrote: > > On Mon, Aug 11, 2014 at 04:45:18PM +0800, Fam Zheng wrote: > > > diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out > > > index d7b0f50..f6d9dc1 100644 > > > --- a/tests/qemu-iotests/051.out > > > +++ b/tests/qemu-iotests/051.out > > > @@ -122,7 +122,7 @@ QEMU_PROG: -drive if=3Dvirtio: Device 'virtio-blk= -pci' could not be initialized > > > =20 > > > Testing: -drive if=3Dscsi > > > QEMU X.Y.Z monitor - type 'help' for more information > > > -(qemu) QEMU_PROG: -drive if=3Dscsi: Device needs media, but drive is= empty > > > +(qemu) QEMU_PROG: Device needs media, but drive is empty > > > QEMU_PROG: Device initialization failed. > > > QEMU_PROG: Initialization of device lsi53c895a failed > > > =20 > >=20 > > Have you checked where error_report()'s "location" was set to "-drive > > if=3Dscsi"? > >=20 > > Maybe something similar can be implemented. >=20 > Yes. In scsi_bus_legacy_handle_cmdline (callee of lsi, location is mainta= ined until function > return. Since its callers only use "err" for failure detection, but not f= or > reporting (the specific information) to user, let's call error_report in > scsi_bus_legacy_handle_cmdline. Another option is: void error_prepend(Error **dst_errp, Error *local_err, const char *fmt, .= =2E.); Examples: error_prepend(errp, NULL, "-drive if=3Dscsi") -> NULL error_prepend(errp, "initialization failed", "-drive if=3Dscsi") -> "-dri= ve if=3Dscsi: initialization failed" So basically like error_propagate() except it also adds a prefix to the error message. --mxv5cy4qt+RJ9ypb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT6deOAAoJEJykq7OBq3PIzM8H/3AgwBheM/P9Sl2zkTeId3xL Mn8RbKO1fe9lymAWfKn9gkoGmxi1GjQAGhzSVjk/AwdMQaauOGyhVAsZ/malSzCK sTRh9h4zS3KrE2HHWkDAV7b1zkYZBFoShQZiP/hOzo6sY+o2hr6r9Ue49lghpbQq o0/2wleyukvIDKK5+yjgs6g3yzHhpqEsU+leRYxoYSm1WAWrugYT//ssISwpk726 U8+WOHq0Kaym9BpSuBtogv+KcQ6+9W6zvuKU0VrtkRkl/j7Gz99iWNg1u+cyhT4Q e3TWc+I4lyna157A/MuZrF8EVnQSVZv4pHhjrkUibKbYB6pTY+ijH6NXv9PNhU4= =F1uq -----END PGP SIGNATURE----- --mxv5cy4qt+RJ9ypb--