aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/exec.c b/exec.c
index 2b9c4c5ab6..1100208760 100644
--- a/exec.c
+++ b/exec.c
@@ -1059,9 +1059,9 @@ static void *file_ram_alloc(RAMBlock *block,
char *filename;
char *sanitized_name;
char *c;
- void *area;
+ void *area = NULL;
int fd;
- unsigned long hpagesize;
+ uint64_t hpagesize;
hpagesize = gethugepagesize(path);
if (!hpagesize) {
@@ -1069,7 +1069,10 @@ static void *file_ram_alloc(RAMBlock *block,
}
if (memory < hpagesize) {
- return NULL;
+ error_setg(errp, "memory size 0x" RAM_ADDR_FMT " must be equal to "
+ "or larger than huge page size 0x%" PRIx64,
+ memory, hpagesize);
+ goto error;
}
if (kvm_enabled() && !kvm_has_sync_mmu()) {