]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: log error on OOM in virNetDevOpenvswitchAddPort
authorLaine Stump <laine@laine.org>
Thu, 8 Mar 2012 18:48:52 +0000 (13:48 -0500)
committerLaine Stump <laine@laine.org>
Thu, 8 Mar 2012 19:44:24 +0000 (14:44 -0500)
OOM conditions silently returned failure.

src/util/virnetdevopenvswitch.c

index e2d5124b80285b2e5f1f2586b8e0550b47d199f0..61bb9e1eae1d5f03983e1dd4d67118b24f23a0fe 100644 (file)
@@ -64,17 +64,17 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
 
     if (virAsprintf(&attachedmac_ex_id, "external-ids:attached-mac=\"%s\"",
                     macaddrstr) < 0)
-        goto cleanup;
+        goto out_of_memory;
     if (virAsprintf(&ifaceid_ex_id, "external-ids:iface-id=\"%s\"",
                     ifuuidstr) < 0)
-        goto cleanup;
+        goto out_of_memory;
     if (virAsprintf(&vmid_ex_id, "external-ids:vm-id=\"%s\"",
                     vmuuidstr) < 0)
-        goto cleanup;
+        goto out_of_memory;
     if (ovsport->u.openvswitch.profileID[0] != '\0') {
         if (virAsprintf(&profile_ex_id, "external-ids:port-profile=\"%s\"",
                         ovsport->u.openvswitch.profileID) < 0)
-            goto cleanup;
+            goto out_of_memory;
     }
 
     cmd = virCommandNew(OVSVSCTL);
@@ -114,6 +114,10 @@ cleanup:
     VIR_FREE(profile_ex_id);
     virCommandFree(cmd);
     return ret;
+
+out_of_memory:
+    virReportOOMError();
+    goto cleanup;
 }
 
 /**