[PATCH 28/33] libxl: abort() on failure of libxl_cpu_bitmap_alloc()

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

 



Attempting to report error in case when we ran out of memory is
pointless.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/libxl/libxl_conf.c   | 6 ++----
 src/libxl/libxl_driver.c | 7 +++----
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index f8db118996..f2bcd77a29 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -854,10 +854,8 @@ libxlMakeVnumaList(virDomainDefPtr def,
             goto cleanup;

         libxl_bitmap_init(&vcpu_bitmap);
-        if (libxl_cpu_bitmap_alloc(ctx, &vcpu_bitmap, b_info->max_vcpus)) {
-            virReportOOMError();
-            goto cleanup;
-        }
+        if (libxl_cpu_bitmap_alloc(ctx, &vcpu_bitmap, b_info->max_vcpus))
+            abort();

         do {
             libxl_bitmap_set(&vcpu_bitmap, cpu);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 75a8d46af0..434959d694 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -4931,10 +4931,9 @@ libxlDomainGetNumaParameters(virDomainPtr dom,
             if (numnodes <= 0)
                 goto cleanup;

-            if (libxl_node_bitmap_alloc(cfg->ctx, &nodemap, 0)) {
-                virReportOOMError();
-                goto cleanup;
-            }
+            if (libxl_node_bitmap_alloc(cfg->ctx, &nodemap, 0))
+                abort();
+
             nodes = virBitmapNew(numnodes);

             rc = libxl_domain_get_nodeaffinity(cfg->ctx,
-- 
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