qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: David Hildenbrand <david@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>,
	Thomas Huth <thuth@redhat.com>, Cornelia Huck <cohuck@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-s390x@nongnu.org, qemu-ppc@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v1 2/8] spapr: no need to verify the node
Date: Fri, 8 Jun 2018 13:53:49 +0200	[thread overview]
Message-ID: <20180608135349.61bf51fe@bahia.lan> (raw)
In-Reply-To: <c9aba2a1-2232-457b-db6d-c2935711231d@redhat.com>

On Fri, 8 Jun 2018 13:28:01 +0200
David Hildenbrand <david@redhat.com> wrote:

> On 08.06.2018 12:52, Greg Kurz wrote:
> > On Fri, 8 Jun 2018 11:24:51 +0200
> > David Hildenbrand <david@redhat.com> wrote:
> >   
> >>>>>> +1 for error_abort, even if it takes another line.      
> >>>>> +1 for error_abort
> >>>>> call shouldn't fail, but if does it won't be silently ignored
> >>>>> and introduce undefined behavior.      
> >>>>
> >>>> Maybe we should fix the others that pass in NULL.
> >>>>
> >>>> (no, not me :D - I'm already busy with your requested pre_plug handling)    
> >>> Add it to wiki page for bite sized tasks?    
> >>
> >> Done.
> >>
> >>  
> > 
> > FWIW, I've also added a line to check and possibly fix places where we do
> > 'if (*errp)', which would cause QEMU to crash if the caller passes NULL.
> > 
> > $ git grep 'if (\*errp)'
> > hmp.c:    if (*errp) {
> > hw/ipmi/isa_ipmi_bt.c:    if (*errp)
> > hw/ipmi/isa_ipmi_kcs.c:    if (*errp)
> > hw/mem/memory-device.c:    if (*errp) {
> > hw/mem/memory-device.c:        if (*errp) {
> > hw/ppc/spapr.c:        if (*errp) {
> > hw/s390x/event-facility.c:        if (*errp) {
> > include/qapi/error.h: *     if (*errp) { // WRONG!
> > qga/commands-posix.c:            if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:        if (*errp) {
> > target/s390x/cpu_models.c:            if (*errp) {
> > target/s390x/cpu_models.c:        if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > target/s390x/cpu_models.c:    if (*errp) {
> > tests/test-crypto-tlscredsx509.c:    if (*errp) {
> > tests/test-io-channel-tls.c:    if (*errp) {
> >   
> 
> I think the more important part is actually looking out for people that
> use NULL instead of error_abort. This way we won't silently ignore errors.
> 

I agree that we should probably pass &error_abort in many places,
but passing NULL isn't bad per se. It means any failure in the
callee is unimportant enough that we can simply ignore it.

The error framework provides this possibility and so we should
never dereference errp.

  parent reply	other threads:[~2018-06-08 11:54 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 16:52 [Qemu-devel] [PATCH v1 0/8] pc/spapr/s390x: machine hotplug handler cleanups David Hildenbrand
2018-06-07 16:52 ` [Qemu-devel] [PATCH v1 1/8] pc: local error handling in hotplug handler functions David Hildenbrand
2018-06-08  8:04   ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2018-06-08  8:05     ` David Hildenbrand
2018-06-07 16:52 ` [Qemu-devel] [PATCH v1 2/8] spapr: no need to verify the node David Hildenbrand
2018-06-08  3:28   ` David Gibson
2018-06-08  7:34   ` Greg Kurz
2018-06-08  7:42     ` David Hildenbrand
2018-06-08  7:46       ` Greg Kurz
2018-06-08  7:48         ` David Hildenbrand
2018-06-08  8:07           ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2018-06-08  8:39             ` Igor Mammedov
2018-06-08  8:41               ` David Hildenbrand
2018-06-08  9:06                 ` Igor Mammedov
2018-06-08  9:24                   ` David Hildenbrand
2018-06-08 10:52                     ` Greg Kurz
2018-06-08 11:28                       ` David Hildenbrand
2018-06-08 11:31                         ` Cornelia Huck
2018-06-08 11:53                         ` Greg Kurz [this message]
2018-06-08  8:20         ` [Qemu-devel] " David Gibson
2018-06-08  8:24           ` David Hildenbrand
2018-06-07 16:52 ` [Qemu-devel] [PATCH v1 3/8] spapr: move all DIMM checks into spapr_memory_plug David Hildenbrand
2018-06-08  3:28   ` David Gibson
2018-06-08  8:05   ` Greg Kurz
2018-06-08  8:07     ` David Hildenbrand
2018-06-08  8:41       ` Igor Mammedov
2018-06-07 16:52 ` [Qemu-devel] [PATCH v1 4/8] spapr: local error handling in hotplug handler functions David Hildenbrand
2018-06-08  3:29   ` David Gibson
2018-06-08  8:40   ` Greg Kurz
2018-06-07 16:52 ` [Qemu-devel] [PATCH v1 5/8] spapr: introduce machine unplug handler David Hildenbrand
2018-06-08  3:29   ` David Gibson
2018-06-08  8:44   ` Igor Mammedov
2018-06-08  8:56   ` Greg Kurz
2018-06-07 16:52 ` [Qemu-devel] [PATCH v1 6/8] spapr: handle pc-dimm unplug via hotplug handler chain David Hildenbrand
2018-06-08  3:30   ` David Gibson
2018-06-08  8:56   ` Igor Mammedov
2018-06-08  9:02     ` David Hildenbrand
2018-06-08  9:35       ` Igor Mammedov
2018-06-08  9:36         ` David Hildenbrand
2018-06-08  8:59   ` Greg Kurz
2018-06-07 16:52 ` [Qemu-devel] [PATCH v1 7/8] spapr: handle cpu core " David Hildenbrand
2018-06-08  3:31   ` David Gibson
2018-06-08  8:57   ` Igor Mammedov
2018-06-08  9:00   ` Greg Kurz
2018-06-07 16:52 ` [Qemu-devel] [PATCH v1 8/8] s390x: local error handling in hotplug handler functions David Hildenbrand
2018-06-08  7:25   ` Cornelia Huck
2018-06-08  7:27     ` Christian Borntraeger
2018-06-08  7:40       ` David Hildenbrand
2018-06-08  7:50         ` Christian Borntraeger
2018-06-08  9:03         ` Igor Mammedov
2018-06-08  9:19           ` David Hildenbrand
2018-06-08  7:58 ` [Qemu-devel] [PATCH v1 0/8] pc/spapr/s390x: machine hotplug handler cleanups David Hildenbrand

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=20180608135349.61bf51fe@bahia.lan \
    --to=groug@kaod.org \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=david@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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).