From: Eric Blake <eblake@redhat.com>
To: Peter Crosthwaite <crosthwaitepeter@gmail.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v1 00/25] error: Automatic error concatenation and prefixing
Date: Fri, 11 Sep 2015 09:27:28 -0600 [thread overview]
Message-ID: <55F2F2E0.4030006@redhat.com> (raw)
In-Reply-To: <cover.1441667360.git.crosthwaite.peter@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4673 bytes --]
On 09/10/2015 11:33 PM, Peter Crosthwaite wrote:
> Hi Markus and all,
>
> This patch series adds support for automatically concatenating multiple
> errors to the one Error *.
Sounds interesting!
> So the plan is:
>
> 1: Allow an Error * to contain more that one actual error from API
> calls.
Is this for all errors, or do you have to make a special call to make it
obvious that a particular error can be concatenated to while the default
is still to report programming error if a second error is attempted atop
a regular error that hasn't requested concatenation?
> 2: Refactor key APIs (some_similar_api_call() in the above example)
> to not fatal when previous errors have occured in dependencies.
>
> Point 1 kind of got big on me. Patch 4 is the main event, listifying
> errors. The follow up issue however, is it tricky to get a sane
> definition of error_get_pretty for a multi-error. So instead the
> strategy is to remove error_get_pretty() and replace with some error
> API helper with well defined behaviour for multi-error. The two leading
> uses of error get pretty are prefixing an error, and reporting an error
> via a custom printf handler. So two new APIs are added for that (P5-6).
> There aren't many error_get_pretty's left after that, and they
> shouldn't be in the path of any multi-errors.
>
> I think the error_prefix is valuable it its own right, as it now means
> the code for report or propagating a prefixed error is now consistent
> with the non-prefixed variants.
>
> That is, we used to have:
>
> /* If we are prefixing we have to do it this way: */
> error_setg(errp, "some prefix %s", error_get_pretty(local_err));
> error_free(local_err);
>
> vs:
>
> /* but if not prefixing it is like this: */
> error_propagate(errp, local_err);
>
> Now with this patch series the two are much more recognisable as the same
> with:
>
> /* This code is almost the same as the above non-prefixed propagation */
> error_prefix(local_err, "some prefix"):
> error_propagate(errp, local_err);
Seems nice in its own right.
>
> Point 2 is less about error API and more about machine generation.
> Sysbus, Memory and Qdev all have APIs that depend on successful device-
> init and realize calls for argument devices. As we are trying to remove
> the error detection for those argument devs, those APIs need to tweaked
> to handle realize failure. This actually wasn't as bad as I thought it
> would be. See patches (7-9).
>
> All patches after that walk the various major subsystems converting
> error APIs to this new scheme and deleting now-unneeded boiler plate.
> ARM is first (P10-15) seeing good clean up of propagate handers.
>
> So the net result for these ARM machines, is error behaviour that is
> something like a compiler. If any one thing fails, then machine-init
> (compilation) fails. But an early fail does not stop machine-init
> (compilation), instead it proceeds to the end collecting subsequent
> errors as it goes.
Sometimes that causes more problems (ignoring an error and proceeding on
can cause confusing followup errors), but usually it manages to work out.
>
> Some other interesting food for thought is the qemu_fdt APIs which I
> have been wanting to convert to error API but the local_err propagation
> is going to be brutal in heavy users like e500.c. This would solve that
> as fdt API could be easily made multi-error safe and clients like e500
> can just collect multi-errors and single-fail at the end.
>
> Long term, we can use this to catch cases of multiple genuine machine
> init errors in the one boot but that is a secondary goal to simply
> cutting down on code boilerplate. The best feature of this series is
> the diffstat.
>
> Patches 1-3 are cleanup that can be taken independent of the series.
>
> I think P3 may be obsolete from a recent merge, but i'll wait
> for architectural feedback before rebasing.
Yeah, both Markus and I have been touching error.c lately, so a rebase
will probably be needed.
>
> Regards,
> Peter
> --END---
>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
> __HAS_COVER__ | 0
> 1 file changed, 0 insertions(+), 0 deletions(-)
> create mode 100644 __HAS_COVER__
>
> diff --git a/__HAS_COVER__ b/__HAS_COVER__
> new file mode 100644
> index 0000000..e69de29
>
Huh - whatever you are using to version your cover letter made the real
diffstat be part of the signature rather than the main body of the email.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
prev parent reply other threads:[~2015-09-11 15:27 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 5:33 [Qemu-devel] [RFC PATCH v1 00/25] error: Automatic error concatenation and prefixing Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 01/25] exec: convert error_report to error_report_err Peter Crosthwaite
2015-09-11 15:28 ` Eric Blake
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 02/25] s390x: virtio-ccw: Remove un-needed if guard Peter Crosthwaite
2015-09-11 15:28 ` Eric Blake
2015-09-14 7:09 ` Cornelia Huck
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 03/25] error: Factor out common error setter logic Peter Crosthwaite
2015-09-11 15:30 ` Eric Blake
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 04/25] error: Add support for multiple errors Peter Crosthwaite
2015-09-11 15:49 ` Eric Blake
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 05/25] error: Add error prefix API Peter Crosthwaite
2015-09-11 16:04 ` Eric Blake
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 06/25] error: Add error_printf_fn() Peter Crosthwaite
2015-09-11 16:10 ` Eric Blake
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 07/25] sysbus: mmio_map+mmio_get_region: ignore range OOB errors Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 08/25] memory: nop APIs when they have NULL arguments Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 09/25] qdev: gpio: Ignore unconnectable GPIOs Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 10/25] arm: xlnx-zynqmp: Update error API usages Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 11/25] arm: fsl-imx*: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 12/25] arm: netduino: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 13/25] arm: allwinner: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 14/25] arm: digic: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 15/25] cpu: arm: Remove un-needed error checking Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 16/25] ppc: Update error API usages Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 17/25] i386: pc: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 18/25] monitor: update " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 19/25] qdev: Update " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 20/25] block: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 21/25] tests: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 22/25] usb: bus: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 23/25] scsi: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 24/25] migration: savevm: " Peter Crosthwaite
2015-09-11 5:33 ` [Qemu-devel] [RFC PATCH v1 25/25] core: " Peter Crosthwaite
2015-09-11 6:42 ` [Qemu-devel] [RFC PATCH v1 00/25] error: Automatic error concatenation and prefixing Markus Armbruster
2015-09-11 15:53 ` Eric Blake
2015-09-11 15:27 ` Eric Blake [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F2F2E0.4030006@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=crosthwaitepeter@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.