mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
util: log error on OOM in virNetDevOpenvswitchAddPort
OOM conditions silently returned failure.
This commit is contained in:
parent
ac8bbdbdfa
commit
d403b84cf3
@ -64,17 +64,17 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
|
|||||||
|
|
||||||
if (virAsprintf(&attachedmac_ex_id, "external-ids:attached-mac=\"%s\"",
|
if (virAsprintf(&attachedmac_ex_id, "external-ids:attached-mac=\"%s\"",
|
||||||
macaddrstr) < 0)
|
macaddrstr) < 0)
|
||||||
goto cleanup;
|
goto out_of_memory;
|
||||||
if (virAsprintf(&ifaceid_ex_id, "external-ids:iface-id=\"%s\"",
|
if (virAsprintf(&ifaceid_ex_id, "external-ids:iface-id=\"%s\"",
|
||||||
ifuuidstr) < 0)
|
ifuuidstr) < 0)
|
||||||
goto cleanup;
|
goto out_of_memory;
|
||||||
if (virAsprintf(&vmid_ex_id, "external-ids:vm-id=\"%s\"",
|
if (virAsprintf(&vmid_ex_id, "external-ids:vm-id=\"%s\"",
|
||||||
vmuuidstr) < 0)
|
vmuuidstr) < 0)
|
||||||
goto cleanup;
|
goto out_of_memory;
|
||||||
if (ovsport->u.openvswitch.profileID[0] != '\0') {
|
if (ovsport->u.openvswitch.profileID[0] != '\0') {
|
||||||
if (virAsprintf(&profile_ex_id, "external-ids:port-profile=\"%s\"",
|
if (virAsprintf(&profile_ex_id, "external-ids:port-profile=\"%s\"",
|
||||||
ovsport->u.openvswitch.profileID) < 0)
|
ovsport->u.openvswitch.profileID) < 0)
|
||||||
goto cleanup;
|
goto out_of_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = virCommandNew(OVSVSCTL);
|
cmd = virCommandNew(OVSVSCTL);
|
||||||
@ -114,6 +114,10 @@ cleanup:
|
|||||||
VIR_FREE(profile_ex_id);
|
VIR_FREE(profile_ex_id);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
out_of_memory:
|
||||||
|
virReportOOMError();
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user