mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
util: virprocess: abort() on CPU_ALLOC failure
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
5f5b676086
commit
06fc9f8e32
@ -462,10 +462,8 @@ int virProcessSetAffinity(pid_t pid, virBitmapPtr map, bool quiet)
|
|||||||
masklen = CPU_ALLOC_SIZE(numcpus);
|
masklen = CPU_ALLOC_SIZE(numcpus);
|
||||||
mask = CPU_ALLOC(numcpus);
|
mask = CPU_ALLOC(numcpus);
|
||||||
|
|
||||||
if (!mask) {
|
if (!mask)
|
||||||
virReportOOMError();
|
abort();
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPU_ZERO_S(masklen, mask);
|
CPU_ZERO_S(masklen, mask);
|
||||||
for (i = 0; i < virBitmapSize(map); i++) {
|
for (i = 0; i < virBitmapSize(map); i++) {
|
||||||
@ -509,10 +507,8 @@ virProcessGetAffinity(pid_t pid)
|
|||||||
masklen = CPU_ALLOC_SIZE(ncpus);
|
masklen = CPU_ALLOC_SIZE(ncpus);
|
||||||
mask = CPU_ALLOC(ncpus);
|
mask = CPU_ALLOC(ncpus);
|
||||||
|
|
||||||
if (!mask) {
|
if (!mask)
|
||||||
virReportOOMError();
|
abort();
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPU_ZERO_S(masklen, mask);
|
CPU_ZERO_S(masklen, mask);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user