Bug 1498528

Summary: libvirt-3.8.0/src/storage/storage_util.c:1841]: (style) Suspicious condition
Product: [Community] Virtualization Tools Reporter: David Binderman <dcb314>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: libvirt-maint, phrdina, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-04 16:58:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Binderman 2017-10-04 14:19:59 UTC
Description of problem:

libvirt-3.8.0/src/storage/storage_util.c:1841]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Source code is

    if (vol->target.backingStore &&
        (ret = storageBackendUpdateVolTargetInfo(VIR_STORAGE_VOL_FILE,
                                                 vol->target.backingStore,
                                                 withBlockVolFormat,
                                                 VIR_STORAGE_VOL_OPEN_DEFAULT |
                                                 VIR_STORAGE_VOL_OPEN_NOERROR,
                                                 readflags) < 0))

Maybe better code:

    if (vol->target.backingStore &&
        (ret = storageBackendUpdateVolTargetInfo(VIR_STORAGE_VOL_FILE,
                                                 vol->target.backingStore,
                                                 withBlockVolFormat,
                                                 VIR_STORAGE_VOL_OPEN_DEFAULT |
                                                 VIR_STORAGE_VOL_OPEN_NOERROR,
                                                 readflags)) < 0)


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Pavel Hrdina 2017-10-04 16:58:41 UTC
Upstream commit:

commit 000e95045595ab5fd974e08dcc71b70a491965ed
Author: Pavel Hrdina <phrdina>
Date:   Wed Oct 4 16:33:06 2017 +0200

    storage: Fix incorrect parenthesis placement