[libvirt] [PATCH 3/6] xenapi: Resolve Coverity NO_EFFECT

John Ferlan jferlan at redhat.com
Tue Mar 10 23:20:26 UTC 2015


Coverity points out that check (def->uuid) has no effect since it's not
a pointer, rather an array of characters.   Just remove the extranous check.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/xenapi/xenapi_utils.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index 91bc649..ce09dfe 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -455,11 +455,9 @@ createVMRecordFromXml(virConnectPtr conn, virDomainDefPtr def,
     *record = xen_vm_record_alloc();
     if (VIR_STRDUP((*record)->name_label, def->name) < 0)
         goto error;
-    if (def->uuid) {
-        virUUIDFormat(def->uuid, uuidStr);
-        if (VIR_STRDUP((*record)->uuid, uuidStr) < 0)
-            goto error;
-    }
+    virUUIDFormat(def->uuid, uuidStr);
+    if (VIR_STRDUP((*record)->uuid, uuidStr) < 0)
+        goto error;
     if (STREQ(def->os.type, "hvm")) {
         char *boot_order = NULL;
         if (VIR_STRDUP((*record)->hvm_boot_policy, "BIOS order") < 0)
-- 
2.1.0




More information about the libvir-list mailing list