• E
    maint: forbid 'int foo = true' · eb909376
    Eric Blake 提交于
    I noticed this while working on qemuDomainGetBlockInfo.  Assigning
    a bool value to an int variable compiles fine, but raises red flags
    on the maintenance front as it becomes too easy to assign -1 or 2
    or any other non-bool value to the same variable.
    
    * cfg.mk (sc_prohibit_int_assign_bool): New rule.
    * src/conf/snapshot_conf.c (virDomainSnapshotRedefinePrep): Fix
    offenders.
    * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
    (qemuDomainSnapshotCreateXML): Likewise.
    * src/test/test_driver.c (testDomainSnapshotAlignDisks):
    Likewise.
    * src/util/vircgroup.c (virCgroupSupportsCpuBW): Likewise.
    * src/util/virpci.c (virPCIDeviceBindToStub): Likewise.
    * src/util/virutil.c (virIsCapableVport): Likewise.
    * tools/virsh-domain-monitor.c (cmdDomMemStat): Likewise.
    * tools/virsh-domain.c (cmdBlockResize, cmdScreenshot)
    (cmdInjectNMI, cmdSendKey, cmdSendProcessSignal)
    (cmdDetachInterface): Likewise.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    eb909376
vircgroup.c 125.4 KB