qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC 0/3] error: allow local errors to trigger abort
@ 2015-06-16 12:53 Michael S. Tsirkin
  2015-06-16 12:53 ` [Qemu-devel] [PATCH RFC 1/3] error: don't rely on pointer comparisons Michael S. Tsirkin
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Michael S. Tsirkin @ 2015-06-16 12:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, armbru, dgilbert

    
    It's a common idiom:
    
        Error *local_err = NULL;
        ....
        foo(&local_err);
        ...
        if (local_err) {
            error_propagate(errp, local_err);
            return;
        }
    
    Unfortunately it means that call to foo(&local_err) will
    not abort even if errp is set to error_abort.
    
    Instead, we get an abort at error_propagate which is too late.
    
    To fix, add an API to check errp and set local_err to error_abort
    if errp is error_abort.

Michael S. Tsirkin (3):
  error: don't rely on pointer comparisons
  error: allow local errors to trigger abort
  block/nfs: switch to error_init_local

 include/qapi/error.h |  5 +++++
 block/nfs.c          |  2 +-
 util/error.c         | 21 ++++++++++++++++-----
 3 files changed, 22 insertions(+), 6 deletions(-)

-- 
MST

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-06-17 14:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-16 12:53 [Qemu-devel] [PATCH RFC 0/3] error: allow local errors to trigger abort Michael S. Tsirkin
2015-06-16 12:53 ` [Qemu-devel] [PATCH RFC 1/3] error: don't rely on pointer comparisons Michael S. Tsirkin
2015-06-16 14:45   ` Eric Blake
2015-06-16 14:49     ` Michael S. Tsirkin
2015-06-16 14:50     ` Eric Blake
2015-06-16 15:03   ` Eric Blake
2015-06-17  6:57     ` Michael S. Tsirkin
2015-06-17  9:11       ` Kevin Wolf
2015-06-16 12:53 ` [Qemu-devel] [PATCH RFC 2/3] error: allow local errors to trigger abort Michael S. Tsirkin
2015-06-16 15:06   ` Eric Blake
2015-06-16 12:53 ` [Qemu-devel] [PATCH RFC 3/3] block/nfs: switch to error_init_local Michael S. Tsirkin
2015-06-16 15:08   ` Eric Blake
2015-06-16 21:17     ` Michael S. Tsirkin
2015-06-17 14:26 ` [Qemu-devel] [PATCH RFC 0/3] error: allow local errors to trigger abort John Snow
2015-06-17 14:28   ` Michael S. Tsirkin
2015-06-17 14:29   ` Kevin Wolf
2015-06-17 14:30     ` John Snow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).