Skip to content

Commit

Permalink
util: Improve os_mem_prealloc error message
Browse files Browse the repository at this point in the history
Currently, when the preallocating guest memory process fails, a not
so helpful error message is printed out:

    # virsh start migt10
    error: Failed to start domain migt10
    error: internal error: process exited while connecting to monitor:
    os_mem_prealloc: failed to preallocate pages

From the error message it's not clear at the first glance where the
problem lies. However, changing the error message might give users a
clue.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
zippy2 authored and Michael Tokarev committed Nov 2, 2014
1 parent 2944d74 commit 404ac83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/oslib-posix.c
Expand Up @@ -390,7 +390,8 @@ void os_mem_prealloc(int fd, char *area, size_t memory)
pthread_sigmask(SIG_UNBLOCK, &set, &oldset);

if (sigsetjmp(sigjump, 1)) {
fprintf(stderr, "os_mem_prealloc: failed to preallocate pages\n");
fprintf(stderr, "os_mem_prealloc: Insufficient free host memory "
"pages available to allocate guest RAM\n");
exit(1);
} else {
int i;
Expand Down

0 comments on commit 404ac83

Please sign in to comment.