[PATCH 23/33] util: virprocess: abort() on CPU_ALLOC failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virprocess.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 41c5678537..69d64e9466 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -462,10 +462,8 @@ int virProcessSetAffinity(pid_t pid, virBitmapPtr map, bool quiet)
     masklen = CPU_ALLOC_SIZE(numcpus);
     mask = CPU_ALLOC(numcpus);

-    if (!mask) {
-        virReportOOMError();
-        return -1;
-    }
+    if (!mask)
+        abort();

     CPU_ZERO_S(masklen, mask);
     for (i = 0; i < virBitmapSize(map); i++) {
@@ -509,10 +507,8 @@ virProcessGetAffinity(pid_t pid)
     masklen = CPU_ALLOC_SIZE(ncpus);
     mask = CPU_ALLOC(ncpus);

-    if (!mask) {
-        virReportOOMError();
-        return NULL;
-    }
+    if (!mask)
+        abort();

     CPU_ZERO_S(masklen, mask);

-- 
2.29.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux