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

2013-06-13 Thread Markus Armbruster
Peter Maydell writes: > On 13 June 2013 08:02, Markus Armbruster 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

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

2013-06-13 Thread Markus Armbruster
Richard Henderson writes: > On 06/13/2013 12:02 AM, Markus Armbruster wrote: >> @@ -945,7 +952,7 @@ static void *file_ram_alloc(RAMBlock *block, >> area = mmap(0, memory, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); >> #endif >> if (area == MAP_FAILED) { >> -perror("file_ram_al

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

2013-06-13 Thread Peter Maydell
On 13 June 2013 08:02, Markus Armbruster 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

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

2013-06-13 Thread Richard Henderson
On 06/13/2013 12:02 AM, Markus Armbruster wrote: > @@ -945,7 +952,7 @@ static void *file_ram_alloc(RAMBlock *block, > area = mmap(0, memory, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); > #endif > if (area == MAP_FAILED) { > -perror("file_ram_alloc: can't mmap RAM pages"); > +

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

2013-06-13 Thread Andreas Färber
Am 13.06.2013 09:02, schrieb Markus Armbruster: > We abort() on memory allocation failure. abort() is appropriate for > programming errors. Maybe most memory allocation failures are > programming errors, maybe not. But guest memory allocation failure > isn't, and aborting when the user asks for

[Qemu-devel] [PATCH RFC 7/8] exec: Don't abort when we can't allocate guest memory

2013-06-13 Thread Markus Armbruster
We abort() on memory allocation failure. abort() is appropriate for programming errors. Maybe most memory allocation failures are programming errors, maybe not. But guest memory allocation failure isn't, and aborting when the user asks for more memory than we can provide is not nice. exit(1) in