All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Peter Lieven <pl@kamp.de>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] util: introduce bitmap_try_new
Date: Fri, 05 Sep 2014 16:17:46 -0600	[thread overview]
Message-ID: <540A368A.9030902@redhat.com> (raw)
In-Reply-To: <540A164C.6090003@kamp.de>

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

On 09/05/2014 02:00 PM, Peter Lieven wrote:

>>> +
>> What you have works, but I personally would have reimplemented
>> bitmap_new as the first caller of bitmap_try_new in this patch, where
>> bitmap_new handles a NULL bitmap_try_new return by abort()ing, so that
>> it has the same behavior.  By routing the one function to use the other,
>> we are future-proofing: if initialization of a bitmap ever needs
>> modification, we only update bitmap_try_new, rather than copying the
>> updates to both functions.
>>
> 
> Good point. What would be the right exit if we receive a NULL from
> bitmap_try_new? abort() ?

I think that g_malloc() calls abort(), so yes, that sounds right.

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

  reply	other threads:[~2014-09-05 22:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22  9:26 [Qemu-devel] [PATCH 0/2] introduce bitmap_try_new Peter Lieven
2014-08-22  9:26 ` [Qemu-devel] [PATCH 1/2] util: " Peter Lieven
2014-08-25 15:09   ` Eric Blake
2014-09-05 20:00     ` Peter Lieven
2014-09-05 22:17       ` Eric Blake [this message]
2014-08-22  9:26 ` [Qemu-devel] [PATCH 2/2] block/iscsi: handle failure on malloc of the allocationmap Peter Lieven
2014-08-25 10:37   ` Paolo Bonzini
2014-08-25 11:10     ` Peter Lieven
2014-08-25 11:20       ` Paolo Bonzini
2014-08-25 11:26         ` Peter Lieven
2014-08-25 11:42           ` Paolo Bonzini

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=540A368A.9030902@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 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.