All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Otubo <otubo@redhat.com>, Alexander Graf <agraf@suse.de>,
	qemu-trivial@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCHv2] dma/i82374: avoid double creation of i82374 device
Date: Wed, 04 Oct 2017 06:50:28 +0200	[thread overview]
Message-ID: <87d163v7mz.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20171003133705.GH17385@localhost.localdomain> (Eduardo Habkost's message of "Tue, 3 Oct 2017 10:37:05 -0300")

Eduardo Habkost <ehabkost@redhat.com> writes:

> On Mon, Oct 02, 2017 at 02:50:07PM +0200, Paolo Bonzini wrote:
>> On 29/09/2017 21:31, Eduardo Habkost wrote:
>> >> -void DMA_init(ISABus *bus, int high_page_enable)
>> >> +void DMA_init(ISABus *bus, int high_page_enable, Error **errp)
>> > 
>> > If you make the function return a boolean to indicate success (in
>> > addition to setting *errp), you avoid the need for a local_err
>> > variable on the caller.
>> 
>> I think in this case, rather than a bool, it would be better to return 0
>> or -EBUSY.  A check for "< 0" would be more self-explanatory in the caller.
>
> I'm OK with that, too.
>
> We really need to document the available and preferred error
> reporting styles somewhere (probably on qapi/error.h).  We
> discussed that a lot recently[1], but the conclusions were not
> documented anywhere.
>
> [1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg461702.html

Yes, we need to document it.  We also need to convert existing code.

In my experience, documentation is a great time saver when people ask
questions.  It's less successful at getting people do the right thing.
For that, you have to make good examples common and bad examples
sufficiently rare.


WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Otubo <otubo@redhat.com>, Alexander Graf <agraf@suse.de>,
	qemu-trivial@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCHv2] dma/i82374: avoid double creation of i82374 device
Date: Wed, 04 Oct 2017 06:50:28 +0200	[thread overview]
Message-ID: <87d163v7mz.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20171003133705.GH17385@localhost.localdomain> (Eduardo Habkost's message of "Tue, 3 Oct 2017 10:37:05 -0300")

Eduardo Habkost <ehabkost@redhat.com> writes:

> On Mon, Oct 02, 2017 at 02:50:07PM +0200, Paolo Bonzini wrote:
>> On 29/09/2017 21:31, Eduardo Habkost wrote:
>> >> -void DMA_init(ISABus *bus, int high_page_enable)
>> >> +void DMA_init(ISABus *bus, int high_page_enable, Error **errp)
>> > 
>> > If you make the function return a boolean to indicate success (in
>> > addition to setting *errp), you avoid the need for a local_err
>> > variable on the caller.
>> 
>> I think in this case, rather than a bool, it would be better to return 0
>> or -EBUSY.  A check for "< 0" would be more self-explanatory in the caller.
>
> I'm OK with that, too.
>
> We really need to document the available and preferred error
> reporting styles somewhere (probably on qapi/error.h).  We
> discussed that a lot recently[1], but the conclusions were not
> documented anywhere.
>
> [1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg461702.html

Yes, we need to document it.  We also need to convert existing code.

In my experience, documentation is a great time saver when people ask
questions.  It's less successful at getting people do the right thing.
For that, you have to make good examples common and bad examples
sufficiently rare.

  reply	other threads:[~2017-10-04  4:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 14:05 [Qemu-trivial] [PATCHv2] dma/i82374: avoid double creation of i82374 device Eduardo Otubo
2017-09-29 14:05 ` [Qemu-devel] " Eduardo Otubo
2017-09-29 14:11 ` [Qemu-trivial] " no-reply
2017-09-29 14:11   ` no-reply
2017-09-29 14:12 ` [Qemu-trivial] " no-reply
2017-09-29 14:12   ` no-reply
2017-09-29 19:31 ` [Qemu-trivial] " Eduardo Habkost
2017-09-29 19:31   ` [Qemu-devel] " Eduardo Habkost
2017-10-02 12:50   ` [Qemu-trivial] " Paolo Bonzini
2017-10-02 12:50     ` [Qemu-devel] " Paolo Bonzini
2017-10-03 13:37     ` [Qemu-trivial] " Eduardo Habkost
2017-10-03 13:37       ` [Qemu-devel] " Eduardo Habkost
2017-10-04  4:50       ` Markus Armbruster [this message]
2017-10-04  4:50         ` Markus Armbruster

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=87d163v7mz.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=agraf@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=otubo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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.