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=virtio: Device 'virtio-blk-pci' > > > could not be initialized > > > > > > Testing: -drive if=scsi > > > QEMU X.Y.Z monitor - type 'help' for more information > > > -(qemu) QEMU_PROG: -drive if=scsi: 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 > > > > > > > Have you checked where error_report()'s "location" was set to "-drive > > if=scsi"? > > > > Maybe something similar can be implemented. > > Yes. In scsi_bus_legacy_handle_cmdline (callee of lsi, location is maintained > until function > return. Since its callers only use "err" for failure detection, but not for > 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, ...); Examples: error_prepend(errp, NULL, "-drive if=scsi") -> NULL error_prepend(errp, "initialization failed", "-drive if=scsi") -> "-drive if=scsi: initialization failed" So basically like error_propagate() except it also adds a prefix to the error message.
pgpFVh79ov1sg.pgp
Description: PGP signature