qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC 7/8] exec: Don't abort when we can't allocat


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH RFC 7/8] exec: Don't abort when we can't allocate guest memory
Date: Thu, 13 Jun 2013 17:21:08 +0100

On 13 June 2013 08:02, Markus Armbruster <address@hidden> wrote:
>  #ifdef __linux__
>
> +static void no_guest_mem(RAMBlock *block)
> +{
> +    fprintf(stderr, "Cannot set up guest memory '%s': %s\n",
> +            block->mr->name, strerror(errno));
> +    exit(1);
> +}

This new error message is inside an #ifdef __linux__...

> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -112,9 +112,7 @@ void *qemu_anon_ram_alloc(size_t size)
>      size_t offset = QEMU_ALIGN_UP((uintptr_t)ptr, align) - (uintptr_t)ptr;
>
>      if (ptr == MAP_FAILED) {
> -        fprintf(stderr, "Failed to allocate %zu B: %s\n",
> -                size, strerror(errno));
> -        abort();
> +        return NULL;

...but this error message which got removed is not.
Shouldn't we be reporting errors in a non-host-specific
bit of code?

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]