qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/7] do_device_add(): look up "device" opts list


From: Laszlo Ersek
Subject: Re: [Qemu-devel] [PATCH 2/7] do_device_add(): look up "device" opts list with qemu_find_opts_err()
Date: Tue, 05 Feb 2013 18:30:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130108 Thunderbird/10.0.12

On 02/05/13 09:45, Paolo Bonzini wrote:
> Il 05/02/2013 01:04, Laszlo Ersek ha scritto:
>>>> list = qemu_find_opts_err("device", &local_err);
>>>> if (error_is_set(&local_err)) {
>>>>    /* handle error */
>>>> }
>>>>
>>>> opts = qemu_opts_from_qdict(..., &local_err);
>>>> if (error_is_set(&local_err)) {
>>>>    /* handle error */
>>>> }
>> /* handle error */ is exactly the same for both checks (print it, free
>> it, bail out); I wanted to avoid duplicating that block. I'll redo it
>> without the assignments in the controlling expression but will keep the
>> handler block common if you don't mind.
> 
> Would a goto help?

In the end I'd like to restructure do_device_add() more deeply.
Extracting the HMP parts should simplify the control flow, it would work
toward said end automatically. For this series I wanted to keep the
impact contained. I haven't been on qemu-devel for a long time, but I've
already learned to (try to) minimize the attack surface.

Thanks
Laszlo



reply via email to

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