mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
openvz: Get rid of "no_memory" labels
As pointed out by Ján Tomko, "no_memory seems suspicious in the times of abort()". As libvirt decided to take the path to not report OOM and simply abort when it happens, let's get rid of the no_memory labels and simplify the code around them. Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
parent
ca49b6eccf
commit
e08cc72ec8
@ -148,18 +148,18 @@ openvzParseBarrierLimit(const char* value,
|
|||||||
|
|
||||||
virCapsPtr openvzCapsInit(void)
|
virCapsPtr openvzCapsInit(void)
|
||||||
{
|
{
|
||||||
virCapsPtr caps;
|
g_autoptr(virCaps) caps = NULL;
|
||||||
virCapsGuestPtr guest;
|
virCapsGuestPtr guest;
|
||||||
|
|
||||||
if ((caps = virCapabilitiesNew(virArchFromHost(),
|
if ((caps = virCapabilitiesNew(virArchFromHost(),
|
||||||
false, false)) == NULL)
|
false, false)) == NULL)
|
||||||
goto no_memory;
|
return NULL;
|
||||||
|
|
||||||
if (!(caps->host.numa = virCapabilitiesHostNUMANewHost()))
|
if (!(caps->host.numa = virCapabilitiesHostNUMANewHost()))
|
||||||
goto no_memory;
|
return NULL;
|
||||||
|
|
||||||
if (virCapabilitiesInitCaches(caps) < 0)
|
if (virCapabilitiesInitCaches(caps) < 0)
|
||||||
goto no_memory;
|
return NULL;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
if ((guest = virCapabilitiesAddGuest(caps,
|
||||||
VIR_DOMAIN_OSTYPE_EXE,
|
VIR_DOMAIN_OSTYPE_EXE,
|
||||||
@ -168,7 +168,7 @@ virCapsPtr openvzCapsInit(void)
|
|||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
NULL)) == NULL)
|
NULL)) == NULL)
|
||||||
goto no_memory;
|
return NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
VIR_DOMAIN_VIRT_OPENVZ,
|
VIR_DOMAIN_VIRT_OPENVZ,
|
||||||
@ -176,13 +176,9 @@ virCapsPtr openvzCapsInit(void)
|
|||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
NULL) == NULL)
|
NULL) == NULL)
|
||||||
goto no_memory;
|
return NULL;
|
||||||
|
|
||||||
return caps;
|
return g_steal_pointer(&caps);
|
||||||
|
|
||||||
no_memory:
|
|
||||||
virObjectUnref(caps);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user