From d403b84cf332e0f4608b8837b2b2e4b342c78abf Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Thu, 8 Mar 2012 13:48:52 -0500 Subject: [PATCH] util: log error on OOM in virNetDevOpenvswitchAddPort OOM conditions silently returned failure. --- src/util/virnetdevopenvswitch.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index e2d5124b80..61bb9e1eae 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -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; } /**