On 05/17/12 16:33, Luiz Capitulino wrote:

> @@ -1060,21 +1060,18 @@ int qemu_opts_validate(QemuOpts *opts, const 
> QemuOptDesc *desc)
>              }
>          }
>          if (desc[i].name == NULL) {
> -            qerror_report(QERR_INVALID_PARAMETER, opt->name);
> -            return -1;
> +            error_set(errp, QERR_INVALID_PARAMETER, opt->name);
> +            return;
>          }
>  
>          opt->desc = &desc[i];
>  
>          qemu_opt_parse(opt, &local_err);
>          if (error_is_set(&local_err)) {
> -            qerror_report_err(local_err);
> -            error_free(local_err);
> -            return -1;
> +            error_propagate(errp, local_err);
> +            return;
>          }
>      }
> -
> -    return 0;
>  }

(I *almost* suggested to drop "local_err" and pass "errp" directly to
qemu_opt_parse(), since the "if" body consists of nothing more than
error_propagate() now. But then I noticed the "return" that aborts the
QTAILQ_FOREACH(), and so we do have to rely on "local_err" -- "errp"
could be NULL, and we could not check *errp for loop-exit purposes. Good.)

Laszlo

Reply via email to