提交 d403b84c 编写于 作者: L Laine Stump

util: log error on OOM in virNetDevOpenvswitchAddPort

OOM conditions silently returned failure.
上级 ac8bbdbd
......@@ -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;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册