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