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

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

 



On Fri, Feb 17, 2017 at 15:49:06 +0100, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---
>  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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux