qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 37/40] machine: add smp compound property


From: Peter Maydell
Subject: Re: [PULL 37/40] machine: add smp compound property
Date: Tue, 13 Jul 2021 11:37:27 +0100

On Tue, 6 Jul 2021 at 11:39, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Make -smp syntactic sugar for a compound property "-machine
> smp.{cores,threads,cpu,...}".  machine_smp_parse is replaced by the
> setter for the property.
>
> numa-test will now cover the new syntax, while other tests
> still use -smp.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Hi; Coverity reports a leak in this code (CID 1458085):

> +static void
> +machine_parse_property_opt(QemuOptsList *opts_list, const char *propname,
> +                           const char *arg, Error **errp)
> +{
> +    QDict *opts, *prop;
> +    bool help = false;
> +    ERRP_GUARD();
> +
> +    prop = keyval_parse(arg, opts_list->implied_opt_name, &help, errp);
> +    if (help) {
> +        qemu_opts_print_help(opts_list, true);
> +        return;

In this return path we don't unref 'prop'.

> +    }
> +    opts = qdict_new();
> +    qdict_put(opts, propname, prop);
> +    keyval_merge(machine_opts_dict, opts, errp);
> +    qobject_unref(opts);
> +}

thanks
-- PMM



reply via email to

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