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

Re: [libvirt] [PATCH 02/13] conf: remove redundant iothreads variable



On Fri, Feb 17, 2017 at 15:49:06 +0100, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina redhat com>
> ---
>  src/conf/domain_conf.c  | 32 +++++++++++++++++---------------
>  src/conf/domain_conf.h  |  1 -
>  src/qemu/qemu_driver.c  |  6 ------
>  src/qemu/qemu_process.c |  1 -
>  4 files changed, 17 insertions(+), 23 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index a179c1e278..71cd572a30 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c

[...]

> @@ -16755,8 +16756,9 @@ virDomainDefParseXML(xmlDocPtr xml,
>          goto error;
>  
>      /* Optional - iothreads */
> +    unsigned int iothreads;

This will be used uninitialized ...

>      tmp = virXPathString("string(./iothreads[1])", ctxt);
> -    if (tmp && virStrToLong_uip(tmp, NULL, 10, &def->iothreads) < 0) {
> +    if (tmp && virStrToLong_uip(tmp, NULL, 10, &iothreads) < 0) {

if tmp is NULL

>          virReportError(VIR_ERR_XML_ERROR,
>                         _("invalid iothreads count '%s'"), tmp);
>          goto error;
> @@ -16767,8 +16769,8 @@ virDomainDefParseXML(xmlDocPtr xml,
>      if ((n = virXPathNodeSet("./iothreadids/iothread", ctxt, &nodes)) < 0)
>          goto error;
>  
> -    if (n > def->iothreads)
> -        def->iothreads = n;
> +    if (n > iothreads)

... here ...

> +        iothreads = n;
>  
>      if (n && VIR_ALLOC_N(def->iothreadids, n) < 0)

... and here.

>          goto error;

ACK with the above fixed.

Attachment: signature.asc
Description: PGP signature


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