[libvirt] [PATCH] fs: Fix '<' comparison of value produced by logical not '!'

Erik Skultety eskultet at redhat.com
Tue Jul 19 07:47:05 UTC 2016


Commit da665fbd introduced the following condition to virLXCProcessEnsureRootFS
and openvzReadFSConf:

if (!(<some_var> = virDomainFSDefNew()) < 0)

which broke the build on fedora with GCC 5.3.1: "logical not is only applied to
the left hand side of comparison".

Signed-off-by: Erik Skultety <eskultet at redhat.com>
---
Pushed under the build breaker rule.

 src/lxc/lxc_process.c    | 2 +-
 src/openvz/openvz_conf.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 6761394..7703fe1 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1153,7 +1153,7 @@ virLXCProcessEnsureRootFS(virDomainObjPtr vm)
     if (root)
         return 0;
 
-    if (!(root = virDomainFSDefNew()) < 0)
+    if (!(root = virDomainFSDefNew()))
         goto error;
 
     root->type = VIR_DOMAIN_FS_TYPE_MOUNT;
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index cb30b32..9b820a9 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -351,7 +351,7 @@ openvzReadFSConf(virDomainDefPtr def,
                        veid);
         goto error;
     } else if (ret > 0) {
-        if (!(fs = virDomainFSDefNew()) < 0)
+        if (!(fs = virDomainFSDefNew()))
             goto error;
 
         fs->type = VIR_DOMAIN_FS_TYPE_TEMPLATE;
-- 
2.5.5




More information about the libvir-list mailing list