[libvirt] [PATCH 1/9] util: Fix condition check in virDiskNameToIndex

Peter Krempa pkrempa at redhat.com
Fri Nov 3 12:03:29 UTC 2017


Use the more common '< 0' rather than the non-zero check.
---
 src/util/virutil.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virutil.c b/src/util/virutil.c
index 170e92192..8bdcb02fd 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -562,7 +562,7 @@ int virDiskNameToIndex(const char *name)
 {
     int idx;

-    if (virDiskNameParse(name, &idx, NULL))
+    if (virDiskNameParse(name, &idx, NULL) < 0)
         idx = -1;

     return idx;
-- 
2.14.3




More information about the libvir-list mailing list