]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix logic in qemuDomainObjPrivateXMLParseVcpu
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 11 Jul 2016 09:30:03 +0000 (10:30 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 11 Jul 2016 09:32:50 +0000 (10:32 +0100)
commited1fbd7c5ba90ce10cb9a7e35f32a4b4354988aa
tree20425f8e33b618da2a57eda3e83737b2cb78eda4
parent4074a82c0cc128003864208e22a42993083d0e04
Fix logic in qemuDomainObjPrivateXMLParseVcpu

The code in qemuDomainObjPrivateXMLParseVcpu for parsing
the 'idstr' string was comparing the overall boolean
result against 0 which was always true

qemu/qemu_domain.c: In function 'qemuDomainObjPrivateXMLParseVcpu':
qemu/qemu_domain.c:1482:59: error: comparison of constant '0' with boolean expression is always false [-Werror=bool-compare]
     if ((idstr && virStrToLong_uip(idstr, NULL, 10, &idx)) < 0 ||
                                                           ^

It was further performing two distinct error checks in
the same conditional and reporting a single error message,
which was misleading in one of the two cases.

This splits the conditional check into two parts with
distinct error messages and fixes the logic error.

Fixes the bug in

  commit 5184f398b40a5e0d7d84b86182edcb2b48ab04ba
  Author: Peter Krempa <pkrempa@redhat.com>
  Date:   Fri Jul 1 14:56:14 2016 +0200

    qemu: Store vCPU thread ids in vcpu private data objects

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/qemu/qemu_domain.c