qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: imammedo@redhat.com, qemu-devel@nongnu.org, afaerber@suse.de,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 1/6] error: Add error_abort
Date: Thu, 05 Dec 2013 06:21:52 -0700	[thread overview]
Message-ID: <52A07DF0.3010408@redhat.com> (raw)
In-Reply-To: <874n6n7ghy.fsf@blackfin.pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

On 12/05/2013 03:13 AM, Markus Armbruster wrote:

>>
>> For error_propagate, if the destination error is &error_abort, then
>> the abort happens at propagation time.
>>
>> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
>> ---
>> changed since v1:
>> Delayed assertions that *errp == NULL.
> 
> Care to explain why you want to delay these assertions?  I'm not sure I
> get it...

error_abort as a global variable is always NULL.

> 
> [...]
>> @@ -31,7 +33,6 @@ void error_set(Error **errp, ErrorClass err_class, const char *fmt, ...)
>>      if (errp == NULL) {
>>          return;
>>      }
>> -    assert(*errp == NULL);

So *&error_abort is null and this assertion would fire, unless we delay
the check for NULL...

>>  
>>      err = g_malloc0(sizeof(*err));
>>  
>> @@ -40,6 +41,12 @@ void error_set(Error **errp, ErrorClass err_class, const char *fmt, ...)
>>      va_end(ap);
>>      err->err_class = err_class;
>>  
>> +    if (errp == &error_abort) {
>> +        error_report("%s", error_get_pretty(err));
>> +        abort();
>> +    }
>> +
>> +    assert(*errp == NULL);

...until after the check for &error_abort.

-- 
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: 621 bytes --]

  reply	other threads:[~2013-12-05 13:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-05  0:47 [Qemu-devel] [PATCH v2 0/6] Add error_abort and associated cleanups Peter Crosthwaite
2013-12-05  0:48 ` [Qemu-devel] [PATCH v2 1/6] error: Add error_abort Peter Crosthwaite
2013-12-05 10:13   ` Markus Armbruster
2013-12-05 13:21     ` Eric Blake [this message]
2013-12-06 11:59       ` Markus Armbruster
2013-12-06 12:43         ` Peter Crosthwaite
2013-12-06 13:16           ` Markus Armbruster
2013-12-05  0:49 ` [Qemu-devel] [PATCH v2 2/6] hw/core/qdev: Delete dead code Peter Crosthwaite
2013-12-05  0:49 ` [Qemu-devel] [PATCH v2 3/6] hw: Remove assert_no_error usages Peter Crosthwaite
2013-12-05  0:50 ` [Qemu-devel] [PATCH v2 4/6] target-i386: Remove assert_no_error usage Peter Crosthwaite
2013-12-05  0:50 ` [Qemu-devel] [PATCH v2 5/6] qemu-option: Remove qemu_opts_create_nofail Peter Crosthwaite
2013-12-05 10:11   ` Markus Armbruster
2013-12-11  3:34     ` Peter Crosthwaite
2013-12-05  0:51 ` [Qemu-devel] [PATCH v2 6/6] qerror: Remove assert_no_error() Peter Crosthwaite

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=52A07DF0.3010408@redhat.com \
    --to=eblake@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --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 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).