qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 08/23] test-throttle: Simplify qemu_init_main


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 08/23] test-throttle: Simplify qemu_init_main_loop() error handling
Date: Thu, 17 Dec 2015 13:19:45 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/17/2015 09:49 AM, Markus Armbruster wrote:
> The code looks like it tries to check for both qemu_init_main_loop()
> and qemu_get_aio_context() failure in one conditional.  In fact,
> qemu_get_aio_context() can fail only after qemu_init_main_loop()
> failed.
> 
> Simplify accordingly: check for qemu_init_main_loop() error directly,
> without bothering to improve its error message.  Call
> qemu_get_aio_context() only when qemu_get_aio_context() succeeded.  It
> can't fail then, so no need to check.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  tests/test-throttle.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)

Much simpler :)

Reviewed-by: Eric Blake <address@hidden>

-- 
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]