qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 1/6] memory: add memory_region_init_ram_may_f


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v4 1/6] memory: add memory_region_init_ram_may_fail() and memory_region_init_ram_ptr_may_fail()
Date: Tue, 05 Aug 2014 05:47:03 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

On 08/04/2014 11:56 PM, Hu Tao wrote:
> These two are almost the same as memory_region_init_ram() and
> memory_region_init_ram_ptr() except that they have an extra errp
> parameter to let callers handle error. The purpose is to fix the bug
> described below.
> 
> We should have added errp directly to memory_region_ram(), but that
> mixes updates to calls to memory_region_ram() and this bug fix and make
> it hard to review.
> 
> We will rename _may_fail variants later so that we will have two versions
> of API: one with errp parameter(memory_region_init_ram(),
> memory_region_init_ram_ptr()), one without errp parameter and with
> suffix _nofail.

That feels like overkill.  Every caller that calls the _nofail variant
can instead call memory_region_init_ram(..., &error_abort), and then you
don't need the _nofail version.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]