]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
xenapi: Resolve Coverity NO_EFFECT
authorJohn Ferlan <jferlan@redhat.com>
Tue, 10 Mar 2015 22:41:18 +0000 (18:41 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 11 Mar 2015 17:02:10 +0000 (13:02 -0400)
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.

src/xenapi/xenapi_utils.c

index 91bc64929e148db9a53fd51b712841b9d6b1cb13..ce09dfeeb31ea97ddf9c89ba684f818b2f98565d 100644 (file)
@@ -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)