From c0e65398d9b77e660ab97a3c9e222bb989ddc839 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 24 Feb 2021 11:32:10 +0100 Subject: [PATCH] libxl: abort() on failure of libxl_cpu_bitmap_alloc() Attempting to report error in case when we ran out of memory is pointless. Signed-off-by: Peter Krempa Reviewed-by: Laine Stump --- 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.47.2